Commit 768d8e27a804bba85a1dd8a262124dd9b60e655e

Authored by litao
1 parent 8666f81299

bug修复 null转换为0

Showing 1 changed file with 12 additions and 14 deletions

platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ 768d8e2
... ... @@ -235,16 +235,13 @@
235 235  
236 236 <select id="findHospitalUsedInfo" parameterType="map" resultType="map">
237 237 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
238   - from organization a, coupon_info b, coupon_template c, coupon_type d, hospital_coupon_template_group e, coupon_template_group f
239   - where a.id = b.used_hospital_id and b.coupon_template_id = c.id and c.type_id = d.id and e.coupon_template_group_id = f.id and e.hospital_id = 1000000095
  238 + from organization a, coupon_info b, coupon_template c, coupon_type d
  239 + where a.id = b.used_hospital_id and b.coupon_template_id = c.id and c.type_id = d.id
240 240 and a.id = #{hid}
241 241 and d.type in
242 242 <foreach collection="couponType" open="(" close=")" separator="," item="type">
243 243 #{type}
244 244 </foreach>
245   - <if test="tempId != null and tempId != ''">
246   - and f.id = #{tempId}
247   - </if>
248 245 <if test="startDate != null">
249 246 and b.use_date >= #{startDate}
250 247 </if>
251 248  
... ... @@ -255,16 +252,13 @@
255 252  
256 253 <select id="findHospitalSendInfo" parameterType="map" resultType="map">
257 254 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
258   - from organization a, coupon_info b, coupon_template c, coupon_type d, hospital_coupon_template_group e, coupon_template_group f
259   - where a.id = b.create_hospital_id and b.coupon_template_id = c.id and c.type_id = d.id and e.coupon_template_group_id = f.id and e.hospital_id = 1000000095
  255 + from organization a, coupon_info b, coupon_template c, coupon_type d
  256 + where a.id = b.create_hospital_id and b.coupon_template_id = c.id and c.type_id = d.id
260 257 and a.id = #{hid}
261 258 and d.type in
262 259 <foreach collection="couponType" open="(" close=")" separator="," item="type">
263 260 #{type}
264 261 </foreach>
265   - <if test="tempId != null and tempId != ''">
266   - and f.id = #{tempId}
267   - </if>
268 262 <if test="startDate != null">
269 263 and b.create_date >= #{startDate}
270 264 </if>
271 265  
272 266  
273 267  
... ... @@ -345,18 +339,22 @@
345 339 </select>
346 340  
347 341 <select id="doHospitalFilter" parameterType="map" resultType="string">
348   - select id from organization where id in
  342 + select a.id from organization a, hospital_coupon_template_group b
  343 + where a.id in
349 344 <foreach collection="hospitalId" open="(" close=")" separator="," item="hid">
350 345 #{hid}
351 346 </foreach>
352 347 <if test="provinceId != null and provinceId != ''">
353   - and province_id = #{provinceId}
  348 + and a.province_id = #{provinceId}
354 349 </if>
355 350 <if test="cityId != null and cityId != '' ">
356   - and city_id = #{cityId}
  351 + and a.city_id = #{cityId}
357 352 </if>
358 353 <if test="areaId != null and areaId != ''">
359   - and area_id = #{areaId}
  354 + and a.area_id = #{areaId}
  355 + </if>
  356 + <if test="tempId != null and tempId != ''">
  357 + and ab.coupon_template_group_id = #{tempId}
360 358 </if>
361 359 </select>
362 360