From 3011f29e06877bd56e6c0dd402677c3c8926ca79 Mon Sep 17 00:00:00 2001 From: lige <bestlige@outlook.com> Date: 星期三, 03 一月 2024 13:48:19 +0800 Subject: [PATCH] 职业健康报表既往病史sql --- ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjAskHistorysMapper.java | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjAskHistorysMapper.java b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjAskHistorysMapper.java index 126f817..eb65560 100644 --- a/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjAskHistorysMapper.java +++ b/ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjAskHistorysMapper.java @@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Select; import java.util.List; +import java.util.Map; /** * @Company: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 @@ -27,6 +28,7 @@ @Select("SELECT IF((SELECT COUNT(*) from (SELECT b.* FROM tj_ask_medical_history a left join tj_ask_historys b on a.ask_id=b.ask_id where a.tj_num='${tjNumber}' and b.type='鏃㈠線鐥�') c where c.icd_id IN ('376','11907','30123','11197','15435'))>0,(SELECT REPLACE((SELECT REPLACE((SELECT REPLACE((SELECT REPLACE((SELECT REPLACE('1銆佹棤寮傚父2銆佽倽鐐�3銆佽偤缁撴牳4銆佺毊鑲よ繃鏁�5銆佸績鑴忕柧鐥�6銆侀珮琛�鍘�',(SELECT IFNULL((SELECT c.disease_name from (SELECT b.* FROM tj_ask_medical_history a left join tj_ask_historys b on a.ask_id=b.ask_id where a.tj_num='${tjNumber}' and b.type='鏃㈠線鐥�') c where c.icd_id='11197'),'') aaa),'楂樿鍘嬧垰')),(SELECT IFNULL((SELECT c.disease_name from (SELECT b.* FROM tj_ask_medical_history a left join tj_ask_historys b on a.ask_id=b.ask_id where a.tj_num='${tjNumber}' and b.type='鏃㈠線鐥�') c where c.icd_id='15435'),'') aaa),'鑲濈値鈭�') as a),(SELECT IFNULL((SELECT c.disease_name from (SELECT b.* FROM tj_ask_medical_history a left join tj_ask_historys b on a.ask_id=b.ask_id where a.tj_num='${tjNumber}' and b.type='鏃㈠線鐥�') c where c.icd_id='376'),'') aaa),'鑲虹粨鏍糕垰') as bb),(SELECT IFNULL((SELECT c.disease_name from (SELECT b.* FROM tj_ask_medical_history a left join tj_ask_historys b\n" + - "on a.ask_id=b.ask_id where a.tj_num='${tjNumber}' and b.type='鏃㈠線鐥�') c where c.icd_id='30123'),'') aaa) ,'鐨偆杩囨晱鈭�')),(SELECT IFNULL((SELECT c.disease_name from (SELECT b.* FROM tj_ask_medical_history a left join tj_ask_historys b on a.ask_id=b.ask_id where a.tj_num='${tjNumber}' and b.type='鏃㈠線鐥�') c where c.icd_id='11907'),'') aaa),'蹇冭剰鐤剧梾鈭�') '鏃㈠線鐥呭彶'),'1銆佹棤寮傚父鈭� 2銆佽倽鐐� 3銆佽偤缁撴牳 4銆佺毊鑲よ繃鏁� 5銆佸績鑴忕柧鐥� 6銆侀珮琛�鍘�') '鏃㈠線鐥呭彶'") - String jiwangbingshi(String tjNumber); + "on a.ask_id=b.ask_id where a.tj_num='${tjNumber}' and b.type='鏃㈠線鐥�') c where c.icd_id='30123'),'') aaa) ,'鐨偆杩囨晱鈭�')),(SELECT IFNULL((SELECT c.disease_name from (SELECT b.* FROM tj_ask_medical_history a left join tj_ask_historys b on a.ask_id=b.ask_id where a.tj_num='${tjNumber}' and b.type='鏃㈠線鐥�') c where c.icd_id='11907'),'') aaa),'蹇冭剰鐤剧梾鈭�') '鏃㈠線鐥呭彶'),'1銆佹棤寮傚父鈭� 2銆佽倽鐐� 3銆佽偤缁撴牳 4銆佺毊鑲よ繃鏁� 5銆佸績鑴忕柧鐥� 6銆侀珮琛�鍘�') '鏃㈠線鐥呭彶' ,\n" + + "(SELECT GROUP_CONCAT(hh.a SEPARATOR ',') from (SELECT b.disease_name a FROM tj_ask_medical_history a left join tj_ask_historys b on a.ask_id=b.ask_id where a.tj_num='${tjNumber}' and b.type='鏃㈠線鐥�' and b.icd_id not IN ('376','11907','30123','11197','15435')) hh) '鍏朵粬'") + Map<String,String> jiwangbingshi(String tjNumber); } -- Gitblit v1.8.0