diff --git a/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml b/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml index f7f3c12..7946085 100644 --- a/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml +++ b/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml @@ -344,7 +344,7 @@ 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 - from organization a, coupon_info b, coupon_template c, coupon_type d + from organization a, (select * from coupon_info where used_hospital_id = #{hid}) b, coupon_template c, coupon_type d where a.id = b.used_hospital_id and b.coupon_template_id = c.id and c.type_id = d.id and a.id = #{hid} and b.status = 2 @@ -415,7 +415,7 @@ select a.id, count(distinct(b.user_id)) as people_send_count, count(1) as coupon_send_count, a.area_id, a.city_id, a.province_id - from organization a, coupon_info b, coupon_template c, coupon_type d + from organization a, (select * from coupon_info where create_hospital_id = #{hid}) b, coupon_template c, coupon_type d where a.id = b.create_hospital_id and b.coupon_template_id = c.id and c.type_id = d.id and a.id = #{hid} and d.type in @@ -449,7 +449,7 @@