mapper.shop.StoreCouponListMapper.xml Maven / Gradle / Ivy
The newest version!
<?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.jblv.shop.mapper.StoreCouponListMapper"> <resultMap type="StoreCouponList" id="StoreCouponListResult"> <result property="id" column="id" /> <result property="cid" column="cid" /> <result property="type" column="type" /> <result property="uid" column="uid" /> <result property="orderId" column="order_id" /> <result property="getOrderId" column="get_order_id" /> <result property="useTime" column="use_time" /> <result property="code" column="code" /> <result property="sendTime" column="send_time" /> <result property="status" column="status" /> </resultMap> <sql id="selectStoreCouponListVo"> select id, cid, type, uid, order_id, get_order_id, use_time, code, send_time, status from store_coupon_list </sql> <select id="selectStoreCouponListList" parameterType="StoreCouponList" resultMap="StoreCouponListResult"> <include refid="selectStoreCouponListVo"/> <where> <if test="cid != null "> and cid = #{cid}</if> <if test="type != null "> and type = #{type}</if> <if test="uid != null "> and uid = #{uid}</if> <if test="orderId != null "> and order_id = #{orderId}</if> <if test="getOrderId != null "> and get_order_id = #{getOrderId}</if> <if test="useTime != null "> and use_time = #{useTime}</if> <if test="code != null and code != ''"> and code = #{code}</if> <if test="sendTime != null "> and send_time = #{sendTime}</if> <if test="status != null "> and status = #{status}</if> </where> </select> <select id="selectStoreCouponListById" parameterType="Integer" resultMap="StoreCouponListResult"> <include refid="selectStoreCouponListVo"/> where id = #{id} </select> <insert id="insertStoreCouponList" parameterType="StoreCouponList" useGeneratedKeys="true" keyProperty="id"> insert into store_coupon_list <trim prefix="(" suffix=")" suffixOverrides=","> <if test="cid != null ">cid,</if> <if test="type != null ">type,</if> <if test="uid != null ">uid,</if> <if test="orderId != null ">order_id,</if> <if test="getOrderId != null ">get_order_id,</if> <if test="useTime != null ">use_time,</if> <if test="code != null and code != ''">code,</if> <if test="sendTime != null ">send_time,</if> <if test="status != null ">status,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="cid != null ">#{cid},</if> <if test="type != null ">#{type},</if> <if test="uid != null ">#{uid},</if> <if test="orderId != null ">#{orderId},</if> <if test="getOrderId != null ">#{getOrderId},</if> <if test="useTime != null ">#{useTime},</if> <if test="code != null and code != ''">#{code},</if> <if test="sendTime != null ">#{sendTime},</if> <if test="status != null ">#{status},</if> </trim> </insert> <update id="updateStoreCouponList" parameterType="StoreCouponList"> update store_coupon_list <trim prefix="SET" suffixOverrides=","> <if test="cid != null ">cid = #{cid},</if> <if test="type != null ">type = #{type},</if> <if test="uid != null ">uid = #{uid},</if> <if test="orderId != null ">order_id = #{orderId},</if> <if test="getOrderId != null ">get_order_id = #{getOrderId},</if> <if test="useTime != null ">use_time = #{useTime},</if> <if test="code != null and code != ''">code = #{code},</if> <if test="sendTime != null ">send_time = #{sendTime},</if> <if test="status != null ">status = #{status},</if> </trim> where id = #{id} </update> <delete id="deleteStoreCouponListById" parameterType="Integer"> delete from store_coupon_list where id = #{id} </delete> <delete id="deleteStoreCouponListByIds" parameterType="String"> delete from store_coupon_list where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper>