|
@@ -89,7 +89,8 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
* @param chargeCode 编码
|
|
|
* @return 返回查询的数据
|
|
|
*/
|
|
|
- @Select("select * from (" +
|
|
|
+ @Select("<script>" +
|
|
|
+ "select * from (" +
|
|
|
"SELECT " +
|
|
|
" rtrim(a.inpatient_no) patient,a.admiss_times times,rtrim(b.name) name,b.social_no social_no,b.employer_tel phone,c.admiss_date,c.dis_date,a.charge_date charge_date, " +
|
|
|
" (select name from zd_unit_code where code=c.small_dept) dept, " +
|
|
@@ -101,7 +102,10 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
" and a.inpatient_no=b.inpatient_no " +
|
|
|
" and a.inpatient_no=c.inpatient_no " +
|
|
|
" and a.admiss_times=c.admiss_times " +
|
|
|
- " and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
+ " and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
+ "<if test=\"dept != '' and dept !=null \">" +
|
|
|
+ " and a.exec_unit = #{dept} " +
|
|
|
+ "</if>" +
|
|
|
"group by charge_code_mx,a.inpatient_no,a.admiss_times,b.name,b.social_no,b.employer_tel,c.admiss_date,c.dis_date,c.small_dept,a.exec_unit,c.responce_type,a.charge_date " +
|
|
|
"union all " +
|
|
|
"SELECT " +
|
|
@@ -115,7 +119,10 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
" and a.inpatient_no=b.inpatient_no " +
|
|
|
" and a.inpatient_no=c.inpatient_no " +
|
|
|
" and a.admiss_times=c.admiss_times " +
|
|
|
- " and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
+ " and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
+ "<if test=\"dept != '' and dept !=null \">" +
|
|
|
+ " and a.exec_unit = #{dept} " +
|
|
|
+ "</if>" +
|
|
|
"group by charge_code_mx,a.inpatient_no,a.admiss_times,b.name,b.social_no,b.employer_tel,c.admiss_date,c.dis_date,c.small_dept,a.exec_unit,c.responce_type,a.charge_date " +
|
|
|
"union all " +
|
|
|
" select rtrim(a.patient_id) patient,a.times times,rtrim(b.name) name ,b.social_no social_no,b.phone_no phone," +
|
|
@@ -127,11 +134,16 @@ public interface QueryDrugsAndProjectsDao {
|
|
|
"where a.patient_id = b.patient_id " +
|
|
|
"and a.times = b.times " +
|
|
|
"and charge_item_code = #{chargeCode} " +
|
|
|
- "and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
- "group by charge_item_code,a.patient_id,a.times,b.name,social_no,phone_no,charge_date,exec_dept,a.warn_dept) temp")
|
|
|
+ "and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
+ "<if test=\"dept != '' and dept !=null \">" +
|
|
|
+ "and a.exec_dept = #{dept} " +
|
|
|
+ "</if>" +
|
|
|
+ "group by charge_item_code,a.patient_id,a.times,b.name,social_no,phone_no,charge_date,exec_dept,a.warn_dept) temp" +
|
|
|
+ "</script>")
|
|
|
List<QueryDrugsAndProjects> chaXunXiangMuHuoYaoPinJuTiXinXi(@Param("startTime") String startTime,
|
|
|
@Param("endTime") String endTime,
|
|
|
- @Param("chargeCode") String chargeCode);
|
|
|
+ @Param("chargeCode") String chargeCode,
|
|
|
+ @Param("dept") String dept);
|
|
|
|
|
|
|
|
|
/**
|