| | |
| | | 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 couponActivityId) b |
| | | LEFT join (SELECT |
| | | couponActivityId, |
| | | activityType, |
| | | COUNT(DISTINCT userId) AS count |
| | | FROM |
| | | t_user_coupon_record |
| | | WHERE |
| | | activityType = 5 |
| | | GROUP BY |
| | | couponActivityId ) b |
| | | ON a.id = b.couponActivityId |
| | | WHERE a.isDelete = 1 |
| | | <if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''"> |
| | |
| | | <if test="state != null"> |
| | | and a.state=#{state} |
| | | </if> |
| | | order by a.insertTime desc |
| | | </select> |
| | | |
| | | </mapper> |