From f40914a35678266624c6dbf382b31b2db9ac6720 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期六, 11 十月 2025 09:17:09 +0800
Subject: [PATCH] 定制商品模板
---
framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml | 148 ++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 139 insertions(+), 9 deletions(-)
diff --git a/framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml b/framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml
index 3083ba5..4f8091b 100644
--- a/framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/StoreCouponClaimRecordMapper.xml
@@ -31,20 +31,150 @@
WHERE
LSCCR.id = #{id} AND LSCCR.delete_flag = 0
</select>
+ <resultMap id="BaseResultMapByManager" type="cn.lili.modules.lmk.domain.vo.StoreCouponClaimRecordVO">
+ <!-- 浼氬憳浼樻儬鍒歌〃(li_member_coupon)瀛楁鏄犲皠 -->
+ <result column="member_id" property="memberId"/>
+ <result column="member_name" property="memberName"/>
+ <result column="price" property="price"/>
+ <result column="start_time" property="startTime"/>
+ <result column="end_time" property="endTime"/>
+ <result column="member_coupon_status" property="memberCouponStatus"/>
+ <result column="goods_use_limit_num" property="goodsUseLimitNum"/>
+ <result column="platform_flag" property="platformFlag"/>
+ <result column="get_type" property="getType"/>
+ <result column="discount" property="discount"/>
+ <result column="coupon_type" property="couponType"/>
+ <result column="coupon_id" property="couponId" />
+ <!-- 搴楅摵浼樻儬鍒搁鍙栬褰曡〃(lmk_store_coupon_claim_record)瀛楁鏄犲皠 -->
+ <result column="id" property="id"/>
+ <result column="store_name" property="storeName"/>
+ <result column="store_coupon_id" property="storeCouponId"/>
+ <result column="store_id" property="storeId"/>
+ <result column="user_id" property="userId"/>
+ <result column="coupon_name" property="couponName"/>
+ <result column="claimTime" property="claimTime"/>
+ <result column="order_status" property="orderStatus"/>
+ </resultMap>
- <select id="getPage" resultMap="BaseResultMap">
+ <select id="getPage" resultMap="BaseResultMapByManager">
SELECT
- LSCCR.store_name,
- LSCCR.coupon_id,
- LSCCR.coupon_name,
- LSCCR.store_id,
- LSCCR.user_id,
- LSCCR.id
+ lmc.member_id,
+ lmc.member_name,
+ lmc.price,
+ lmc.start_time,
+ lmc.end_time,
+ lmc.member_coupon_status,
+ lmc.goods_use_limit_num,
+ lmc.platform_flag,
+ lmc.get_type,
+ lmc.discount,
+ lmc.coupon_type,
+ lsccr.id,
+ lsccr.store_name,
+ lsccr.store_coupon_id,
+ lsccr.store_id,
+ lsccr.user_id,
+ lsccr.coupon_name,
+ lsccr.create_time AS claimTime,
+ lsccr.coupon_id,
+ lo.order_status
FROM
- lmk_store_coupon_claim_record LSCCR
+ lmk_store_coupon_claim_record lsccr
+ INNER JOIN
+ li_member_coupon lmc ON lmc.id = lsccr.member_coupon_id
+ LEFT JOIN li_order lo ON lo.use_platform_member_coupon_id = lmc.id AND lo.delete_flag = 0
WHERE
- LSCCR.delete_flag = 0
+ lmc.delete_flag = 0
+ AND lsccr.delete_flag = 0
+ AND lmc.member_id = lsccr.user_id
+
+ <!-- 1. 浼氬憳鍚嶇О妯$硦鏌ヨ锛堝叧鑱攍i_member_coupon琛級 -->
+ <if test="query.memberName != null and query.memberName != ''">
+ AND lmc.member_name LIKE CONCAT('%', #{query.memberName}, '%')
+ </if>
+ <!-- 2. 浼樻儬鍒稿悕绉版ā绯婃煡璇紙鍏宠仈lmk_store_coupon_claim_record琛級 -->
+ <if test="query.couponName != null and query.couponName != ''">
+ AND lsccr.coupon_name LIKE CONCAT('%', #{query.couponName}, '%')
+ </if>
+ <!-- 3. 浼樻儬鍒歌幏鍙栨柟寮忥紙绮剧‘鍖归厤锛屽叧鑱攍i_member_coupon琛級 -->
+ <if test="query.getType != null and query.getType != ''">
+ AND lmc.get_type = #{query.getType}
+ </if>
+ <!-- 4. 浼氬憳浼樻儬鍒哥姸鎬侊紙绮剧‘鍖归厤锛屽叧鑱攍i_member_coupon琛級 -->
+ <if test="query.memberCouponStatus != null and query.memberCouponStatus != ''">
+ AND lmc.member_coupon_status = #{query.memberCouponStatus}
+ </if>
+ <!-- 5. 鏃堕棿鑼冨洿绛涢�夛細鐢˙ETWEEN鍖归厤start_time鍜宔nd_time锛堥渶鍚屾椂浼犲叆寮�濮嬪拰缁撴潫鏃堕棿锛� -->
+ <if test="query.startTime != null and query.endTime != null">
+ AND lsccr.create_time BETWEEN FROM_UNIXTIME(#{query.startTime}/1000)
+ AND FROM_UNIXTIME(#{query.endTime}/1000)
+ </if>
+ <!-- 6. 鎺掑簭閫昏緫锛堟牴鎹墠绔紶鍏ョ殑sort瀛楁鍜宱rder鎺掑簭鏂瑰悜锛� -->
+ <if test="query.sort != null and query.sort != '' and query.order != null and query.order != ''">
+ ORDER BY lsccr.create_time DESC
+ </if>
+
+ </select>
+
+ <select id="getExportData" resultMap="BaseResultMapByManager">
+ SELECT
+ lmc.member_id,
+ lmc.member_name,
+ lmc.price,
+ lmc.start_time,
+ lmc.end_time,
+ lmc.member_coupon_status,
+ lmc.goods_use_limit_num,
+ lmc.platform_flag,
+ lmc.get_type,
+ lmc.discount,
+ lmc.coupon_type,
+ lsccr.id,
+ lsccr.store_name,
+ lsccr.store_coupon_id,
+ lsccr.store_id,
+ lsccr.user_id,
+ lsccr.coupon_name,
+ lsccr.create_time AS claimTime,
+ lsccr.coupon_id,
+ lo.order_status
+ FROM
+ lmk_store_coupon_claim_record lsccr
+ INNER JOIN
+ li_member_coupon lmc ON lmc.id = lsccr.member_coupon_id
+ LEFT JOIN li_order lo ON lo.use_platform_member_coupon_id = lmc.id AND lo.delete_flag = 0
+
+ WHERE
+ lmc.delete_flag = 0
+ AND lsccr.delete_flag = 0
+ AND lmc.member_id = lsccr.user_id
+
+ <!-- 1. 浼氬憳鍚嶇О妯$硦鏌ヨ锛堝叧鑱攍i_member_coupon琛級 -->
+ <if test="query.memberName != null and query.memberName != ''">
+ AND lmc.member_name LIKE CONCAT('%', #{query.memberName}, '%')
+ </if>
+ <!-- 2. 浼樻儬鍒稿悕绉版ā绯婃煡璇紙鍏宠仈lmk_store_coupon_claim_record琛級 -->
+ <if test="query.couponName != null and query.couponName != ''">
+ AND lsccr.coupon_name LIKE CONCAT('%', #{query.couponName}, '%')
+ </if>
+ <!-- 3. 浼樻儬鍒歌幏鍙栨柟寮忥紙绮剧‘鍖归厤锛屽叧鑱攍i_member_coupon琛級 -->
+ <if test="query.getType != null and query.getType != ''">
+ AND lmc.get_type = #{query.getType}
+ </if>
+ <!-- 4. 浼氬憳浼樻儬鍒哥姸鎬侊紙绮剧‘鍖归厤锛屽叧鑱攍i_member_coupon琛級 -->
+ <if test="query.memberCouponStatus != null and query.memberCouponStatus != ''">
+ AND lmc.member_coupon_status = #{query.memberCouponStatus}
+ </if>
+ <!-- 5. 鏃堕棿鑼冨洿绛涢�夛細鐢˙ETWEEN鍖归厤start_time鍜宔nd_time锛堥渶鍚屾椂浼犲叆寮�濮嬪拰缁撴潫鏃堕棿锛� -->
+ <if test="query.startTime != null and query.endTime != null">
+ AND lsccr.create_time BETWEEN FROM_UNIXTIME(#{query.startTime}/1000)
+ AND FROM_UNIXTIME(#{query.endTime}/1000)
+ </if>
+ <!-- 6. 鎺掑簭閫昏緫锛堟牴鎹墠绔紶鍏ョ殑sort瀛楁鍜宱rder鎺掑簭鏂瑰悜锛� -->
+ <if test="query.sort != null and query.sort != '' and query.order != null and query.order != ''">
+ ORDER BY lsccr.create_time DESC
+ </if>
</select>
</mapper>
--
Gitblit v1.8.0