zhwl/zhwl-business/zhwl-points-mall/target/classes/mapper/pointsMall/PointsRedeemLogMapper.xml

175 lines
6.3 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.pointsmall.mapper.PointsRedeemLogMapper">
<resultMap type="PointsRedeemLog" id="PointsRedeemLogResult">
<result property="id" column="id"/>
<result property="ticketId" column="ticket_id"/>
<result property="ticketNameOrder" column="ticket_name_order"/>
<result property="orderId" column="order_id"/>
<result property="orderCode" column="order_code"/>
<result property="ticketType" column="ticket_type"/>
<result property="points" column="points"/>
<result property="createTime" column="create_time"/>
<result property="userId" column="user_id"/>
<result property="nickname" column="nickname"/>
<result property="buyQuantity" column="buy_quantity"/>
</resultMap>
<sql id="selectPointsRedeemLogVo">
select id,
ticket_id,
ticket_name_order,
order_id,
order_code,
ticket_type,
points,
create_time,
user_id,
nickname,
buy_quantity
from zdy_points_redeem_log
</sql>
<select id="selectPointsRedeemLogList" parameterType="PointsRedeemLog" resultMap="PointsRedeemLogResult">
<include refid="selectPointsRedeemLogVo"/>
<where>
<if test="ticketId != null ">
and ticket_id = #{ticketId}
</if>
<if test="ticketNameOrder != null and ticketNameOrder != ''">
and ticket_name_order = #{ticketNameOrder}
</if>
<if test="orderId != null ">
and order_id = #{orderId}
</if>
<if test="orderCode != null and orderCode != ''">
and order_code = #{orderCode}
</if>
<if test="ticketType != null and ticketType != ''">
and ticket_type = #{ticketType}
</if>
<if test="points != null ">
and points = #{points}
</if>
<if test="userId != null ">
and user_id = #{userId}
</if>
<if test="nickname != null and nickname != ''">
and nickname like concat('%', #{nickname}, '%')
</if>
</where>
order by id desc
</select>
<select id="selectPointsRedeemLogById" parameterType="Long"
resultMap="PointsRedeemLogResult">
<include refid="selectPointsRedeemLogVo"/>
where id = #{id}
</select>
<insert id="insertPointsRedeemLog" parameterType="PointsRedeemLog" useGeneratedKeys="true" keyProperty="id">
insert into zdy_points_redeem_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,
</if>
<if test="ticketId != null">ticket_id,
</if>
<if test="ticketNameOrder != null and ticketNameOrder != ''">ticket_name_order,
</if>
<if test="orderId != null">order_id,
</if>
<if test="orderCode != null and orderCode != ''">order_code,
</if>
<if test="ticketType != null and ticketType != ''">ticket_type,
</if>
<if test="points != null">points,
</if>
<if test="createTime != null">create_time,
</if>
<if test="userId != null">user_id,
</if>
<if test="nickname != null and nickname != ''">nickname,
</if>
<if test="buyQuantity != null">buy_quantity,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},
</if>
<if test="ticketId != null">#{ticketId},
</if>
<if test="ticketNameOrder != null and ticketNameOrder != ''">#{ticketNameOrder},
</if>
<if test="orderId != null">#{orderId},
</if>
<if test="orderCode != null and orderCode != ''">#{orderCode},
</if>
<if test="ticketType != null and ticketType != ''">#{ticketType},
</if>
<if test="points != null">#{points},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="userId != null">#{userId},
</if>
<if test="nickname != null and nickname != ''">#{nickname},
</if>
<if test="buyQuantity != null">#{buyQuantity},
</if>
</trim>
</insert>
<update id="updatePointsRedeemLog" parameterType="PointsRedeemLog">
update zdy_points_redeem_log
<trim prefix="SET" suffixOverrides=",">
<if test="ticketId != null">ticket_id =
#{ticketId},
</if>
<if test="ticketNameOrder != null and ticketNameOrder != ''">ticket_name_order =
#{ticketNameOrder},
</if>
<if test="orderId != null">order_id =
#{orderId},
</if>
<if test="orderCode != null and orderCode != ''">order_code =
#{orderCode},
</if>
<if test="ticketType != null and ticketType != ''">ticket_type =
#{ticketType},
</if>
<if test="points != null">points =
#{points},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="userId != null">user_id =
#{userId},
</if>
<if test="nickname != null and nickname != ''">nickname =
#{nickname},
</if>
<if test="buyQuantity != null">buy_quantity =
#{buyQuantity},
</if>
</trim>
where id = #{id}
</update>
<delete id="deletePointsRedeemLogById" parameterType="Long">
delete
from zdy_points_redeem_log
where id = #{id}
</delete>
<delete id="deletePointsRedeemLogByIds" parameterType="String">
delete from zdy_points_redeem_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>