Commit eb7e5b08a666544717df86bb9013ff26de48d59e
1 parent
cf769d8ba3
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 16 additions and 6 deletions
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
eb7e5b0
... | ... | @@ -357,7 +357,9 @@ |
357 | 357 | </select> |
358 | 358 | |
359 | 359 | <select id="findUsedInfo2ids" parameterType="map" resultType="string"> |
360 | - select a.user_id as ids | |
360 | + Select a.user_id | |
361 | + from ( | |
362 | + select a.user_id , b.coupon_order, b.type, a.used_hospital_id | |
361 | 363 | from coupon_info a, ( |
362 | 364 | select a.id, a.coupon_order, b.type, d.hospital_id |
363 | 365 | from coupon_template a, coupon_type b, hospital_coupon_template_group d |
... | ... | @@ -377,7 +379,11 @@ |
377 | 379 | <if test="endDate != null"> |
378 | 380 | and a.use_date <![CDATA[ < ]]> #{endDate} |
379 | 381 | </if> |
380 | - | |
382 | + group by a.user_id ,b.coupon_order, b.type, a.used_hospital_id | |
383 | + )a | |
384 | + where | |
385 | + a.coupon_order = #{coupon_order} | |
386 | + and a.type = #{_type} | |
381 | 387 | </select> |
382 | 388 | |
383 | 389 | <select id="findUsedUserIds" parameterType="map" resultType="string"> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
eb7e5b0
... | ... | @@ -2710,9 +2710,12 @@ |
2710 | 2710 | |
2711 | 2711 | //秦皇岛年龄筛选 <35 岁(大于等于35需要减1次) |
2712 | 2712 | if(null!=param.get("age")) { |
2713 | - Map<String,Object> map=param; | |
2714 | - map.put("hospitalId", Arrays.asList(info.get("used_hospital_id"))); | |
2715 | - List<String> couponUsedTypeInfoIds = couponMapper.findUsedInfo2ids(map); | |
2713 | + Map<String,Object> param2=new HashedMap(); | |
2714 | + param2.putAll(param); | |
2715 | + param2.put("hospitalId", Arrays.asList(info.get("used_hospital_id"))); | |
2716 | + param2.put("type_", info.get("type")); | |
2717 | + param2.put("coupon_order", info.get("coupon_order")); | |
2718 | + List<String> couponUsedTypeInfoIds = couponMapper.findUsedInfo2ids(param2); | |
2716 | 2719 | for (String id : couponUsedTypeInfoIds) { |
2717 | 2720 | PersonModel personModel = mongoTemplate.findOne(Query.query(Criteria.where("id").is(id)), PersonModel.class); |
2718 | 2721 | if (null != personModel) { |
... | ... | @@ -3137,7 +3140,8 @@ |
3137 | 3140 | //秦皇岛年龄筛选 <35 岁(大于等于35需要移除,这里需要重新组装数据) |
3138 | 3141 | List<Map<String, Object>> couponInfo2=new ArrayList<>(); |
3139 | 3142 | if(null!=param.get("age")) { |
3140 | - Map<String,Object> param2=param; | |
3143 | + Map<String,Object> param2=new HashedMap(); | |
3144 | + param2.putAll(param); | |
3141 | 3145 | param2.put("needPage",false); |
3142 | 3146 | couponInfo2=couponMapper.couponInfo2(param2); |
3143 | 3147 | Iterator<Map<String, Object>> iterator = couponInfo2.iterator(); |