|
@@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.setlinfo.SiSetlinfo;
|
|
|
+import thyyxxk.webserver.entity.ybkf.TreeNodesResult;
|
|
|
import thyyxxk.webserver.entity.ybkf.YbStatResult;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -25,6 +26,7 @@ public interface YbStatDao {
|
|
|
"avgInDays=cast(round(sum(datediff(day, zy.admiss_date, zy.dis_date))/cast(count(distinct a.setl_id) as decimal(10,2)),2) as decimal(10,2)), " +
|
|
|
"totalFee=cast(round(sum(a.medfee_sumamt),2) as decimal(10,2)), " +
|
|
|
"fundPooling=cast(round(sum(a.hifp_pay),2) as decimal(10,2)), " +
|
|
|
+ "acctPay=cast(round(sum(a.acct_pay),2) as decimal(10,2)), " +
|
|
|
"bigIllFundPooling=cast(round(sum(a.hifmi_pay),2) as decimal(10,2)), " +
|
|
|
"civilServiceFund=cast(round(sum(a.cvlserv_pay),2) as decimal(10,2)), " +
|
|
|
"otherFunds=cast(round(sum(isnull(a.fund_pay_sumamt,0)-isnull(a.hifp_pay,0)-isnull(a.cvlserv_pay,0)-isnull(a.hifmi_pay,0)),2) as decimal(10,2)), " +
|
|
@@ -64,6 +66,7 @@ public interface YbStatDao {
|
|
|
"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.setl_id) as decimal(10,2)),2) as decimal(10,2)), " +
|
|
|
"totalFee=cast(round(sum(a.medfee_sumamt),2) as decimal(10,2)), " +
|
|
|
+ "acctPay=cast(round(sum(a.acct_pay),2) as decimal(10,2)), " +
|
|
|
"fundPooling=cast(round(sum(a.hifp_pay),2) as decimal(10,2)), " +
|
|
|
"bigIllFundPooling=cast(round(sum(a.hifmi_pay),2) as decimal(10,2)), " +
|
|
|
"civilServiceFund=cast(round(sum(a.cvlserv_pay),2) as decimal(10,2)), " +
|
|
@@ -85,6 +88,7 @@ public interface YbStatDao {
|
|
|
"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.setl_id) as decimal(10,2)),2) as decimal(10,2)), " +
|
|
|
"totalFee=cast(round(sum(a.medfee_sumamt),2) as decimal(10,2)), " +
|
|
|
+ "acctPay=cast(round(sum(a.acct_pay),2) as decimal(10,2)), " +
|
|
|
"fundPooling=cast(round(sum(a.hifp_pay),2) as decimal(10,2)), " +
|
|
|
"bigIllFundPooling=cast(round(sum(a.hifmi_pay),2) as decimal(10,2)), " +
|
|
|
"civilServiceFund=cast(round(sum(a.cvlserv_pay),2) as decimal(10,2)), " +
|
|
@@ -106,6 +110,7 @@ public interface YbStatDao {
|
|
|
"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.setl_id) as decimal(10,2)),2) as decimal(10,2)), " +
|
|
|
"totalFee=cast(round(sum(a.medfee_sumamt),2) as decimal(10,2)), " +
|
|
|
+ "acctPay=cast(round(sum(a.acct_pay),2) as decimal(10,2)), " +
|
|
|
"fundPooling=cast(round(sum(a.hifp_pay),2) as decimal(10,2)), " +
|
|
|
"bigIllFundPooling=cast(round(sum(a.hifmi_pay),2) as decimal(10,2)), " +
|
|
|
"civilServiceFund=cast(round(sum(a.cvlserv_pay),2) as decimal(10,2)), " +
|
|
@@ -222,4 +227,72 @@ public interface YbStatDao {
|
|
|
"</script>")
|
|
|
List<Map<String, Object>> selectBarChangeData(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType);
|
|
|
|
|
|
+ @Select("select count(a.setl_id) value, 0 id, '医保病人数' name " +
|
|
|
+ "from t_si_setlinfo a " +
|
|
|
+ "where a.revoked=0 and a.setl_type=#{setlType} and a.setl_time>=#{beginTime} and a.setl_time<=#{endTime} ")
|
|
|
+ TreeNodesResult getTreeRootResult(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType);
|
|
|
+
|
|
|
+ @Select("<script> " +
|
|
|
+ "select count(t.setl_id) value, 0 pid, rtrim(t.id) as id, rtrim(isnull(d.name, '其他')) name from " +
|
|
|
+ "(select a.setl_id, isnull(zy.small_dept, zya.small_dept) id " +
|
|
|
+ "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_actpatient zya on (zya.inpatient_no = a.pat_no and zya.admiss_times = a.times) " +
|
|
|
+ "where a.revoked=0 and a.setl_type=#{setlType} and a.setl_time>=#{beginTime} and a.setl_time<=#{endTime} " +
|
|
|
+ " ) t " +
|
|
|
+ "left join zy_dept_code d on d.code = t.id " +
|
|
|
+ "group by t.id, d.name " +
|
|
|
+ "order by count(t.setl_id) desc " +
|
|
|
+ "</script>")
|
|
|
+ List<TreeNodesResult> selectTreeSecondData(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType, @Param("insurType") String insurType);
|
|
|
+
|
|
|
+ @Select("<script> " +
|
|
|
+ "select count(t.setl_id) as value, rtrim(t.pid) as pid, rtrim(t.id) as id, rtrim(isnull(e.name, '其他')) as name from " +
|
|
|
+ "(select a.setl_id, isnull(zy.small_dept, zya.small_dept) pid, isnull(isnull(zy.refer_physician, zya.refer_physician), 9999) id " +
|
|
|
+ "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_actpatient zya on (zya.inpatient_no = a.pat_no and zya.admiss_times = a.times) " +
|
|
|
+ "where a.revoked=0 and a.setl_type=#{setlType} and a.setl_time>=#{beginTime} and a.setl_time<=#{endTime} " +
|
|
|
+ " ) t " +
|
|
|
+ "left join a_employee_mi e on e.code = t.id " +
|
|
|
+ "group by t.pid, t.id, e.name " +
|
|
|
+ "order by count(t.setl_id) desc " +
|
|
|
+ "</script>")
|
|
|
+ List<TreeNodesResult> selectTreeThirdData(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType, @Param("insurType") String insurType);
|
|
|
+
|
|
|
+ @Select("<script> " +
|
|
|
+ "select count(t.setl_id) as value, rtrim(t.uid) as uid, rtrim(t.pid) as pid, rtrim(isnull(t.medins_type, '其他')) as name from " +
|
|
|
+ "(select a.setl_id, a.medins_type, isnull(isnull(zy.refer_physician, zya.refer_physician), 9999) pid, " +
|
|
|
+ "isnull(isnull(zy.small_dept, zya.small_dept), 999) uid " +
|
|
|
+ "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_actpatient zya on (zya.inpatient_no = a.pat_no and zya.admiss_times = a.times) " +
|
|
|
+ "where a.revoked=0 and a.setl_type=#{setlType} and a.setl_time>=#{beginTime} and a.setl_time<=#{endTime} " +
|
|
|
+ " ) t " +
|
|
|
+ "group by t.uid, t.pid, t.medins_type " +
|
|
|
+ "order by count(t.setl_id) desc " +
|
|
|
+ "</script>")
|
|
|
+ List<TreeNodesResult> selectTreeFourthData(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType, @Param("insurType") String insurType);
|
|
|
+
|
|
|
+ @Select("<script> " +
|
|
|
+ "select count(t.setl_id) as value, rtrim(t.pid) as pid, rtrim(t.id) as id, rtrim(isnull(t.medins_type, '其他')) as insurName, rtrim(isnull(e.name, '其他')) as doctorName, rtrim(d.name) as deptName from " +
|
|
|
+ "(select a.setl_id, a.medins_type, isnull(zy.small_dept, zya.small_dept) pid, isnull(isnull(zy.refer_physician, zya.refer_physician), 9999) id " +
|
|
|
+ "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_actpatient zya on (zya.inpatient_no = a.pat_no and zya.admiss_times = a.times) " +
|
|
|
+ "where a.revoked=0 and a.setl_type=#{setlType} and a.setl_time>=#{beginTime} and a.setl_time<=#{endTime} " +
|
|
|
+ "<if test=\"deptCode != null and deptCode != '' \">" +
|
|
|
+ " and (zy.small_dept=#{deptCode} or zya.small_dept=#{deptCode}) " +
|
|
|
+ "</if> " +
|
|
|
+ "<if test=\"doctorId != null and doctorId != '' \">" +
|
|
|
+ " and (zy.refer_physician=#{doctorId} or zya.refer_physician=#{doctorId}) " +
|
|
|
+ "</if> ) t " +
|
|
|
+ "left join zy_dept_code d on d.code = t.pid " +
|
|
|
+ "left join a_employee_mi e on e.code = t.id " +
|
|
|
+ "group by t.pid, t.id, t.medins_type, d.name, e.name " +
|
|
|
+ "order by count(t.setl_id) desc " +
|
|
|
+ "</script>")
|
|
|
+ List<TreeNodesResult> selectTreeAllData(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("setlType") String setlType,
|
|
|
+ @Param("deptCode") String deptCode, @Param("doctorId") String doctorId, @Param("insurType") String insurType);
|
|
|
+
|
|
|
}
|