|
@@ -7,6 +7,7 @@
|
|
<resultMap type="com.bosshand.virgo.api.workark.model.ProductCoupon" id="result">
|
|
<resultMap type="com.bosshand.virgo.api.workark.model.ProductCoupon" id="result">
|
|
<id column="id" property="id"/>
|
|
<id column="id" property="id"/>
|
|
<result column="type" property="type"/>
|
|
<result column="type" property="type"/>
|
|
|
|
+ <result column="otherType" property="otherType"/>
|
|
<result column="discount" property="discount"/>
|
|
<result column="discount" property="discount"/>
|
|
<result column="organizationId" property="organizationId"/>
|
|
<result column="organizationId" property="organizationId"/>
|
|
<result column="userId" property="userId"/>
|
|
<result column="userId" property="userId"/>
|
|
@@ -20,6 +21,7 @@
|
|
<result column="couponAmount" property="couponAmount"/>
|
|
<result column="couponAmount" property="couponAmount"/>
|
|
<result column="title" property="title"/>
|
|
<result column="title" property="title"/>
|
|
<result column="threshold" property="threshold"/>
|
|
<result column="threshold" property="threshold"/>
|
|
|
|
+ <result column="mostConstraint" property="mostConstraint"/>
|
|
<result column="description" property="description"/>
|
|
<result column="description" property="description"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
@@ -39,6 +41,9 @@
|
|
<if test="type != null">
|
|
<if test="type != null">
|
|
and type = #{type}
|
|
and type = #{type}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="otherType != null">
|
|
|
|
+ and otherType = #{otherType}
|
|
|
|
+ </if>
|
|
<if test="state != null">
|
|
<if test="state != null">
|
|
and state = #{state}
|
|
and state = #{state}
|
|
</if>
|
|
</if>
|
|
@@ -60,6 +65,9 @@
|
|
<if test="type != null">
|
|
<if test="type != null">
|
|
and type = #{type}
|
|
and type = #{type}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="otherType != null">
|
|
|
|
+ and otherType = #{otherType}
|
|
|
|
+ </if>
|
|
<if test="state != null">
|
|
<if test="state != null">
|
|
and state = #{state}
|
|
and state = #{state}
|
|
</if>
|
|
</if>
|
|
@@ -81,6 +89,9 @@
|
|
<if test="p.type != null">
|
|
<if test="p.type != null">
|
|
and type = #{p.type}
|
|
and type = #{p.type}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="p.otherType != null">
|
|
|
|
+ and otherType = #{p.otherType}
|
|
|
|
+ </if>
|
|
<if test="p.state != null">
|
|
<if test="p.state != null">
|
|
and state = #{p.state}
|
|
and state = #{p.state}
|
|
</if>
|
|
</if>
|
|
@@ -92,14 +103,15 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
- INSERT INTO workark_product_coupon (type, discount, organizationId, userId, createTime, lifespan, productLevelId, couponAmount, title, threshold, description)
|
|
|
|
- VALUES (#{type}, #{discount}, #{organizationId}, #{userId}, now(), #{lifespan}, #{productLevelId}, #{couponAmount}, #{title}, #{threshold}, #{description})
|
|
|
|
|
|
+ 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>
|
|
</insert>
|
|
|
|
|
|
<update id="update" parameterType="com.bosshand.virgo.api.workark.model.ProductCoupon">
|
|
<update id="update" parameterType="com.bosshand.virgo.api.workark.model.ProductCoupon">
|
|
UPDATE workark_product_coupon
|
|
UPDATE workark_product_coupon
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<if test="type!=null">type=#{type},</if>
|
|
<if test="type!=null">type=#{type},</if>
|
|
|
|
+ <if test="otherType!=null">otherType=#{otherType},</if>
|
|
<if test="discount!=null">discount=#{discount},</if>
|
|
<if test="discount!=null">discount=#{discount},</if>
|
|
<if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
<if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
<if test="userId!=0">userId=#{userId},</if>
|
|
<if test="userId!=0">userId=#{userId},</if>
|
|
@@ -112,6 +124,7 @@
|
|
<if test="couponAmount!=null">couponAmount=#{couponAmount},</if>
|
|
<if test="couponAmount!=null">couponAmount=#{couponAmount},</if>
|
|
<if test="title!=null">title=#{title},</if>
|
|
<if test="title!=null">title=#{title},</if>
|
|
<if test="threshold!=null">threshold=#{threshold},</if>
|
|
<if test="threshold!=null">threshold=#{threshold},</if>
|
|
|
|
+ <if test="mostConstraint!=null">mostConstraint=#{mostConstraint},</if>
|
|
<if test="description!=null">description=#{description},</if>
|
|
<if test="description!=null">description=#{description},</if>
|
|
</trim>
|
|
</trim>
|
|
WHERE id=#{id}
|
|
WHERE id=#{id}
|