Commit 5ad10b9e8c2ffc8e1d95329a1e75a3f6d87b923b

Authored by litao
1 parent 64a590daae

返回使用/发放人数id

Showing 4 changed files with 46 additions and 0 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java View file @ 5ad10b9
... ... @@ -82,5 +82,9 @@
82 82 List<Map<String,Object>> findUserSendInfo(Map<String, Object> param);
83 83  
84 84 Integer findUserSendInfoCount(Map<String, Object> param);
  85 +
  86 + List<String> findSendUserIds(Map<String, Object> param);
  87 +
  88 + List<String> findUsedUserIds(Map<String, Object> param);
85 89 }
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ 5ad10b9
... ... @@ -239,6 +239,23 @@
239 239 group by b.coupon_order, b.type, a.used_hospital_id
240 240 </select>
241 241  
  242 + <select id="findUsedUserIds" parameterType="map" resultType="lists">
  243 + select distinct(b.user_id)
  244 + from organization a, coupon_info b, coupon_template c, coupon_type d
  245 + where a.id = b.used_hospital_id and b.coupon_template_id = c.id and c.type_id = d.id
  246 + and a.id = #{hid}
  247 + and d.type in
  248 + <foreach collection="couponType" open="(" close=")" separator="," item="type">
  249 + #{type}
  250 + </foreach>
  251 + <if test="startDate != null">
  252 + and b.use_date >= #{startDate}
  253 + </if>
  254 + <if test="endDate != null">
  255 + and b.use_date <![CDATA[ < ]]> #{endDate}
  256 + </if>
  257 + </select>
  258 +
242 259 <select id="findHospitalUsedInfo" parameterType="map" resultType="map">
243 260 select a.id, count(distinct(b.user_id)) as user_used_count, count(1) as coupon_used_count, a.area_id, a.city_id, a.province_id
244 261 from organization a, coupon_info b, coupon_template c, coupon_type d
... ... @@ -253,6 +270,23 @@
253 270 </if>
254 271 <if test="endDate != null">
255 272 and b.use_date <![CDATA[ < ]]> #{endDate}
  273 + </if>
  274 + </select>
  275 +
  276 + <select id="findSendUserIds" parameterType="map" resultType="list">
  277 + select distinct(b.user_id)
  278 + from organization a, coupon_info b, coupon_template c, coupon_type d
  279 + where a.id = b.create_hospital_id and b.coupon_template_id = c.id and c.type_id = d.id
  280 + and a.id = #{hid}
  281 + and d.type in
  282 + <foreach collection="couponType" open="(" close=")" separator="," item="type">
  283 + #{type}
  284 + </foreach>
  285 + <if test="startDate != null">
  286 + and b.create_date >= #{startDate}
  287 + </if>
  288 + <if test="endDate != null">
  289 + and b.create_date <![CDATA[ < ]]> #{endDate}
256 290 </if>
257 291 </select>
258 292  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 5ad10b9
... ... @@ -468,6 +468,13 @@
468 468 Map<String, Object> sendInfo = couponMapper.findHospitalSendInfo(param);
469 469  
470 470 Map<String, Object> tempMap = packCouponMap(sendInfo, usedInfo, hNameMap, hid, xAxis, param);
  471 + /** 方法/使用人数id */
  472 + List<String> sendUserIds = couponMapper.findSendUserIds(param);
  473 + List<String> usedUserIds = couponMapper.findUsedUserIds(param);
  474 + tempMap.put("sendUserIds", sendUserIds);
  475 + tempMap.put("usedUserIds", usedUserIds);
  476 +
  477 +
471 478 if(MapUtils.isNotEmpty(tempMap)) {
472 479 couponReport.add(tempMap);
473 480 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java View file @ 5ad10b9
... ... @@ -51,6 +51,7 @@
51 51 * @return
52 52 */
53 53 public List<Map<String, Object>> getListByGroup(List<Patients> patients) {
  54 +
54 55 Map<String, Integer> codeMap = new HashMap<>(); /** key为 provinceId_cityId_areaId_month */
55 56 Map<Integer, Integer> otherMap = new HashMap<>(); /** key为 month */
56 57