Files
jsowell-charger-web/jsowell-pile/src/main/resources/mapper/pile/MemberWalletInfoMapper.xml
2023-03-04 16:29:55 +08:00

170 lines
6.3 KiB
XML

<?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="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, principal_balance, gift_balance, version, create_by, create_time,
update_by, update_time, del_flag
</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" parameterType="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
insert into member_wallet_info (id, member_id, principal_balance,
gift_balance, version, create_by,
create_time, update_by, update_time,
del_flag)
values (#{id,jdbcType=INTEGER}, #{memberId,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})
</insert>
<insert id="insertSelective" parameterType="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
insert into member_wallet_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="memberId != null and memberId != ''">
member_id,
</if>
<if test="principalBalance != null">
principal_balance,
</if>
<if test="giftBalance != null">
gift_balance,
</if>
<if test="version != null">
version,
</if>
<if test="createBy != null and createBy != ''">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null and updateBy != ''">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null and delFlag != ''">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="memberId != null and memberId != ''">
#{memberId,jdbcType=VARCHAR},
</if>
<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 and createBy != ''">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null and updateBy != ''">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null and delFlag != ''">
#{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 and memberId != ''">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<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 and createBy != ''">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null and delFlag != ''">
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},
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>