Commit e471320bc696b80c1e3d5f8389486a7fe917af42

Authored by litao@lymsh.com
1 parent 4813485e0b

改bug

Showing 2 changed files with 14 additions and 7 deletions

platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ e471320
... ... @@ -685,19 +685,24 @@
685 685 <select id="findMulitPatienInfo" parameterType="map" resultType="map">
686 686 select count(1) as count, a.user_id as user_id from (
687 687 select a.ymd, a.user_id from (
688   - select DATE_FORMAT(create_date, '%Y-%m-%d') as ymd, user_id
689   - from coupon_info
690   - where user_id in
  688 + select DATE_FORMAT(a.create_date, '%Y-%m-%d') as ymd, a.user_id
  689 + from coupon_info a, coupon_template b, coupon_type c
  690 + where a.user_id in
691 691 <foreach collection="userIds" open="(" close=")" separator="," item="uid">
692 692 #{uid}
693 693 </foreach>
694 694 <if test="startDate != null">
695   - and create_date >= #{startDate}
  695 + and a.create_date >= #{startDate}
696 696 </if>
697 697 <if test="endDate != null">
698   - and create_date <![CDATA[ < ]]> #{endDate}
  698 + and a.create_date <![CDATA[ < ]]> #{endDate}
699 699 </if>
700   - order by create_date desc
  700 + and a.coupon_template_id = b.id and b.type_id = c.id
  701 + and c.type in
  702 + <foreach collection="couponType" open="(" close=")" separator="," item="type">
  703 + #{type}
  704 + </foreach>
  705 + order by a.create_date desc
701 706 ) a group by a.ymd, a.user_id
702 707 ) a group by a.user_id
703 708 </select>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ e471320
... ... @@ -1285,7 +1285,9 @@
1285 1285 List<String> sendUserIds2 = new ArrayList<>();
1286 1286 if(CollectionUtils.isNotEmpty(sendUserIds)) {
1287 1287 // List<Map<String, Object>> mulitPatienInfo = couponMapper.findMulitPatienInfo(sendUserIds); /** 查询需要添加人数的总数, 例如A发了两次优惠券 那么这里返回需要加的值为1 */
1288   - List<Map<String, Object>> mulitPatienInfo = couponMapper.findMulitPatienInfo(CollectionUtils.createMap("userIds", sendUserIds, "startDate", param.get("startDate"), "endDate", param.get("endDate"))); /** 查询需要添加人数的总数, 例如A发了两次优惠券 那么这里返回需要加的值为1 */
  1288 + param.put("userIds", sendUserIds);
  1289 + List<Map<String, Object>> mulitPatienInfo = couponMapper.findMulitPatienInfo(param); /** 查询需要添加人数的总数, 例如A发了两次优惠券 那么这里返回需要加的值为1 */
  1290 + System.out.println(sendUserIds);
1289 1291 for (Map<String, Object> m : mulitPatienInfo) {
1290 1292 Long count = (Long) m.get("count");
1291 1293 sendUserIds2.add((String) m.get("user_id"));