| | |
| | | |
| | | |
| | | <select id="queryUserActivityList" resultType="map"> |
| | | select * from ( |
| | | select |
| | | a.id as id, |
| | | a.insertTime as insertTime, |
| | |
| | | a.startTime as startTime, |
| | | a.endTime as endTime, |
| | | a.remark as remark, |
| | | IF(a.`status` != 3, a.`status`, IF(NOW() < a.startTime, 5, if(now() >= a.startTime and now() < a.endTime, 6, 7))) as `status`, |
| | | IF(a.`status` != 3, a.`status`, IF(NOW() < a.startTime, 5, if(now() >= a.startTime and now() < a.endTime, |
| | | 6, 7))) as `status`, |
| | | ( |
| | | (select count(aa.id) from t_user_red_packet_record aa left join t_user_activity_redenvelope bb on (aa.redPacketActivityId = bb.id) where aa.state = 2 and bb.userActivityId = a.id) + |
| | | (select count(aa.id) from t_user_coupon_record aa left join t_user_activity_registered bb on (aa.couponActivityId = bb.id and aa.activityType = 2) where aa.state = 2 and bb.userActivityId = a.id) + |
| | | (select count(aa.id) from t_user_coupon_record aa left join t_user_activity_invite bb on (aa.couponActivityId = 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(aa.id) from t_user_red_packet_record aa left join t_user_activity_redenvelope bb on |
| | | (aa.redPacketActivityId = bb.id) where aa.state = 2 and bb.userActivityId = a.id) + |
| | | (select count(aa.id) from t_user_coupon_record aa left join t_user_activity_registered bb on |
| | | (aa.couponActivityId = bb.id and aa.activityType = 2) where aa.state = 2 and bb.userActivityId = a.id) + |
| | | (select count(aa.id) from t_user_coupon_record aa left join t_user_activity_invite bb on (aa.couponActivityId = |
| | | 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(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) |
| | |
| | | <if test="null != name and '' != name"> |
| | | and a.`name` like CONCAT('%', #{name}, '%') |
| | | </if> |
| | | <if test="null != status"> |
| | | and a.`status` = #{status} |
| | | </if> |
| | | |
| | | order by a.insertTime desc |
| | | |
| | | ) b |
| | | <where> |
| | | <if test="null != status"> |
| | | and b.`status` = #{status} |
| | | </if> |
| | | </where> |
| | | <if test="null != offset and null != limit"> |
| | | limit #{offset}, #{limit} |
| | | </if> |
| | |
| | | public Map<String, Object> queryUserActivityList(Integer uid, Date start, Date end, String name, Integer status, Integer offset, Integer limit) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Integer objectId = userService.selectById(uid).getObjectId(); |
| | | boolean a = false; |
| | | if (status!=null&&status==5){ |
| | | status = null; |
| | | a = true; |
| | | } |
| | | List<Map<String, Object>> list = userActivityMapper.queryUserActivityList(objectId, start, end, name, status, offset, limit); |
| | | int i = userActivityMapper.queryUserActivityListCount(objectId, start, end, name, status); |
| | | if (a){ |
| | | List<Map<String, Object>> list1 = new ArrayList<>(); |
| | | for (Map<String, Object> stringObjectMap : list) { |
| | | long statys = (long) stringObjectMap.get("status"); |
| | | System.out.println(statys); |
| | | if (statys==6){ |
| | | list1.add(stringObjectMap); |
| | | } |
| | | } |
| | | map.put("rows", list1); |
| | | map.put("total", list1.size()); |
| | | return map; |
| | | } |
| | | map.put("rows", list); |
| | | map.put("total", i); |
| | | return map; |
| | |
| | | <option value="1">待审核</option> |
| | | <option value="2">已驳回</option> |
| | | <option value="4">已暂停</option> |
| | | <option value="3">未开始</option> |
| | | <option value="5">进行中</option> |
| | | <option value="6">已结束</option> |
| | | <option value="5">未开始</option> |
| | | <option value="6">进行中</option> |
| | | <option value="7">已结束</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |