提交 ea177a69 authored 作者: luojie's avatar luojie

修改优惠券分类SQL

上级 a622c888
...@@ -124,6 +124,23 @@ public class TbCfCouponEntity implements Serializable { ...@@ -124,6 +124,23 @@ public class TbCfCouponEntity implements Serializable {
@ApiModelProperty("修改时间") @ApiModelProperty("修改时间")
private Date updateTime; private Date updateTime;
/**
* 设置是否是注册就是的优惠券,(0)默认状态,(1)是用户注册就送这张优惠券
*/
private Integer couponVaild;
/**
* 设置:(0)默认状态,(1)是用户注册就送这张优惠券
*/
public void setCouponVaild(Integer couponVaild){
this.couponVaild = couponVaild;
}
/**
* 获取:(0)默认状态,(1)是用户注册就送这张优惠券
*/
public Integer getCouponVaild(){
return couponVaild;
}
/** /**
* 设置:优惠券id * 设置:优惠券id
*/ */
......
...@@ -50,6 +50,8 @@ public class TbCfIssueCouponEntity implements Serializable { ...@@ -50,6 +50,8 @@ public class TbCfIssueCouponEntity implements Serializable {
*/ */
private String issueId; private String issueId;
/** /**
* 设置:发放表id * 设置:发放表id
* @return * @return
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateUserId" column="update_user_id"/> <result property="updateUserId" column="update_user_id"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="couponVaild" column="coupon_vaild"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"> <select id="queryObject" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity">
...@@ -48,7 +49,8 @@ ...@@ -48,7 +49,8 @@
`create_user_id`, `create_user_id`,
`create_time`, `create_time`,
`update_user_id`, `update_user_id`,
`update_time` `update_time`,
`coupon_vaild`
from tb_cf_coupon a left join tb_cf_coupon_category b on a.coupon_category_id = b.coupon_category_id from tb_cf_coupon a left join tb_cf_coupon_category b on a.coupon_category_id = b.coupon_category_id
where coupon_id = #{id} where coupon_id = #{id}
</select> </select>
...@@ -75,7 +77,8 @@ ...@@ -75,7 +77,8 @@
`create_user_id`, `create_user_id`,
`create_time`, `create_time`,
`update_user_id`, `update_user_id`,
`update_time` `update_time`,
`coupon_vaild`
from tb_cf_coupon a left join tb_cf_coupon_category b on a.coupon_category_id = b.coupon_category_id from tb_cf_coupon a left join tb_cf_coupon_category b on a.coupon_category_id = b.coupon_category_id
WHERE 1=1 WHERE 1=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
...@@ -123,7 +126,8 @@ ...@@ -123,7 +126,8 @@
`create_user_id`, `create_user_id`,
`create_time`, `create_time`,
`update_user_id`, `update_user_id`,
`update_time`) `update_time`,
`coupon_vaild`)
values( values(
#{couponId}, #{couponId},
#{couponCategoryId}, #{couponCategoryId},
...@@ -144,7 +148,8 @@ ...@@ -144,7 +148,8 @@
#{createUserId}, #{createUserId},
#{createTime}, #{createTime},
#{updateUserId}, #{updateUserId},
#{updateTime}) #{updateTime}),
#{coupon_vaild})
</insert> </insert>
<update id="update" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"> <update id="update" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity">
...@@ -169,6 +174,7 @@ ...@@ -169,6 +174,7 @@
<if test="createTime != null">`create_time` = #{createTime}, </if> <if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="updateUserId != null">`update_user_id` = #{updateUserId}, </if> <if test="updateUserId != null">`update_user_id` = #{updateUserId}, </if>
<if test="updateTime != null">`update_time` = #{updateTime}</if> <if test="updateTime != null">`update_time` = #{updateTime}</if>
<if test="couponVaild != null">`update_time` = #{couponVaild}</if>
</set> </set>
where coupon_id = #{couponId} where coupon_id = #{couponId}
</update> </update>
...@@ -208,13 +214,14 @@ ...@@ -208,13 +214,14 @@
t2.create_user_id, t2.create_user_id,
t2.create_time, t2.create_time,
t2.update_user_id, t2.update_user_id,
t2.update_time t2.update_time,
t2.coupon_vaild
from tb_cf_coupon t2 left join tb_cf_coupon_category t4 ON t2.coupon_category_id= t4.coupon_category_id from tb_cf_coupon t2 left join tb_cf_coupon_category t4 ON t2.coupon_category_id= t4.coupon_category_id
left join tb_cf_take_coupon t1 on t1.coupon_id=t2.coupon_id left join tb_cf_take_coupon t1 on t1.coupon_id=t2.coupon_id
left join tb_cf_issue_coupon t3 on t3.coupon_id=t2.coupon_id left join tb_cf_issue_coupon t3 on t3.coupon_id=t2.coupon_id
where ((t1.user_id=#{userId} and t1.enable_flag=1 ) where ((t1.user_id=#{userId} and t1.enable_flag=1 )
or (t3.user_id=#{userId} and t3.enable_flag=1)) or (t3.user_id=#{userId} and t3.enable_flag=1))
and t2.status=1 and <![CDATA[ t2.valid_start_time<=#{nowTime}]]> and <![CDATA[t2.valid_end_time>=#{nowTime}]]> and t2.status=1 and (<![CDATA[ t2.valid_start_time<=#{nowTime}]]> and <![CDATA[t2.valid_end_time>=#{nowTime}]]>)
</select> </select>
<!--更改优惠券统计--> <!--更改优惠券统计-->
...@@ -245,7 +252,8 @@ ...@@ -245,7 +252,8 @@
t2.create_user_id, t2.create_user_id,
t2.create_time, t2.create_time,
t2.update_user_id, t2.update_user_id,
t2.update_time t2.update_time,
t2.coupon_vaild
from tb_cf_coupon t2 left join tb_cf_coupon_category t4 ON t2.coupon_category_id= t4.coupon_category_id from tb_cf_coupon t2 left join tb_cf_coupon_category t4 ON t2.coupon_category_id= t4.coupon_category_id
left join tb_cf_take_coupon t1 on t1.coupon_id=t2.coupon_id left join tb_cf_take_coupon t1 on t1.coupon_id=t2.coupon_id
left join tb_cf_issue_coupon t3 on t3.coupon_id=t2.coupon_id left join tb_cf_issue_coupon t3 on t3.coupon_id=t2.coupon_id
...@@ -275,12 +283,13 @@ ...@@ -275,12 +283,13 @@
t2.create_user_id, t2.create_user_id,
t2.create_time, t2.create_time,
t2.update_user_id, t2.update_user_id,
t2.update_time t2.update_time,
t2.coupon_vaild
from tb_cf_coupon t2 left join tb_cf_coupon_category t4 ON t2.coupon_category_id= t4.coupon_category_id from tb_cf_coupon t2 left join tb_cf_coupon_category t4 ON t2.coupon_category_id= t4.coupon_category_id
left join tb_cf_take_coupon t1 on t1.coupon_id=t2.coupon_id left join tb_cf_take_coupon t1 on t1.coupon_id=t2.coupon_id
left join tb_cf_issue_coupon t3 on t3.coupon_id=t2.coupon_id left join tb_cf_issue_coupon t3 on t3.coupon_id=t2.coupon_id
where ((t1.user_id=#{userId} and <![CDATA[ t2.valid_end_time<#{nowTime}]]> and t1.enable_flag=1) where ((t1.user_id=#{userId} and <![CDATA[ t2.valid_end_time<#{nowTime}]]> and t1.enable_flag=1)
or (t1.user_id=#{userId} and <![CDATA[ t2.valid_end_time<#{nowTime}]]> and t1.enable_flag=1)) or (t3.user_id=#{userId} and <![CDATA[ t2.valid_end_time<#{nowTime}]]> and t3.enable_flag=1))
</select> </select>
<!--根据优惠券种类获取发放中的优惠券--> <!--根据优惠券种类获取发放中的优惠券-->
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论