Commit f4d7164e30c67c2379787fb1a7299156cae27601

Authored by yangfei
1 parent 0790d65bba

回院提醒失败bug修改

Showing 1 changed file with 17 additions and 16 deletions

platform-biz-service/src/main/resources/mainOrm/master/PatientMarkHospital.xml View file @ f4d7164
... ... @@ -387,36 +387,37 @@
387 387  
388 388 <select id="reportFailure" resultType="com.lyms.platform.permission.model.ReportFailureHosptail"
389 389 parameterType="com.lyms.platform.permission.model.PatientMarkHospitalQuery">
  390 +
390 391 SELECT
391 392 '回院提醒' as type,
392 393 count(*) num,
393 394 sum(
394   - CASE back_failure
395   - WHEN 1 and back_result = 2 THEN
  395 + CASE
  396 + WHEN back_failure =1 and back_result = 2 THEN
396 397 1
397 398 ELSE
398 399 0
399 400 END
400 401 ) AS noPhoneNum,
401 402 sum(
402   - CASE back_failure
403   - WHEN 2 and back_result = 2 THEN
  403 + CASE
  404 + WHEN back_failure =2 and back_result = 2 THEN
404 405 1
405 406 ELSE
406 407 0
407 408 END
408 409 ) AS otherHospNum,
409 410 sum(
410   - CASE back_failure
411   - WHEN 3 and back_result = 2 THEN
  411 + CASE
  412 + WHEN back_failure =3 and back_result = 2 THEN
412 413 1
413 414 ELSE
414 415 0
415 416 END
416 417 ) AS indeterNum,
417 418 sum(
418   - CASE back_failure
419   - WHEN 4 and back_result = 2 THEN
  419 + CASE
  420 + WHEN back_failure =4 and back_result = 2 THEN
420 421 1
421 422 ELSE
422 423 0
423 424  
424 425  
425 426  
... ... @@ -431,32 +432,32 @@
431 432 '住院提醒' as type,
432 433 count(*) num,
433 434 sum(
434   - CASE in_hospit_failure
435   - WHEN 1 and in_hospit_result = 2 THEN
  435 + CASE
  436 + WHEN in_hospit_failure = 1 and in_hospit_result = 2 THEN
436 437 1
437 438 ELSE
438 439 0
439 440 END
440 441 ) AS 电话无人接听,
441 442 sum(
442   - CASE in_hospit_failure
443   - WHEN 2 and in_hospit_result = 2 THEN
  443 + CASE
  444 + WHEN in_hospit_failure = 2 and in_hospit_result = 2 THEN
444 445 1
445 446 ELSE
446 447 0
447 448 END
448 449 ) AS 他院已办理住院,
449 450 sum(
450   - CASE in_hospit_failure
451   - WHEN 3 and in_hospit_result = 2 THEN
  451 + CASE
  452 + WHEN in_hospit_failure =3 and in_hospit_result = 2 THEN
452 453 1
453 454 ELSE
454 455 0
455 456 END
456 457 ) AS 暂时未确定,
457 458 sum(
458   - CASE in_hospit_failure
459   - WHEN 4 and in_hospit_result = 2 THEN
  459 + CASE
  460 + WHEN in_hospit_failure = 4 and in_hospit_result = 2 THEN
460 461 1
461 462 ELSE
462 463 0