| | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.ActivityVO"> |
| | | <id property="id" column="id"/> |
| | | <result column="activity_name" property="activityName" /> |
| | | <result column="activity_type" property="activityType"/> |
| | | <result column="report_start_time" property="reportStartTime" /> |
| | |
| | | <result column="limit_user_num" property="limitUserNum" /> |
| | | <result column="activity_location" property="activityLocation" /> |
| | | <result column="activity_content" property="activityContent" /> |
| | | <result column="publish" property="publish" /> |
| | | <result column="auditStatus" property="auditStatus"/> |
| | | <result column="member_id" property="memberId"/> |
| | | <!-- <collection property="auditRecordVOS" ofType="cn.lili.modules.lmk.domain.vo.ActivityAuditRecordVO"--> |
| | | <!-- select="selectAuditRecord"--> |
| | | <!-- column="id"--> |
| | | <!-- />--> |
| | | |
| | | |
| | | </resultMap> |
| | | |
| | | <resultMap id="MyActivityResultMap" type="cn.lili.modules.lmk.domain.vo.MyActivityVo"> |
| | |
| | | <result column="activity_report_id" property="activityReportId"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="auditRecordResult" type="cn.lili.modules.lmk.domain.vo.ActivityAuditRecordVO"> |
| | | <result column="activity_id" property="activityId"/> |
| | | <result column="remarks" property="remarks"/> |
| | | <result column="audit" property="audit"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectAuditRecord" resultMap="auditRecordResult"> |
| | | select LAAR.id, |
| | | LAAR.activity_id, |
| | | LAAR.remarks, |
| | | LAAR.audit |
| | | from lmk_activity_audit_record LAAR |
| | | WHERE LAAR.activity_id = #{id} |
| | | </select> |
| | | |
| | | |
| | | <select id="getMyActivityList" resultMap="MyActivityResultMap"> |
| | |
| | | AND LAR.user_id = #{userId} |
| | | AND LAR.cancel = #{query.cancel} |
| | | <if test="query.status == null or query.status == ''"> |
| | | AND LA.status != '已结束' |
| | | AND LA.status != 'end' |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | AND LA.status = #{query.status} |
| | |
| | | LA.cover_type, |
| | | LA.limit_user_num, |
| | | LA.activity_location, |
| | | LA.activity_content |
| | | LA.activity_content, |
| | | LA.publish |
| | | FROM |
| | | lmk_activity LA |
| | | WHERE |
| | |
| | | LA.cover_type, |
| | | LA.limit_user_num, |
| | | LA.activity_location, |
| | | LA.activity_content |
| | | 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.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="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 |
| | | 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 |
| | | FROM |
| | | 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> |
| | | |
| | | |
| | | |
| | | <resultMap id="memberMap" type="cn.lili.modules.member.entity.vo.MemberVO"> |
| | | <id property="id" column="id"/> |
| | | |