From d082123b5e6cfe476fcf881c3fba782551d684fe Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期一, 22 五月 2023 15:03:09 +0800
Subject: [PATCH] 首页地图替换图标
---
user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/dao/mapping/UserToCouponMapper.xml | 44 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 43 insertions(+), 1 deletions(-)
diff --git a/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/dao/mapping/UserToCouponMapper.xml b/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/dao/mapping/UserToCouponMapper.xml
index d755a61..f11bea7 100644
--- a/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/dao/mapping/UserToCouponMapper.xml
+++ b/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/dao/mapping/UserToCouponMapper.xml
@@ -18,7 +18,21 @@
<select id="queryCoupon" resultType="com.supersavedriving.user.modular.system.model.Coupon">
select
- a.*
+ b.id,
+ a.agent_id as agentId,
+ a.branch_office_id as branchOfficeId,
+ a.create_time as createTime,
+ a.coupon_name as couponName,
+ a.coupon_type as couponType,
+ a.coupon_code as couponCode,
+ a.coupon_service_type as couponServiceType,
+ a.coupon_conditional_amount as couponConditionalAmount,
+ a.coupon_preferential_amount as couponPreferentialAmount,
+ a.coupon_validity as couponValidity,
+ a.coupon_send_quantity as couponSendQuantity,
+ a.coupon_state as couponState,
+ a.coupon_count as couponCount,
+ a.remaining_quantity as remainingQuantity
from t_coupon a
left join t_user_to_coupon b on (a.id = b.couponId)
where b.status = 1 and b.expireTime > now() and b.validCount > 0
@@ -40,4 +54,32 @@
where b.userId = #{uid} and b.validCount > 0 and b.expireTime > now() and
a.coupon_conditional_amount <= #{price} and a.coupon_preferential_amount < #{price} order by b.createTime
</select>
+
+
+ <select id="queryMyCoupons" resultType="com.supersavedriving.user.modular.system.warpper.CouponsWarpper">
+ select
+ a.id,
+ b.coupon_name as `name`,
+ b.coupon_conditional_amount as preferentialTerms,
+ b.coupon_preferential_amount as discountAmount,
+ UNIX_TIMESTAMP(a.expireTime) * 1000 as endTime
+ from t_user_to_coupon a
+ left join t_coupon b on (a.couponId = b.id)
+ where a.`status` = 1 and a.userId = #{uid}
+ <if test="null != state and 1 == state">
+ and a.couponTotal = a.validCount and now() < a.expireTime
+ </if>
+ <if test="null != state and 2 == state">
+ and a.couponTotal != a.validCount and now() < a.expireTime
+ </if>
+ <if test="null != state and 3 == state">
+ and now() >= a.expireTime
+ </if>
+ order by a.createTime desc limit #{pageNum}, #{pageSize}
+ </select>
+
+
+ <select id="queryUsedCouponNum" resultType="int">
+ select sum(couponTotal - validCount) from t_user_to_coupon where `status` = 1 and userId = #{uid}
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.7.1