|
@@ -3,9 +3,10 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.yijia.coupon.mapper.CouponIssueMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="CouponIssue" id="CouponIssueResult">
|
|
|
<result property="id" column="id" />
|
|
|
+ <result property="issueName" column="issue_name" />
|
|
|
<result property="issueType" column="issue_type" />
|
|
|
<result property="discountThresholdAmt" column="discount_threshold_amt" />
|
|
|
<result property="status" column="status" />
|
|
@@ -15,31 +16,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="showId" column="show_id" />
|
|
|
+ <result property="appointedDays" column="appointed_days" />
|
|
|
+ <result property="cycleDays" column="cycle_days" />
|
|
|
+ <result property="availableControl" column="available_control" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCouponIssueVo">
|
|
|
- select id, issue_type, discount_threshold_amt, status, station_id, create_by, create_time, update_by, update_time, show_id from coupon_issue
|
|
|
+ select id,issue_name, issue_type, discount_threshold_amt, status, station_id, create_by, create_time, update_by, update_time, show_id,
|
|
|
+ appointed_days,cycle_days,available_control
|
|
|
+ from coupon_issue
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectCouponIssueList" parameterType="CouponIssue" resultMap="CouponIssueResult">
|
|
|
<include refid="selectCouponIssueVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
+ <if test="issueName != null and issueName != ''"> and issue_name = #{issueName}</if>
|
|
|
<if test="issueType != null and issueType != ''"> and issue_type = #{issueType}</if>
|
|
|
<if test="discountThresholdAmt != null "> and discount_threshold_amt = #{discountThresholdAmt}</if>
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
<if test="stationId != null "> and station_id = #{stationId}</if>
|
|
|
<if test="showId != null and showId != ''"> and show_id = #{showId}</if>
|
|
|
+ <if test="appointedDays != null and appointedDays != ''"> and appointed_days = #{appointedDays}</if>
|
|
|
+ <if test="cycleDays != null and cycleDays != ''"> and cycle_days = #{cycleDays}</if>
|
|
|
+ <if test="availableControl != null and availableControl != ''"> and available_control = #{availableControl}</if>
|
|
|
</where>
|
|
|
+ order by id desc
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectCouponIssueById" parameterType="Integer" resultMap="CouponIssueResult">
|
|
|
<include refid="selectCouponIssueVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertCouponIssue" parameterType="CouponIssue" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into coupon_issue
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="issueName != null">issue_name,</if>
|
|
|
<if test="issueType != null">issue_type,</if>
|
|
|
<if test="discountThresholdAmt != null">discount_threshold_amt,</if>
|
|
|
<if test="status != null">status,</if>
|
|
@@ -49,8 +61,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
<if test="showId != null">show_id,</if>
|
|
|
+ <if test="appointedDays != null">appointed_days,</if>
|
|
|
+ <if test="cycleDays != null">cycle_days,</if>
|
|
|
+ <if test="availableControl != null">available_control,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="issueName != null">#{issueName},</if>
|
|
|
<if test="issueType != null">#{issueType},</if>
|
|
|
<if test="discountThresholdAmt != null">#{discountThresholdAmt},</if>
|
|
|
<if test="status != null">#{status},</if>
|
|
@@ -60,12 +76,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="showId != null">#{showId},</if>
|
|
|
+ <if test="appointedDays != null">#{appointedDays},</if>
|
|
|
+ <if test="cycleDays != null">#{cycleDays},</if>
|
|
|
+ <if test="availableControl != null">#{availableControl},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateCouponIssue" parameterType="CouponIssue">
|
|
|
update coupon_issue
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="issueName != null">issue_name = #{issueName},</if>
|
|
|
<if test="issueType != null">issue_type = #{issueType},</if>
|
|
|
<if test="discountThresholdAmt != null">discount_threshold_amt = #{discountThresholdAmt},</if>
|
|
|
<if test="status != null">status = #{status},</if>
|
|
@@ -75,6 +95,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
<if test="showId != null">show_id = #{showId},</if>
|
|
|
+ <if test="appointedDays != null">appointed_days = #{appointedDays},</if>
|
|
|
+ <if test="cycleDays != null">cycle_days = #{cycleDays},</if>
|
|
|
+ <if test="availableControl != null">available_control = #{availableControl},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
@@ -84,10 +107,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteCouponIssueByIds" parameterType="String">
|
|
|
- delete from coupon_issue where id in
|
|
|
+ delete from coupon_issue where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
-</mapper>
|
|
|
+
|
|
|
+</mapper>
|