From bd9e6d9b7f673c5f55ef40b42b37ecd78ab36893 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期二, 19 八月 2025 15:56:33 +0800 Subject: [PATCH] 奖品 --- framework/src/main/resources/mapper/lmk/ActivityMapper.xml | 73 ++++++++++++++++++++++++++++++++++-- 1 files changed, 68 insertions(+), 5 deletions(-) diff --git a/framework/src/main/resources/mapper/lmk/ActivityMapper.xml b/framework/src/main/resources/mapper/lmk/ActivityMapper.xml index 9382128..cd31bbf 100644 --- a/framework/src/main/resources/mapper/lmk/ActivityMapper.xml +++ b/framework/src/main/resources/mapper/lmk/ActivityMapper.xml @@ -128,10 +128,7 @@ LA.activity_location, LA.activity_content, LA.publish, - CASE WHEN EXISTS ( - SELECT 1 FROM lmk_activity_audit_record - WHERE activity_id = LA.id AND delete_flag = 0 AND audit != 0 - ) THEN 1 ELSE 0 END AS auditStatus + LAAR.audit as auditStatus FROM lmk_activity LA LEFT JOIN @@ -165,8 +162,67 @@ <if test="query.audit == true" >AND LAAR.audit != 0</if> <if test="query.audit == false" >AND LAAR.audit = 0</if> <if test="query.memberId !=null and query.memberId !=''">And LA.member_id = #{query.memberId}</if> + <if test="query.storeId !=null and query.storeId !=''">And LA.store_id = #{query.storeId}</if> Order by LA.create_time DESC </select> + + <select id="storeGetPage" resultMap="BaseResultMap"> + SELECT + LA.id, + LA.activity_name, + LA.activity_type, + LA.report_start_time, + LA.report_end_time, + LA.start_time, + LA.end_time, + LA.status, + LA.recommend, + LA.cover, + LA.cover_type, + LA.limit_user_num, + LA.activity_location, + LA.activity_content, + LA.publish, + LAAR.audit as auditStatus + FROM + lmk_activity LA + LEFT JOIN + ( + SELECT + activity_id, + audit, + create_time + FROM ( + SELECT + activity_id, + audit, + create_time, + ROW_NUMBER() OVER (PARTITION BY activity_id ORDER BY create_time DESC) AS rn + FROM + lmk_activity_audit_record + WHERE + delete_flag = 0 + ) t + WHERE + rn = 1 + ) LAAR ON LA.id = LAAR.activity_id + WHERE + LA.delete_flag = 0 + <if test="query.activityName != null and query.activityName != ''">AND LA.activity_name LIKE CONCAT('%', #{query.activityName}, '%')</if> + <if test="query.activityType != null and query.activityType != ''">AND LA.activity_type LIKE CONCAT('%', #{query.activityType}, '%')</if> + <if test="query.recommend != null and query.recommend != ''">AND LA.recommend = #{recommend}</if> + <if test="query.reportStartTime != null">AND LA.report_start_time >= #{query.reportStartTime}</if> + <if test="query.reportEndTime != null">AND LA.report_end_time <= #{query.reportEndTime}</if> + <if test="query.memberId != null and query.memberId !=''">AND LA.member_id <= #{query.memberId}</if> + <if test="query.audit == true" >AND LAAR.audit != 0</if> + <if test="query.audit == false" >AND LAAR.audit = 0</if> + <if test="query.memberId !=null and query.memberId !=''">And LA.member_id = #{query.memberId}</if> + <if test="query.storeId !=null and query.storeId !=''">And LA.store_id = #{query.storeId}</if> + Order by LA.create_time DESC + </select> + + + <select id="getCanReportPage" resultMap="BaseResultMap"> SELECT @@ -185,10 +241,17 @@ LA.activity_location, LA.activity_content FROM - lmk_activity LA inner join lmk_activity_audit_record LAAR ON LA.id = LAAR.activity_id and LAAR.delete_flag = 0 and LAAR.audit = 1 + lmk_activity LA WHERE LA.delete_flag = 0 AND LA.publish = 1 + AND EXISTS ( + SELECT 1 + FROM lmk_activity_audit_record LAAR + WHERE LA.id = LAAR.activity_id + AND LAAR.delete_flag = 0 + AND LAAR.audit = 1 + ) </select> -- Gitblit v1.8.0