| | |
| | | <sql id="Base_Column_List"> |
| | | id, activityName, participateCount, startTime, endTime, couponId, userGrantCount, monthUseCount, useExplain, isDelete |
| | | </sql> |
| | | <select id="getList" resultType="java.util.Map"> |
| | | select a.id,a.insertTime,a.activityName,CONCAT(DATE_FORMAT(a.startTime, '%Y-%m-%d')," — ",DATE_FORMAT(a.endTime, '%Y-%m-%d')) as `time`, |
| | | a.qrCode, |
| | | a.participateCount,a.state,IFNULL(b.count, 0) AS `count` |
| | | from t_activity_generalization a |
| | | LEFT join (SELECT userId,couponActivityId, activityType,COUNT(*) AS `count` FROM t_user_coupon_record where activityType = 5 GROUP BY userId) b |
| | | ON a.id = b.couponActivityId |
| | | WHERE a.isDelete = 1 |
| | | <if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''"> |
| | | and (a.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | | <if test="activityName != null and activityName !=''"> |
| | | and a.activityName like CONCAT('%',#{activityName},'%') |
| | | </if> |
| | | <if test="state != null"> |
| | | and a.state=#{state} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |