|
@@ -6,6 +6,7 @@
|
|
|
|
|
|
<resultMap type="com.bosshand.virgo.api.workark.model.ProductCoupon" id="result">
|
|
|
<id column="id" property="id"/>
|
|
|
+ <result column="productCouponModelId" property="productCouponModelId"/>
|
|
|
<result column="type" property="type"/>
|
|
|
<result column="otherType" property="otherType"/>
|
|
|
<result column="discount" property="discount"/>
|
|
@@ -38,6 +39,9 @@
|
|
|
<if test="userId != 0">
|
|
|
and userId = #{userId}
|
|
|
</if>
|
|
|
+ <if test="productCouponModelId != 0">
|
|
|
+ and productCouponModelId = #{productCouponModelId}
|
|
|
+ </if>
|
|
|
<if test="type != null">
|
|
|
and type = #{type}
|
|
|
</if>
|
|
@@ -62,6 +66,9 @@
|
|
|
<if test="userId != 0">
|
|
|
and userId = #{userId}
|
|
|
</if>
|
|
|
+ <if test="productCouponModelId != 0">
|
|
|
+ and productCouponModelId = #{productCouponModelId}
|
|
|
+ </if>
|
|
|
<if test="type != null">
|
|
|
and type = #{type}
|
|
|
</if>
|
|
@@ -86,6 +93,9 @@
|
|
|
<if test="p.userId != 0">
|
|
|
and userId = #{p.userId}
|
|
|
</if>
|
|
|
+ <if test="p.productCouponModelId != 0">
|
|
|
+ and productCouponModelId = #{p.productCouponModelId}
|
|
|
+ </if>
|
|
|
<if test="p.type != null">
|
|
|
and type = #{p.type}
|
|
|
</if>
|
|
@@ -103,13 +113,14 @@
|
|
|
</select>
|
|
|
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
- INSERT INTO workark_product_coupon (type, otherType, discount, organizationId, userId, createTime, lifespan, productLevelId, couponAmount, title, threshold, mostConstraint, description)
|
|
|
- VALUES (#{type}, #{otherType}, #{discount}, #{organizationId}, #{userId}, now(), #{lifespan}, #{productLevelId}, #{couponAmount}, #{title}, #{threshold}, #{mostConstraint}, #{description})
|
|
|
+ INSERT INTO workark_product_coupon (productCouponModelId, type, otherType, discount, organizationId, userId, createTime, lifespan, productLevelId, couponAmount, title, threshold, mostConstraint, description)
|
|
|
+ VALUES (#{productCouponModelId}, #{type}, #{otherType}, #{discount}, #{organizationId}, #{userId}, now(), #{lifespan}, #{productLevelId}, #{couponAmount}, #{title}, #{threshold}, #{mostConstraint}, #{description})
|
|
|
</insert>
|
|
|
|
|
|
<update id="update" parameterType="com.bosshand.virgo.api.workark.model.ProductCoupon">
|
|
|
UPDATE workark_product_coupon
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="productCouponModelId!=0">productCouponModelId=#{productCouponModelId},</if>
|
|
|
<if test="type!=null">type=#{type},</if>
|
|
|
<if test="otherType!=null">otherType=#{otherType},</if>
|
|
|
<if test="discount!=null">discount=#{discount},</if>
|