Commit 39c659f18325999523152592f8dd6806cc5ecd87

Authored by litao@lymsh.com
1 parent 62b09c0676

处理发放优惠券医生为空的数据

Showing 1 changed file with 16 additions and 2 deletions

platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ 39c659f
... ... @@ -665,7 +665,21 @@
665 665  
666 666  
667 667 <select id="findUserSendInfoByUids" resultType="map" parameterType="map">
668   - select distinct(a.create_hospital_id), a.user_id, DATE_FORMAT(a.create_date, '%Y-%m-%d') as create_date, d.name as send_hospital, e.name as doctoer_name
  668 + select a.create_hospital_id, a.user_id, a.create_date, a.send_hospital, b.name as doctoer_name from (
  669 + select distinct(a.create_hospital_id), a.user_id, DATE_FORMAT(a.create_date, '%Y-%m-%d') as create_date, d.name as send_hospital, a.create_user_id
  670 + from coupon_info a, coupon_template b, coupon_type c, organization d
  671 + where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id
  672 + and a.create_hospital_id in
  673 + <foreach collection="hid" open="(" close=")" separator="," item="hid">
  674 + #{hid}
  675 + </foreach>
  676 + and a.user_id in
  677 + <foreach collection="uids" open="(" close=")" separator="," item="uid">
  678 + #{uid}
  679 + </foreach>
  680 + ) a left join users b on a.create_user_id = b.id
  681 +
  682 + <!-- select distinct(a.create_hospital_id), a.user_id, DATE_FORMAT(a.create_date, '%Y-%m-%d') as create_date, d.name as send_hospital, e.name as doctoer_name
669 683 from coupon_info a, coupon_template b, coupon_type c, organization d, users e
670 684 where a.coupon_template_id = b.id and b.type_id = c.id and a.create_hospital_id = d.id and a.create_user_id = e.id
671 685 and a.create_hospital_id in
... ... @@ -675,7 +689,7 @@
675 689 and a.user_id in
676 690 <foreach collection="uids" open="(" close=")" separator="," item="uid">
677 691 #{uid}
678   - </foreach>
  692 + </foreach>-->
679 693 </select>
680 694 </mapper>