| | |
| | | a.startTime as startTime, |
| | | a.endTime as endTime, |
| | | a.remark as remark, |
| | | b.name as companyName, |
| | | IF(a.`status` != 3, a.`status`, IF(NOW() < a.startTime, 5, if(now() >= a.startTime and now() < a.endTime, |
| | | 6, 7))) as `status`, |
| | | ( |
| | |
| | | bb.id and aa.activityType = 3) where aa.state = 2 and bb.userActivityId = a.id) + |
| | | (select count(aa.id) from t_user_coupon_record aa left join t_user_activity_balance bb on (aa.couponActivityId = |
| | | bb.id and aa.activityType = 4) where aa.state = 2 and bb.userActivityId = a.id) + |
| | | (select count(id) from t_order_private_car where state in (7,8,9) and activityId = a.id) + |
| | | (select count(aa.id) from t_order_private_car aa left join t_user_activity_discount1 bb on(aa.activityId = bb.id) where aa.state in (7,8,9) and bb.userActivityId = a.id ) + |
| | | (select count(aa.id) from t_order_logistics aa left join t_user_activity_discount1 bb on(aa.activityId = bb.id) where aa.state in (7,8,9)and bb.userActivityId = a.id ) + |
| | | (select count(id) from t_order_taxi where state in (7,8,9) and activityId = a.id) + |
| | | (select count(id) from t_order_cross_city where state in (6,8,9) and activityId = a.id) |
| | | ) as number |
| | | from t_user_activity a |
| | | where a.companyId = #{companyId} |
| | | left join t_company b on (a.companyId = b.id) |
| | | where 1 = 1 |
| | | <if test="null != companyId"> |
| | | and a.companyId = #{companyId} |
| | | </if> |
| | | <if test="null != start and null != end"> |
| | | and a.insertTime between #{start} and #{end} |
| | | </if> |