From 11c3eed72663870f1140616c631bb3ad1cab2838 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期一, 22 七月 2024 17:58:21 +0800 Subject: [PATCH] zjh 2024/07/22-1 --- ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/LtkjJianchajianyanTreeMapper.java | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/LtkjJianchajianyanTreeMapper.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/LtkjJianchajianyanTreeMapper.java index 75ee29e..fbcd1bd 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/LtkjJianchajianyanTreeMapper.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/LtkjJianchajianyanTreeMapper.java @@ -17,6 +17,16 @@ @Select("SELECT SUM(aa.fyhj) FROM (" + "SELECT a.fyhj FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId} GROUP BY a.sqdh,a.type)aa;") BigDecimal getLtkjJianchajianyanTreeFyhjByCardId(String cardId); + + + + @Select("SELECT COUNT(zb.sqdh) sfjf FROM (\n" + + "SELECT aa.sqdh,SUM(aa.fyhj) hj FROM (\n" + + "SELECT DISTINCT a.sqdh, a.fyhj FROM ltkj_jianchajianyan_tree a WHERE a.card_id=#{cardId}) aa GROUP BY aa.sqdh) zb\n" + + "LEFT JOIN ( SELECT a.adv_id ,SUM(a.catefee) hj FROM ltkj_querypay a WHERE a.ghxh=#{cardId} GROUP BY a.adv_id) cb ON\n" + + "\t\tzb.sqdh=(case when cb.adv_id is not null and LOCATE('_',cb.adv_id)>0 then SUBSTRING_INDEX(cb.adv_id,'_',-1) else cb.adv_id end) \n" + + "WHERE zb.hj <> cb.hj or cb.adv_id is null;") + int getSfsfByCardId(String cardId); } -- Gitblit v1.8.0