|
@@ -6,6 +6,7 @@
|
|
|
|
|
|
<resultMap type="com.bosshand.virgo.api.workark.model.ProductCouponModel" id="result">
|
|
|
<id column="id" property="id"/>
|
|
|
+ <result column="organizationId" property="organizationId"/>
|
|
|
<result column="type" property="type"/>
|
|
|
<result column="otherType" property="otherType"/>
|
|
|
<result column="discount" property="discount"/>
|
|
@@ -38,6 +39,9 @@
|
|
|
<select id="getList" resultMap="result">
|
|
|
select * from workark_product_coupon_model
|
|
|
<where>
|
|
|
+ <if test="organizationId != 0">
|
|
|
+ and organizationId = #{organizationId}
|
|
|
+ </if>
|
|
|
<if test="type != null">
|
|
|
and type = #{type}
|
|
|
</if>
|
|
@@ -53,6 +57,9 @@
|
|
|
<select id="getTotalCount" parameterType="com.bosshand.virgo.api.workark.model.ProductCouponModel" resultType="Integer">
|
|
|
SELECT count(*) FROM workark_product_coupon_model
|
|
|
<where>
|
|
|
+ <if test="organizationId != 0">
|
|
|
+ and organizationId = #{organizationId}
|
|
|
+ </if>
|
|
|
<if test="type != null">
|
|
|
and type = #{type}
|
|
|
</if>
|
|
@@ -68,6 +75,9 @@
|
|
|
<select id="getLimit" resultMap="result">
|
|
|
select * from workark_product_coupon_model
|
|
|
<where>
|
|
|
+ <if test="p.organizationId != 0">
|
|
|
+ and organizationId = #{p.organizationId}
|
|
|
+ </if>
|
|
|
<if test="p.type != null">
|
|
|
and type = #{p.type}
|
|
|
</if>
|
|
@@ -82,13 +92,14 @@
|
|
|
</select>
|
|
|
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
- INSERT INTO workark_product_coupon_model (type, otherType, discount, createTime, lifespan, productLevelId, couponAmount, title, threshold, mostConstraint, description)
|
|
|
- VALUES (#{type}, #{otherType}, #{discount}, now(), #{lifespan}, #{productLevelId}, #{couponAmount}, #{title}, #{threshold}, #{mostConstraint}, #{description})
|
|
|
+ INSERT INTO workark_product_coupon_model (organizationId, type, otherType, discount, createTime, lifespan, productLevelId, couponAmount, title, threshold, mostConstraint, description)
|
|
|
+ VALUES (#{organizationId}, #{type}, #{otherType}, #{discount}, now(), #{lifespan}, #{productLevelId}, #{couponAmount}, #{title}, #{threshold}, #{mostConstraint}, #{description})
|
|
|
</insert>
|
|
|
|
|
|
<update id="update" parameterType="com.bosshand.virgo.api.workark.model.ProductCouponModel">
|
|
|
UPDATE workark_product_coupon_model
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
|
<if test="type!=null">type=#{type},</if>
|
|
|
<if test="otherType!=null">otherType=#{otherType},</if>
|
|
|
<if test="discount!=null">discount=#{discount},</if>
|