| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <?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.fs.live.mapper.LiveCouponMapper">
- <resultMap type="LiveCoupon" id="LiveCouponResult">
- <result property="couponId" column="coupon_id" />
- <result property="title" column="title" />
- <result property="integral" column="integral" />
- <result property="couponPrice" column="coupon_price" />
- <result property="useMinPrice" column="use_min_price" />
- <result property="couponTime" column="coupon_time" />
- <result property="sort" column="sort" />
- <result property="status" column="status" />
- <result property="productIds" column="product_ids" />
- <result property="packageCateIds" column="package_cate_ids" />
- <result property="type" column="type" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="isDel" column="is_del" />
- <result property="limitReceiveCount" column="limit_receive_count" />
- </resultMap>
- <sql id="selectLiveCouponVo">
- select coupon_id, title, integral, coupon_price, use_min_price, coupon_time, sort, status, product_ids, package_cate_ids, type, create_time, update_time, is_del,limit_receive_count from live_coupon
- </sql>
- <select id="selectLiveCouponList" parameterType="LiveCoupon" resultMap="LiveCouponResult">
- <include refid="selectLiveCouponVo"/>
- <where>
- <if test="title != null and title != ''"> and title = #{title}</if>
- <if test="integral != null and integral != ''"> and integral = #{integral}</if>
- <if test="couponPrice != null "> and coupon_price = #{couponPrice}</if>
- <if test="useMinPrice != null "> and use_min_price = #{useMinPrice}</if>
- <if test="couponTime != null "> and coupon_time = #{couponTime}</if>
- <if test="sort != null "> and sort = #{sort}</if>
- <if test="status != null "> and status = #{status}</if>
- <if test="productIds != null and productIds != ''"> and product_ids = #{productIds}</if>
- <if test="packageCateIds != null and packageCateIds != ''"> and package_cate_ids = #{packageCateIds}</if>
- <if test="type != null "> and type = #{type}</if>
- <if test="isDel != null "> and is_del = #{isDel}</if>
- <if test="limitReceiveCount != null "> and limit_receive_count = #{limitReceiveCount}</if>
- </where>
- </select>
- <select id="selectLiveCouponById" parameterType="Long" resultMap="LiveCouponResult">
- <include refid="selectLiveCouponVo"/>
- where coupon_id = #{couponId}
- </select>
- <insert id="insertLiveCoupon" parameterType="LiveCoupon" useGeneratedKeys="true" keyProperty="couponId">
- insert into live_coupon
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="title != null and title != ''">title,</if>
- <if test="integral != null">integral,</if>
- <if test="couponPrice != null">coupon_price,</if>
- <if test="useMinPrice != null">use_min_price,</if>
- <if test="couponTime != null">coupon_time,</if>
- <if test="sort != null">sort,</if>
- <if test="status != null">status,</if>
- <if test="productIds != null">product_ids,</if>
- <if test="packageCateIds != null">package_cate_ids,</if>
- <if test="type != null">type,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="isDel != null">is_del,</if>
- <if test="limitReceiveCount != null">limit_receive_count,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="title != null and title != ''">#{title},</if>
- <if test="integral != null">#{integral},</if>
- <if test="couponPrice != null">#{couponPrice},</if>
- <if test="useMinPrice != null">#{useMinPrice},</if>
- <if test="couponTime != null">#{couponTime},</if>
- <if test="sort != null">#{sort},</if>
- <if test="status != null">#{status},</if>
- <if test="productIds != null">#{productIds},</if>
- <if test="packageCateIds != null">#{packageCateIds},</if>
- <if test="type != null">#{type},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="isDel != null">#{isDel},</if>
- <if test="limitReceiveCount != null">#{limitReceiveCount},</if>
- </trim>
- </insert>
- <update id="updateLiveCoupon" parameterType="LiveCoupon">
- update live_coupon
- <trim prefix="SET" suffixOverrides=",">
- <if test="title != null and title != ''">title = #{title},</if>
- <if test="integral != null">integral = #{integral},</if>
- <if test="couponPrice != null">coupon_price = #{couponPrice},</if>
- <if test="useMinPrice != null">use_min_price = #{useMinPrice},</if>
- <if test="couponTime != null">coupon_time = #{couponTime},</if>
- <if test="sort != null">sort = #{sort},</if>
- <if test="status != null">status = #{status},</if>
- <if test="productIds != null">product_ids = #{productIds},</if>
- <if test="packageCateIds != null">package_cate_ids = #{packageCateIds},</if>
- <if test="type != null">type = #{type},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="isDel != null">is_del = #{isDel},</if>
- <if test="limitReceiveCount != null">limit_receive_count = #{limitReceiveCount},</if>
- </trim>
- where coupon_id = #{couponId}
- </update>
- <delete id="deleteLiveCouponById" parameterType="Long">
- delete from live_coupon where coupon_id = #{couponId}
- </delete>
- <delete id="deleteLiveCouponByIds" parameterType="String">
- delete from live_coupon where coupon_id in
- <foreach item="couponId" collection="array" open="(" separator="," close=")">
- #{couponId}
- </foreach>
- </delete>
- <delete id="handleDeleteSelectedAdmin" parameterType="com.fs.live.vo.LiveCouponListVo">
- delete from live_coupon_issue_relation
- WHERE live_id = #{listVo.liveId} AND coupon_issue_id IN
- <foreach item="couponId" collection="listVo.couponIds" open="(" separator="," close=")">
- #{couponId}
- </foreach>
- </delete>
- <update id="updateLiveCouponBind" parameterType="com.fs.live.vo.LiveCouponListVo">
- update live_coupon_issue_relation set goods_id = #{listVo.goodsId}
- WHERE live_id = #{listVo.liveId} AND coupon_issue_id = #{listVo.couponId}
- </update>
- </mapper>
|