zhwl/zhwl-business/zhwl-vip/target/classes/mapper/vip/ZdyVipGrowthValueMapper.xml

146 lines
5.4 KiB
XML
Raw Permalink Normal View History

2025-07-01 17:54:58 +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.zhwl.vip.mapper.ZdyVipGrowthValueMapper">
<resultMap type="ZdyVipGrowthValue" id="ZdyVipGrowthValueResult">
<result property="id" column="id"/>
<result property="vipUserId" column="vip_user_id"/>
<result property="beforeValue" column="before_value"/>
<result property="changeValue" column="change_value"/>
<result property="afterValue" column="after_value"/>
<result property="reason" column="reason"/>
<result property="relationOrderType" column="relation_order_type"/>
<result property="relationOrderCode" column="relation_order_code"/>
<result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectZdyVipGrowthValueVo">
select id,
vip_user_id,
before_value,
change_value,
after_value,
reason,
relation_order_type,
relation_order_code,
create_time
from zdy_vip_growth_value
</sql>
<select id="selectZdyVipGrowthValueList" parameterType="ZdyVipGrowthValue" resultMap="ZdyVipGrowthValueResult">
<include refid="selectZdyVipGrowthValueVo"/>
<where>
<if test="vipUserId != null ">
and vip_user_id = #{vipUserId}
</if>
<if test="reason != null and reason != ''">
and reason = #{reason}
</if>
<if test="relationOrderType != null and relationOrderType != ''">
and relation_order_type = #{relationOrderType}
</if>
<if test="relationOrderCode != null and relationOrderCode != ''">
and relation_order_code = #{relationOrderCode}
</if>
</where>
order by create_time desc
</select>
<select id="selectZdyVipGrowthValueById" parameterType="Long"
resultMap="ZdyVipGrowthValueResult">
<include refid="selectZdyVipGrowthValueVo"/>
where id = #{id}
</select>
<select id="selectZdyVipGrowthValueByVipUserId" parameterType="Long"
resultMap="ZdyVipGrowthValueResult">
<include refid="selectZdyVipGrowthValueVo"/>
where vip_user_id = #{vipUserId}
order by create_time desc
</select>
<insert id="insertZdyVipGrowthValue" parameterType="ZdyVipGrowthValue" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_vip_growth_value
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="vipUserId != null">vip_user_id,
</if>
<if test="beforeValue != null">before_value,
</if>
<if test="changeValue != null">change_value,
</if>
<if test="afterValue != null">after_value,
</if>
<if test="reason != null and reason != ''">reason,
</if>
<if test="relationOrderType != null">relation_order_type,
</if>
<if test="relationOrderCode != null">relation_order_code,
</if>
<if test="createTime != null">create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="vipUserId != null">#{vipUserId},
</if>
<if test="beforeValue != null">#{beforeValue},
</if>
<if test="changeValue != null">#{changeValue},
</if>
<if test="afterValue != null">#{afterValue},
</if>
<if test="reason != null and reason != ''">#{reason},
</if>
<if test="relationOrderType != null">#{relationOrderType},
</if>
<if test="relationOrderCode != null">#{relationOrderCode},
</if>
<if test="createTime != null">#{createTime},
</if>
</trim>
</insert>
<update id="updateZdyVipGrowthValue" parameterType="ZdyVipGrowthValue">
update zdy_vip_growth_value
<trim prefix="SET" suffixOverrides=",">
<if test="beforeValue != null">before_value =
#{beforeValue},
</if>
<if test="changeValue != null">change_value =
#{changeValue},
</if>
<if test="afterValue != null">after_value =
#{afterValue},
</if>
<if test="reason != null and reason != ''">reason =
#{reason},
</if>
<if test="relationOrderType != null">relation_order_type =
#{relationOrderType},
</if>
<if test="relationOrderCode != null">relation_order_code =
#{relationOrderCode},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyVipGrowthValueById" parameterType="Long">
delete
from zdy_vip_growth_value
where id = #{id}
</delete>
<delete id="deleteZdyVipGrowthValueByIds" parameterType="String">
delete from zdy_vip_growth_value where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>