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

修改优惠券查看接口

上级 4bac5638
......@@ -187,8 +187,10 @@
</delete>
<!--查询用户所有有效的优惠券-->
<select id="queryUserAvailableCoupon" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity">
select DISTINCT t2.* from tb_cf_coupon t2,tb_cf_issue_coupon t3
where t3.user_id=#{userId} and t3.coupon_id=t2.coupon_id and t2.status=1 and t3.enable_flag=1
select DISTINCT t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2,tb_cf_issue_coupon t3
where ((t3.user_id=#{userId} and t3.coupon_id=t2.coupon_id and t2.status=1 and t3.enable_flag=1)
or (t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t2.status=1 and t1.enable_flag=1))
and <![CDATA[ t2.valid_start_time<=#{nowTime}]]> and <![CDATA[t2.valid_end_time>=#{nowTime}]]>
</select>
<!--更改优惠券统计-->
......@@ -198,14 +200,15 @@
<!--获取已使用的优惠券-->
<select id="queryUserUsedCoupon" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity">
select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3 ,tb_cf_user_info t4
where (t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t2.coupon_id=t3.coupon_id)
and t1.enable_flag=0 and t3.enable_flag=0
select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3
where ((t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t1.enable_flag=0)
or (t3.user_id=#{userId} and t3.coupon_id=t2.coupon_id and t3.enable_flag=0))
</select>
<!--获取已过期的优惠券-->
<!--获取已过期的优惠券-->
<select id="queryUserExpiredoupon" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity">
select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3 where t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t1.coupon_id=t2.coupon_id and t2.coupon_id=t3.coupon_id
and <![CDATA[ t2.valid_end_time<#{nowTime}]]> and t1.enable_flag=1 and t3.enable_flag=1
select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3
where ((t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and <![CDATA[ t2.valid_end_time<#{nowTime}]]> and t1.enable_flag=1)
or (t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and <![CDATA[ t2.valid_end_time<#{nowTime}]]> and t1.enable_flag=1))
</select>
<!--根据优惠券种类获取发放中的优惠券-->
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论