|
@@ -164,7 +164,7 @@ public interface YbStatDao {
|
|
YbStatResult selectYbStatRatioTotal(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType);
|
|
YbStatResult selectYbStatRatioTotal(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType);
|
|
|
|
|
|
@Select("<script>" +
|
|
@Select("<script>" +
|
|
- "select a.*, rtrim(zy.small_dept) as deptId, rtrim(z.name) as psnCertType," +
|
|
|
|
|
|
+ "select a.*, rtrim(zy.small_dept) as deptId, rtrim(z.name) as dept," +
|
|
"rtrim(isnull(zd2.dis_diag_comment, zd1.dis_diag_comment)) as mainDiagnosis, rtrim(isnull(ss2.ssmc, ss1.ssmc)) as mainOperation " +
|
|
"rtrim(isnull(zd2.dis_diag_comment, zd1.dis_diag_comment)) as mainDiagnosis, rtrim(isnull(ss2.ssmc, ss1.ssmc)) as mainOperation " +
|
|
"from t_si_setlinfo a " +
|
|
"from t_si_setlinfo a " +
|
|
"left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no and zy.admiss_times = a.times) " +
|
|
"left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no and zy.admiss_times = a.times) " +
|
|
@@ -198,7 +198,7 @@ public interface YbStatDao {
|
|
@Param("med_type") List<String> med_type);
|
|
@Param("med_type") List<String> med_type);
|
|
|
|
|
|
@Select("<script>" +
|
|
@Select("<script>" +
|
|
- "select a.*, rtrim(zy.small_dept) as deptId, rtrim(z.name) as psnCertType, " +
|
|
|
|
|
|
+ "select a.*, rtrim(zy.small_dept) as deptId, rtrim(z.name) as dept, " +
|
|
"rtrim(isnull(zd2.dis_diag_comment, zd1.dis_diag_comment)) as mainDiagnosis, rtrim(isnull(ss2.ssmc, ss1.ssmc)) as mainOperation " +
|
|
"rtrim(isnull(zd2.dis_diag_comment, zd1.dis_diag_comment)) as mainDiagnosis, rtrim(isnull(ss2.ssmc, ss1.ssmc)) as mainOperation " +
|
|
"from t_si_setlinfo a " +
|
|
"from t_si_setlinfo a " +
|
|
"left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no and zy.admiss_times = a.times) " +
|
|
"left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no and zy.admiss_times = a.times) " +
|
|
@@ -214,7 +214,7 @@ public interface YbStatDao {
|
|
|
|
|
|
|
|
|
|
@Select("<script>" +
|
|
@Select("<script>" +
|
|
- "select a.*, rtrim(zy.small_dept) as deptId, rtrim(z.name) as psnCertType, " +
|
|
|
|
|
|
+ "select a.*, rtrim(zy.small_dept) as deptId, rtrim(z.name) as dept, " +
|
|
"rtrim(isnull(zd2.dis_diag_comment, zd1.dis_diag_comment)) as mainDiagnosis, rtrim(isnull(ss2.ssmc, ss1.ssmc)) as mainOperation " +
|
|
"rtrim(isnull(zd2.dis_diag_comment, zd1.dis_diag_comment)) as mainDiagnosis, rtrim(isnull(ss2.ssmc, ss1.ssmc)) as mainOperation " +
|
|
"from t_si_setlinfo a " +
|
|
"from t_si_setlinfo a " +
|
|
"left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no and zy.admiss_times = a.times) " +
|
|
"left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no and zy.admiss_times = a.times) " +
|
|
@@ -230,7 +230,7 @@ public interface YbStatDao {
|
|
|
|
|
|
|
|
|
|
@Select("<script>" +
|
|
@Select("<script>" +
|
|
- "select a.*, rtrim(zy.small_dept) as deptId, rtrim(z.name) as psnCertType, " +
|
|
|
|
|
|
+ "select a.*, rtrim(zy.small_dept) as deptId, rtrim(z.name) as dept, " +
|
|
"rtrim(isnull(zd2.dis_diag_comment, zd1.dis_diag_comment)) as mainDiagnosis, rtrim(isnull(ss2.ssmc, ss1.ssmc)) as mainOperation " +
|
|
"rtrim(isnull(zd2.dis_diag_comment, zd1.dis_diag_comment)) as mainDiagnosis, rtrim(isnull(ss2.ssmc, ss1.ssmc)) as mainOperation " +
|
|
"from t_si_setlinfo a " +
|
|
"from t_si_setlinfo a " +
|
|
"left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no and zy.admiss_times = a.times) " +
|
|
"left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no and zy.admiss_times = a.times) " +
|
|
@@ -336,4 +336,50 @@ public interface YbStatDao {
|
|
List<Map<String, Object>> selectTreeAllData(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType,
|
|
List<Map<String, Object>> selectTreeAllData(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType,
|
|
@Param("dept") String dept, @Param("doctor") String doctor, @Param("insurType") String insurType);
|
|
@Param("dept") String dept, @Param("doctor") String doctor, @Param("insurType") String insurType);
|
|
|
|
|
|
|
|
+ @Select("<script>" +
|
|
|
|
+ "select psnCount=count(distinct a.kaz001), " +
|
|
|
|
+ "inDays=sum(datediff(day, zy.admiss_date, zy.dis_date)), " +
|
|
|
|
+ "avgInDays=cast(round(sum(datediff(day, zy.admiss_date, zy.dis_date))/cast(count(distinct a.kaz001) as decimal(12,2)),2) as decimal(12,2)), " +
|
|
|
|
+ "totalFee=cast(round(sum(a.aae019),2) as decimal(12,2)), " +
|
|
|
|
+ "fundPooling=cast(round(sum(isnull(b.aae019, 0)),2) as decimal(12,2)), " +
|
|
|
|
+ "allFunds=cast(round(sum(a.akc264),2) as decimal(12,2)) " +
|
|
|
|
+ "from t_injury_setlinfo a " +
|
|
|
|
+ "left join t_injury_setldetail b on a.kaz001 = b.kaz001 and b.bka023 = 'C000' " +
|
|
|
|
+ "left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no and zy.admiss_times = a.times) " +
|
|
|
|
+ "where a.revoked=0 and a.setl_type=#{setlType} and a.ake010 >= #{beginTime} and a.ake010 <= #{endTime} " +
|
|
|
|
+ "</script>")
|
|
|
|
+ YbStatResult selectYbStatInfoIninjury(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType);
|
|
|
|
+
|
|
|
|
+ @Select("<script>" +
|
|
|
|
+ "select a.aac003 as psnName, a.pat_no as patNo, a.times, a.kaz001 as setlId, a.aaz217 as mdtrtId, " +
|
|
|
|
+ "a.aac004 as gend, convert(date, substring(a.aac002, 7, 8)) as brdy, a.aac002 as certno, " +
|
|
|
|
+ "a.baa027 as insuplcAdmdvs, a.aae140 as insutype, a.bka035 as psnType, a.aka130 as medType, rtrim(z.name) as dept, " +
|
|
|
|
+ "<if test=\"setlType == '21'.toString \"> " +
|
|
|
|
+ "zy.admiss_date as begntime, zy.dis_date as endtime, rtrim(zy.small_dept) as deptId, " +
|
|
|
|
+ "</if> " +
|
|
|
|
+ "<if test=\"setlType == '11'.toString \"> " +
|
|
|
|
+ "zy.visit_dept_code as deptId, " +
|
|
|
|
+ "</if> " +
|
|
|
|
+ "cast(substring(a.ake010, 1, 4) + '-' + substring(a.ake010, 5, 2) + '-' + substring(a.ake010, 7, 2) + ' ' + " +
|
|
|
|
+ " substring(a.ake010, 9, 2) + ':' + substring(a.ake010, 11, 2) + ':' + substring(a.ake010, 13, 2) as datetime) as setlTime, " +
|
|
|
|
+ "a.aae019 as medfeeSumamt, a.akc264 as fundPaySumamt, a.akc268 as psnCashPay, cast(isnull(b.aae019, 0) as numeric(10, 2)) as mealsFee, " +
|
|
|
|
+ "rtrim(isnull(zd2.dis_diag_comment, zd1.dis_diag_comment)) as mainDiagnosis, rtrim(isnull(ss2.ssmc, ss1.ssmc)) as mainOperation " +
|
|
|
|
+ "from t_injury_setlinfo a " +
|
|
|
|
+ "left join t_injury_setldetail b on (a.kaz001 = b.kaz001 and b.bka023 = 'C004') " +
|
|
|
|
+ "<if test=\"setlType == '21' \"> " +
|
|
|
|
+ "left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no and zy.admiss_times = a.times) " +
|
|
|
|
+ "left join zd_unit_code z on zy.small_dept = z.code " +
|
|
|
|
+ "</if> " +
|
|
|
|
+ "<if test=\"setlType == '11' \"> " +
|
|
|
|
+ "left join mz_visit_table zy on (zy.patient_id = a.pat_no and zy.times = a.times) " +
|
|
|
|
+ "left join zd_unit_code z on zy.visit_dept_code = z.code " +
|
|
|
|
+ "</if> " +
|
|
|
|
+ "left join zy_dis_diag_yb zd1 on (zd1.inpatient_no = a.pat_no and zd1.admiss_times = a.times and zd1.dis_diag_no = '1') " +
|
|
|
|
+ "left join zy_dis_diag_yb_modify zd2 on (zd2.inpatient_no = a.pat_no and zd2.admiss_times = a.times and zd2.dis_diag_no = '1') " +
|
|
|
|
+ "left join batj_ba4 ss1 on (ss1.zyh = a.pat_no and ss1.zycs = a.times and ss1.ssxh = '1') " +
|
|
|
|
+ "left join batj_ba4_modify ss2 on (ss2.zyh = a.pat_no and ss2.zycs = a.times and ss2.ssxh = '1') " +
|
|
|
|
+ "where a.revoked=0 and a.setl_type=#{setlType} and a.ake010 >= #{beginTime} and a.ake010 <= #{endTime} " +
|
|
|
|
+ "</script>")
|
|
|
|
+ List<SiSetlinfo> selectInjurySetlInfoList(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType);
|
|
|
|
+
|
|
}
|
|
}
|