Commit ef85b909809ef323c64a962f1c0812358abb58c5
1 parent
50fba106b7
Exists in
master
and in
6 other branches
优惠劵统计添加字段
Showing 3 changed files with 23 additions and 0 deletions
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java
View file @
ef85b90
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
ef85b90
... | ... | @@ -967,5 +967,23 @@ |
967 | 967 | from organization |
968 | 968 | where yn = 1 |
969 | 969 | </select> |
970 | + | |
971 | + | |
972 | + <select id="findHospitalAllused" parameterType="map" resultType="map"> | |
973 | + select sum(allUserdCount) as allUserdCount from ( select count(1) as allUserdCount from coupon_info c INNER JOIN | |
974 | + (select t.id | |
975 | + from hospital_coupon_template_group h,coupon_template t ,coupon_type p | |
976 | + where h.coupon_template_group_id=t.group_id and t.type_id=p.id | |
977 | + and h.hospital_id = #{hid} | |
978 | + and p.type=2) t on c.coupon_template_id = t.id | |
979 | + where create_hospital_id= #{hid} and status =2 and used_id is not null | |
980 | + GROUP BY user_id having count(1) >= (select count(1) | |
981 | + from hospital_coupon_template_group h,coupon_template t ,coupon_type p | |
982 | + where h.coupon_template_group_id=t.group_id and t.type_id=p.id | |
983 | + and h.hospital_id = #{hid} | |
984 | + and p.type='2')) temp | |
985 | + </select> | |
986 | + | |
987 | + | |
970 | 988 | </mapper> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
ef85b90
... | ... | @@ -2459,10 +2459,13 @@ |
2459 | 2459 | param.put("hid", hid); |
2460 | 2460 | Map<String, Object> usedInfo = couponMapper.findHospitalUsedInfo2(param); |
2461 | 2461 | Map<String, Object> sendInfo = couponMapper.findHospitalSendInfo2(param); |
2462 | + Map<String, Object> allusedInfo = couponMapper.findHospitalAllused(param); | |
2462 | 2463 | |
2463 | 2464 | Map<String, Object> tempMap = packCouponMap(sendInfo, usedInfo, hNameMap, hid, xAxis, param); |
2464 | 2465 | |
2465 | 2466 | if(MapUtils.isNotEmpty(tempMap)) { |
2467 | + tempMap.put("allUserdCount",(allusedInfo == null || allusedInfo.get("allUserdCount") == null) ? 0 : allusedInfo.get("allUserdCount")); | |
2468 | + | |
2466 | 2469 | /** 方法/使用人数id */ |
2467 | 2470 | List<String> sendUserIds = couponMapper.findSendUserIds2(param); |
2468 | 2471 | List<String> usedUserIds = couponMapper.findUsedUserIds2(param); |