|
@@ -299,24 +299,29 @@ public interface YbStatDao {
|
|
|
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 count(t.setl_id) as rs, rtrim(isnull(t.medins_type, '其他')) as insurName, rtrim(isnull(e.name, '其他')) as doctorName, rtrim(isnull(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 test=\"insurType != null and insurType != '' \"> " +
|
|
|
+ " and a.medins_type=#{insurType} " +
|
|
|
"</if> " +
|
|
|
- "<if test=\"doctorId != null and doctorId != '' \">" +
|
|
|
- " and (zy.refer_physician=#{doctorId} or zya.refer_physician=#{doctorId}) " +
|
|
|
- "</if> ) t " +
|
|
|
+ ") t " +
|
|
|
"left join zy_dept_code d on d.code = t.pid " +
|
|
|
"left join a_employee_mi e on e.code = t.id " +
|
|
|
+ "where 1=1 " +
|
|
|
+ "<if test=\"dept != null and dept != '' \"> " +
|
|
|
+ " and rtrim(d.name)=#{dept} " +
|
|
|
+ "</if> " +
|
|
|
+ "<if test=\"doctor != null and doctor != '' \"> " +
|
|
|
+ " and rtrim(e.name)=#{doctor} " +
|
|
|
+ "</if> " +
|
|
|
"group by t.pid, t.id, t.medins_type, d.name, e.name " +
|
|
|
- "order by count(t.setl_id) desc " +
|
|
|
+ "order by d.name, e.name, 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);
|
|
|
+ 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);
|
|
|
|
|
|
}
|