|
@@ -0,0 +1,183 @@
|
|
|
+<?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="zhsq_qk.system.mapper.QkJczlDiscountMapper">
|
|
|
+
|
|
|
+ <resultMap type="QkJczlDiscount" id="QkJczlDiscountResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="activityType" column="activity_type"/>
|
|
|
+ <result property="productType" column="product_type"/>
|
|
|
+ <result property="activityTitle" column="activity_title"/>
|
|
|
+ <result property="business" column="business"/>
|
|
|
+ <result property="details" column="details"/>
|
|
|
+ <result property="address" column="address"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="merchantId" column="merchant_id"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectQkJczlDiscountVo">
|
|
|
+ select id, activity_type, product_type, activity_title, business, details, address, create_by, create_time, update_by, update_time, merchant_id
|
|
|
+ from qk_jczl_discount
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectQkJczlDiscountList" parameterType="QkJczlDiscount" resultMap="QkJczlDiscountResult">
|
|
|
+ <include refid="selectQkJczlDiscountVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="activityType != null and activityType != ''">
|
|
|
+ and activity_type = #{activityType}
|
|
|
+ </if>
|
|
|
+ <if test="productType != null and productType != ''">
|
|
|
+ and product_type = #{productType}
|
|
|
+ </if>
|
|
|
+ <if test="activityTitle != null and activityTitle != ''">
|
|
|
+ and activity_title = #{activityTitle}
|
|
|
+ </if>
|
|
|
+ <if test="business != null and business != ''">
|
|
|
+ and business = #{business}
|
|
|
+ </if>
|
|
|
+ <if test="details != null and details != ''">
|
|
|
+ and details = #{details}
|
|
|
+ </if>
|
|
|
+ <if test="address != null and address != ''">
|
|
|
+ and address = #{address}
|
|
|
+ </if>
|
|
|
+ <if test="merchantId != null and merchantId != ''">
|
|
|
+ and merchant_id = #{merchantId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectQkJczlDiscountById" parameterType="Long"
|
|
|
+ resultMap="QkJczlDiscountResult">
|
|
|
+ SELECT
|
|
|
+ a.id,
|
|
|
+ a.activity_type,
|
|
|
+ b.merchant_name,
|
|
|
+ a.product_type,
|
|
|
+ a.activity_title,
|
|
|
+ a.business,
|
|
|
+ a.details,
|
|
|
+ a.address,
|
|
|
+ a.create_by,
|
|
|
+ a.create_time,
|
|
|
+ a.update_by,
|
|
|
+ a.update_time,
|
|
|
+ a.merchant_id
|
|
|
+ FROM
|
|
|
+ qk_jczl_discount a
|
|
|
+ left join qk_jczl_merchant b on a.merchant_id = b.id
|
|
|
+ where a.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertQkJczlDiscount" parameterType="QkJczlDiscount">
|
|
|
+ insert into qk_jczl_discount
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,
|
|
|
+ </if>
|
|
|
+ <if test="activityType != null">activity_type,
|
|
|
+ </if>
|
|
|
+ <if test="productType != null">product_type,
|
|
|
+ </if>
|
|
|
+ <if test="activityTitle != null">activity_title,
|
|
|
+ </if>
|
|
|
+ <if test="business != null">business,
|
|
|
+ </if>
|
|
|
+ <if test="details != null">details,
|
|
|
+ </if>
|
|
|
+ <if test="address != null">address,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">update_time,
|
|
|
+ </if>
|
|
|
+ <if test="merchantId != null">merchant_id,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},
|
|
|
+ </if>
|
|
|
+ <if test="activityType != null">#{activityType},
|
|
|
+ </if>
|
|
|
+ <if test="productType != null">#{productType},
|
|
|
+ </if>
|
|
|
+ <if test="activityTitle != null">#{activityTitle},
|
|
|
+ </if>
|
|
|
+ <if test="business != null">#{business},
|
|
|
+ </if>
|
|
|
+ <if test="details != null">#{details},
|
|
|
+ </if>
|
|
|
+ <if test="address != null">#{address},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">#{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">#{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">#{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">#{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="merchantId != null">#{merchantId},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateQkJczlDiscount" parameterType="QkJczlDiscount">
|
|
|
+ update qk_jczl_discount
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="activityType != null">activity_type =
|
|
|
+ #{activityType},
|
|
|
+ </if>
|
|
|
+ <if test="productType != null">product_type =
|
|
|
+ #{productType},
|
|
|
+ </if>
|
|
|
+ <if test="activityTitle != null">activity_title =
|
|
|
+ #{activityTitle},
|
|
|
+ </if>
|
|
|
+ <if test="business != null">business =
|
|
|
+ #{business},
|
|
|
+ </if>
|
|
|
+ <if test="details != null">details =
|
|
|
+ #{details},
|
|
|
+ </if>
|
|
|
+ <if test="address != null">address =
|
|
|
+ #{address},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by =
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time =
|
|
|
+ #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by =
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">update_time =
|
|
|
+ #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="merchantId != null">merchant_id =
|
|
|
+ #{merchantId},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteQkJczlDiscountById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from qk_jczl_discount where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteQkJczlDiscountByIds" parameterType="String">
|
|
|
+ delete from qk_jczl_discount where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|