|
@@ -24,12 +24,17 @@
|
|
<result column="threshold" property="threshold"/>
|
|
<result column="threshold" property="threshold"/>
|
|
<result column="mostConstraint" property="mostConstraint"/>
|
|
<result column="mostConstraint" property="mostConstraint"/>
|
|
<result column="description" property="description"/>
|
|
<result column="description" property="description"/>
|
|
|
|
+ <result column="overlayUse" property="overlayUse"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<select id="get" resultMap="result">
|
|
<select id="get" resultMap="result">
|
|
select * from workark_product_coupon where id = #{id}
|
|
select * from workark_product_coupon where id = #{id}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="getUserId" resultMap="result">
|
|
|
|
+ select * from workark_product_coupon where id = #{id} and userId = #{userId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="getProductCouponModelId" resultMap="result">
|
|
<select id="getProductCouponModelId" resultMap="result">
|
|
select id, productCouponModelId from workark_product_coupon where userId = #{userId} and productCouponModelId != 0
|
|
select id, productCouponModelId from workark_product_coupon where userId = #{userId} and productCouponModelId != 0
|
|
</select>
|
|
</select>
|
|
@@ -117,8 +122,8 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
- 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 INTO workark_product_coupon (productCouponModelId, type, otherType, discount, organizationId, userId, createTime, lifespan, productLevelId, couponAmount, title, threshold, mostConstraint, description, overlayUse)
|
|
|
|
+ VALUES (#{productCouponModelId}, #{type}, #{otherType}, #{discount}, #{organizationId}, #{userId}, now(), #{lifespan}, #{productLevelId}, #{couponAmount}, #{title}, #{threshold}, #{mostConstraint}, #{description}, #{overlayUse})
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<update id="update" parameterType="com.bosshand.virgo.api.workark.model.ProductCoupon">
|
|
<update id="update" parameterType="com.bosshand.virgo.api.workark.model.ProductCoupon">
|
|
@@ -141,6 +146,7 @@
|
|
<if test="threshold!=null">threshold=#{threshold},</if>
|
|
<if test="threshold!=null">threshold=#{threshold},</if>
|
|
<if test="mostConstraint!=null">mostConstraint=#{mostConstraint},</if>
|
|
<if test="mostConstraint!=null">mostConstraint=#{mostConstraint},</if>
|
|
<if test="description!=null">description=#{description},</if>
|
|
<if test="description!=null">description=#{description},</if>
|
|
|
|
+ <if test="overlayUse!=null">overlayUse=#{overlayUse},</if>
|
|
</trim>
|
|
</trim>
|
|
WHERE id=#{id}
|
|
WHERE id=#{id}
|
|
</update>
|
|
</update>
|