|
@@ -295,26 +295,71 @@ public interface SiQueryDao {
|
|
|
@Param("mdtrtId") String mdtrtId,
|
|
|
@Param("insutype") String insutype);
|
|
|
|
|
|
- @Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
|
|
|
- "psn_cash_pay,setl_time,med_type, " +
|
|
|
- "fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
- "and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
|
|
|
- "hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
- "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
|
|
|
- "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
- "and setl_time<=#{endtime} and insuplc_admdvs='439900' ")
|
|
|
+ @Select("SELECT pat_no, " +
|
|
|
+ " times, " +
|
|
|
+ " ledger_sn, " +
|
|
|
+ " insuplc_admdvs, " +
|
|
|
+ " medfee_sumamt, " +
|
|
|
+ " insutype, " +
|
|
|
+ " hifmi_pay, " +
|
|
|
+ " hifp_pay, " +
|
|
|
+ " cvlserv_pay, " +
|
|
|
+ " setl_list_id, " +
|
|
|
+ " psn_name, " +
|
|
|
+ " psn_cash_pay, " +
|
|
|
+ " setl_time, " +
|
|
|
+ " a.med_type, " +
|
|
|
+ " fundPaySumamt= " +
|
|
|
+ " (SELECT sum(b.fund_payamt) " +
|
|
|
+ " FROM t_si_setldetail b " +
|
|
|
+ " WHERE b.pat_no = a.pat_no " +
|
|
|
+ " AND b.times = a.times " +
|
|
|
+ " AND b.ledger_sn = a.ledger_sn), a.insutype, hospPay= " +
|
|
|
+ " (SELECT sum(b.fund_payamt) " +
|
|
|
+ " FROM t_si_setldetail b " +
|
|
|
+ " WHERE b.pat_no = a.pat_no " +
|
|
|
+ " AND b.times = a.times " +
|
|
|
+ " AND b.ledger_sn = a.ledger_sn " +
|
|
|
+ " AND (b.fund_pay_type = '999996' " +
|
|
|
+ " OR b.setl_proc_info = '999996')), maf_pay/*医疗救助*/, admiss_date = zy.admiss_date, dis_date = zy.dis_date, idCard = " +
|
|
|
+ " (SELECT top 1 social_no " +
|
|
|
+ " FROM a_patient_mi " +
|
|
|
+ " WHERE pat_no = inpatient_no), dis_diag_comment = dis.dis_diag_comment, dis_diag = dis.dis_diag " +
|
|
|
+ "FROM t_si_setlinfo a " +
|
|
|
+ "LEFT JOIN zy_dis_diag_yb dis " +
|
|
|
+ " ON (a.pat_no = dis.inpatient_no " +
|
|
|
+ " AND a.times = dis.admiss_times and dis_diag_no = 1) " +
|
|
|
+ "LEFT JOIN zy_inactpatient zy " +
|
|
|
+ " ON (zy.inpatient_no = a.pat_no " +
|
|
|
+ " AND zy.admiss_times = a.times) " +
|
|
|
+ "WHERE revoked = 0 " +
|
|
|
+ " AND setl_type = #{setlType} " +
|
|
|
+ " AND insutype LIKE #{insutype} " +
|
|
|
+ " AND setl_time>=#{begntime} " +
|
|
|
+ " AND setl_time<=#{endtime} " +
|
|
|
+ " AND insuplc_admdvs='439900' ")
|
|
|
List<BaseSetlStatistics> selectBaseSetlStatisticsInProvinceLevel(@Param("begntime") String begntime,
|
|
|
@Param("endtime") String endtime,
|
|
|
@Param("insutype") String insutype,
|
|
|
@Param("setlType") String setlType);
|
|
|
|
|
|
@Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
|
|
|
- "psn_cash_pay,setl_time,med_type, " +
|
|
|
+ "psn_cash_pay,setl_time,a.med_type, " +
|
|
|
"fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
"and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
|
|
|
"hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
- "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
|
|
|
- "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
+ "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996'))," +
|
|
|
+ " maf_pay, " +
|
|
|
+ " admiss_date = zy.admiss_date, " +
|
|
|
+ " dis_date = zy.dis_date, " +
|
|
|
+ " idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
|
|
|
+ " dis_diag_comment = dis.dis_diag_comment, " +
|
|
|
+ " dis_diag = dis.dis_diag " +
|
|
|
+ "from t_si_setlinfo a " +
|
|
|
+ " left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times and dis_diag_no = 1) " +
|
|
|
+ " left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
|
|
|
+ " and zy.admiss_times = a.times) " +
|
|
|
+ "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
"and setl_time<=#{endtime} and insuplc_admdvs not in ('439900','430121','430181') and insuplc_admdvs like '4301%' ")
|
|
|
List<BaseSetlStatistics> selectBaseSetlStatisticsInChangshaCity(@Param("begntime") String begntime,
|
|
|
@Param("endtime") String endtime,
|
|
@@ -322,12 +367,22 @@ public interface SiQueryDao {
|
|
|
@Param("setlType") String setlType);
|
|
|
|
|
|
@Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
|
|
|
- "psn_cash_pay,setl_time,med_type, " +
|
|
|
+ "psn_cash_pay,setl_time,a.med_type, " +
|
|
|
"fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
"and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
|
|
|
"hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
- "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
|
|
|
- "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
+ "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')), " +
|
|
|
+ " maf_pay, " +
|
|
|
+ " admiss_date = zy.admiss_date, " +
|
|
|
+ " dis_date = zy.dis_date, " +
|
|
|
+ " idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
|
|
|
+ " dis_diag_comment = dis.dis_diag_comment, " +
|
|
|
+ " dis_diag = dis.dis_diag " +
|
|
|
+ "from t_si_setlinfo a " +
|
|
|
+ " left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times and dis_diag_no = 1) " +
|
|
|
+ " left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
|
|
|
+ " and zy.admiss_times = a.times) " +
|
|
|
+ "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
"and setl_time<=#{endtime} and insuplc_admdvs='430121' ")
|
|
|
List<BaseSetlStatistics> selectBaseSetlStatisticsInChangshaCounty(@Param("begntime") String begntime,
|
|
|
@Param("endtime") String endtime,
|
|
@@ -335,12 +390,22 @@ public interface SiQueryDao {
|
|
|
@Param("setlType") String setlType);
|
|
|
|
|
|
@Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
|
|
|
- "psn_cash_pay,setl_time,med_type, " +
|
|
|
+ "psn_cash_pay,setl_time,a.med_type, " +
|
|
|
"fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
"and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
|
|
|
"hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
- "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
|
|
|
- "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
+ "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')), " +
|
|
|
+ " maf_pay, " +
|
|
|
+ " admiss_date = zy.admiss_date, " +
|
|
|
+ " dis_date = zy.dis_date, " +
|
|
|
+ " idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
|
|
|
+ " dis_diag_comment = dis.dis_diag_comment, " +
|
|
|
+ " dis_diag = dis.dis_diag " +
|
|
|
+ "from t_si_setlinfo a " +
|
|
|
+ " left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times and dis_diag_no = 1) " +
|
|
|
+ " left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
|
|
|
+ " and zy.admiss_times = a.times) " +
|
|
|
+ "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
"and setl_time<=#{endtime} and insuplc_admdvs='430181' ")
|
|
|
List<BaseSetlStatistics> selectBaseSetlStatisticsInLiuYangCity(@Param("begntime") String begntime,
|
|
|
@Param("endtime") String endtime,
|
|
@@ -348,12 +413,22 @@ public interface SiQueryDao {
|
|
|
@Param("setlType") String setlType);
|
|
|
|
|
|
@Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
|
|
|
- "psn_cash_pay,setl_time,med_type,med_type, " +
|
|
|
+ "psn_cash_pay,setl_time,a.med_type, " +
|
|
|
"fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
"and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
|
|
|
"hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
- "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
|
|
|
- "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
+ "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')), " +
|
|
|
+ " maf_pay, " +
|
|
|
+ " admiss_date = zy.admiss_date, " +
|
|
|
+ " dis_date = zy.dis_date, " +
|
|
|
+ " idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
|
|
|
+ " dis_diag_comment = dis.dis_diag_comment, " +
|
|
|
+ " dis_diag = dis.dis_diag " +
|
|
|
+ "from t_si_setlinfo a " +
|
|
|
+ " left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times and dis_diag_no = 1) " +
|
|
|
+ " left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
|
|
|
+ " and zy.admiss_times = a.times) " +
|
|
|
+ "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
"and setl_time<=#{endtime} and insuplc_admdvs!='439900' and insuplc_admdvs like '43%' and insuplc_admdvs not like '4301%' ")
|
|
|
List<BaseSetlStatistics> selectBaseSetlStatisticsInProvinceOtherCities(@Param("begntime") String begntime,
|
|
|
@Param("endtime") String endtime,
|
|
@@ -361,12 +436,22 @@ public interface SiQueryDao {
|
|
|
@Param("setlType") String setlType);
|
|
|
|
|
|
@Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
|
|
|
- "psn_cash_pay,setl_time,med_type, " +
|
|
|
+ "psn_cash_pay,setl_time,a.med_type, " +
|
|
|
"fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
"and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
|
|
|
"hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
- "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
|
|
|
- "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
+ "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')), " +
|
|
|
+ " maf_pay, " +
|
|
|
+ " admiss_date = zy.admiss_date, " +
|
|
|
+ " dis_date = zy.dis_date, " +
|
|
|
+ " idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
|
|
|
+ " dis_diag_comment = dis.dis_diag_comment, " +
|
|
|
+ " dis_diag = dis.dis_diag " +
|
|
|
+ "from t_si_setlinfo a " +
|
|
|
+ " left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times and dis_diag_no = 1) " +
|
|
|
+ " left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
|
|
|
+ " and zy.admiss_times = a.times) " +
|
|
|
+ "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
"and setl_time<=#{endtime} and insuplc_admdvs!='439900' and insuplc_admdvs not like '43%' ")
|
|
|
List<BaseSetlStatistics> selectBaseSetlStatisticsOutProvince(@Param("begntime") String begntime,
|
|
|
@Param("endtime") String endtime,
|
|
@@ -374,12 +459,22 @@ public interface SiQueryDao {
|
|
|
@Param("setlType") String setlType);
|
|
|
|
|
|
@Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
|
|
|
- "psn_cash_pay,setl_time,med_type, " +
|
|
|
+ "psn_cash_pay,setl_time,a.med_type, " +
|
|
|
"fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
"and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
|
|
|
"hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
|
|
|
- "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
|
|
|
- "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
+ "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')), " +
|
|
|
+ " maf_pay, " +
|
|
|
+ " admiss_date = zy.admiss_date, " +
|
|
|
+ " dis_date = zy.dis_date, " +
|
|
|
+ " idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
|
|
|
+ " dis_diag_comment = dis.dis_diag_comment, " +
|
|
|
+ " dis_diag = dis.dis_diag " +
|
|
|
+ "from t_si_setlinfo a " +
|
|
|
+ " left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times and dis_diag_no = 1) " +
|
|
|
+ " left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
|
|
|
+ " and zy.admiss_times = a.times) " +
|
|
|
+ "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
|
|
|
"and setl_time<=#{endtime} ")
|
|
|
List<BaseSetlStatistics> selectBaseSetlStatisticsInAllPlaces(@Param("begntime") String begntime,
|
|
|
@Param("endtime") String endtime,
|