Files
jsowell-charger-web/jsowell-pile/src/main/resources/mapper/pile/MemberWalletInfoMapper.xml

186 lines
6.9 KiB
XML
Raw Normal View History

2023-03-04 16:29:55 +08:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsowell.pile.mapper.MemberWalletInfoMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
<!--@Table member_wallet_info-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
<result column="wallet_code" jdbcType="VARCHAR" property="walletCode" />
2023-03-04 16:29:55 +08:00
<result column="principal_balance" jdbcType="DECIMAL" property="principalBalance" />
<result column="gift_balance" jdbcType="DECIMAL" property="giftBalance" />
<result column="version" jdbcType="INTEGER" property="version" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="CHAR" property="delFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, member_id, merchant_id, wallet_code, principal_balance, gift_balance, version,
create_by, create_time, update_by, update_time, del_flag
2023-03-04 16:29:55 +08:00
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from member_wallet_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from member_wallet_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletInfo" useGeneratedKeys="true">
2023-03-04 16:29:55 +08:00
<!--@mbg.generated-->
insert into member_wallet_info (member_id, merchant_id, wallet_code,
principal_balance, gift_balance, version,
create_by, create_time, update_by,
update_time, del_flag)
values (#{memberId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{walletCode,jdbcType=VARCHAR},
#{principalBalance,jdbcType=DECIMAL}, #{giftBalance,jdbcType=DECIMAL}, #{version,jdbcType=INTEGER},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR})
2023-03-04 16:29:55 +08:00
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletInfo" useGeneratedKeys="true">
2023-03-04 16:29:55 +08:00
<!--@mbg.generated-->
insert into member_wallet_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="memberId != null">
2023-03-04 16:29:55 +08:00
member_id,
</if>
<if test="merchantId != null">
merchant_id,
</if>
<if test="walletCode != null">
wallet_code,
</if>
2023-03-04 16:29:55 +08:00
<if test="principalBalance != null">
principal_balance,
</if>
<if test="giftBalance != null">
gift_balance,
</if>
<if test="version != null">
version,
</if>
<if test="createBy != null">
2023-03-04 16:29:55 +08:00
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
2023-03-04 16:29:55 +08:00
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
2023-03-04 16:29:55 +08:00
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="memberId != null">
2023-03-04 16:29:55 +08:00
#{memberId,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
#{merchantId,jdbcType=VARCHAR},
</if>
<if test="walletCode != null">
#{walletCode,jdbcType=VARCHAR},
</if>
2023-03-04 16:29:55 +08:00
<if test="principalBalance != null">
#{principalBalance,jdbcType=DECIMAL},
</if>
<if test="giftBalance != null">
#{giftBalance,jdbcType=DECIMAL},
</if>
<if test="version != null">
#{version,jdbcType=INTEGER},
</if>
<if test="createBy != null">
2023-03-04 16:29:55 +08:00
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
2023-03-04 16:29:55 +08:00
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
2023-03-04 16:29:55 +08:00
#{delFlag,jdbcType=CHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
update member_wallet_info
<set>
<if test="memberId != null">
2023-03-04 16:29:55 +08:00
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=VARCHAR},
</if>
<if test="walletCode != null">
wallet_code = #{walletCode,jdbcType=VARCHAR},
</if>
2023-03-04 16:29:55 +08:00
<if test="principalBalance != null">
principal_balance = #{principalBalance,jdbcType=DECIMAL},
</if>
<if test="giftBalance != null">
gift_balance = #{giftBalance,jdbcType=DECIMAL},
</if>
<if test="version != null">
version = #{version,jdbcType=INTEGER},
</if>
<if test="createBy != null">
2023-03-04 16:29:55 +08:00
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
2023-03-04 16:29:55 +08:00
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
2023-03-04 16:29:55 +08:00
del_flag = #{delFlag,jdbcType=CHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
update member_wallet_info
set member_id = #{memberId,jdbcType=VARCHAR},
merchant_id = #{merchantId,jdbcType=VARCHAR},
wallet_code = #{walletCode,jdbcType=VARCHAR},
2023-03-04 16:29:55 +08:00
principal_balance = #{principalBalance,jdbcType=DECIMAL},
gift_balance = #{giftBalance,jdbcType=DECIMAL},
version = #{version,jdbcType=INTEGER},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=CHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByMemberId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from member_wallet_info
where member_id = #{memberId,jdbcType=INTEGER}
and del_flag = '0'
</select>
</mapper>