|  | @@ -88,15 +88,32 @@ public interface IllegalChargesAnalysisDao {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Select("<script>" +
 | 
	
		
			
				|  |  | -            "select rtrim(a.inpatient_no) inpatient_no,rtrim(a.name) name,a.admiss_times," +
 | 
	
		
			
				|  |  | -            "a.admiss_date,b.dis_date,DATEDIFF(day,b.dis_date,a.admiss_date) differ_date," +
 | 
	
		
			
				|  |  | -            "(select name from zd_unit_code where code=isnull(a.small_dept,a.admiss_dept)) dept_name," +
 | 
	
		
			
				|  |  | -            "responce_type_name = (select name from zy_zd_responce_type where a.responce_type = zy_zd_responce_type.code) " +
 | 
	
		
			
				|  |  | -            "from zy_inactpatient a ,zy_inactpatient b " +
 | 
	
		
			
				|  |  | -            "where a.inpatient_no=b.inpatient_no" +
 | 
	
		
			
				|  |  | -            "  and a.admiss_times=b.admiss_times+1" +
 | 
	
		
			
				|  |  | -            "  and a.inpatient_no not like 'JT%'" +
 | 
	
		
			
				|  |  | -            "  and DATEDIFF(day,b.dis_date,a.admiss_date)<2 " +
 | 
	
		
			
				|  |  | +            "select                   rtrim(a.inpatient_no)                              inpatient_no, " +
 | 
	
		
			
				|  |  | +            "                         rtrim(a.name)                                      name, " +
 | 
	
		
			
				|  |  | +            "                         a.admiss_times, " +
 | 
	
		
			
				|  |  | +            "                         a.admiss_date, " +
 | 
	
		
			
				|  |  | +            "                         b.dis_date, " +
 | 
	
		
			
				|  |  | +            "                         DATEDIFF(day, " +
 | 
	
		
			
				|  |  | +            "                                  b.dis_date, " +
 | 
	
		
			
				|  |  | +            "                                  a.admiss_date)                            differ_date, " +
 | 
	
		
			
				|  |  | +            "                         (select name " +
 | 
	
		
			
				|  |  | +            "                          from zd_unit_code " +
 | 
	
		
			
				|  |  | +            "                          where code = isnull(a.small_dept, a.admiss_dept)) dept_name, " +
 | 
	
		
			
				|  |  | +            "    responce_type_name = (select name " +
 | 
	
		
			
				|  |  | +            "                          from zy_zd_responce_type " +
 | 
	
		
			
				|  |  | +            "                          where a.responce_type = zy_zd_responce_type.code), " +
 | 
	
		
			
				|  |  | +            "                         c.dis_diag, " +
 | 
	
		
			
				|  |  | +            "                         c.dis_diag_comment " +
 | 
	
		
			
				|  |  | +            "from zy_actpatient a, " +
 | 
	
		
			
				|  |  | +            "     zy_inactpatient b, " +
 | 
	
		
			
				|  |  | +            "     ba_first_page1 c " +
 | 
	
		
			
				|  |  | +            "where a.inpatient_no = b.inpatient_no " +
 | 
	
		
			
				|  |  | +            "  and a.admiss_times = b.admiss_times + 1 " +
 | 
	
		
			
				|  |  | +            "  and a.inpatient_no not like 'JT%' " +
 | 
	
		
			
				|  |  | +            "  and DATEDIFF(day, b.dis_date, a.admiss_date) < 2 " +
 | 
	
		
			
				|  |  | +            "  and a.inpatient_no = c.inpatient_no " +
 | 
	
		
			
				|  |  | +            "  and a.admiss_times = c.admiss_times " +
 | 
	
		
			
				|  |  | +            "  and c.dis_diag_no = 1 " +
 | 
	
		
			
				|  |  |              "<if test=\"start !=null and start != '' \">" +
 | 
	
		
			
				|  |  |              " and a.admiss_date >= #{start} and a.admiss_date <= #{end} " +
 | 
	
		
			
				|  |  |              "</if>" +
 | 
	
	
		
			
				|  | @@ -106,24 +123,49 @@ public interface IllegalChargesAnalysisDao {
 | 
	
		
			
				|  |  |              "#{item}" +
 | 
	
		
			
				|  |  |              "</foreach>" +
 | 
	
		
			
				|  |  |              "</if>" +
 | 
	
		
			
				|  |  | -            "order by a.inpatient_no,a.admiss_times" +
 | 
	
		
			
				|  |  | +            "union " +
 | 
	
		
			
				|  |  | +            "select                   rtrim(a.inpatient_no)                              inpatient_no, " +
 | 
	
		
			
				|  |  | +            "                         rtrim(a.name)                                      name, " +
 | 
	
		
			
				|  |  | +            "                         a.admiss_times, " +
 | 
	
		
			
				|  |  | +            "                         a.admiss_date, " +
 | 
	
		
			
				|  |  | +            "                         b.dis_date, " +
 | 
	
		
			
				|  |  | +            "                         DATEDIFF(day, " +
 | 
	
		
			
				|  |  | +            "                                  b.dis_date, " +
 | 
	
		
			
				|  |  | +            "                                  a.admiss_date)                            differ_date, " +
 | 
	
		
			
				|  |  | +            "                         (select name " +
 | 
	
		
			
				|  |  | +            "                          from zd_unit_code " +
 | 
	
		
			
				|  |  | +            "                          where code = isnull(a.small_dept, a.admiss_dept)) dept_name, " +
 | 
	
		
			
				|  |  | +            "    responce_type_name = (select name " +
 | 
	
		
			
				|  |  | +            "                          from zy_zd_responce_type " +
 | 
	
		
			
				|  |  | +            "                          where a.responce_type = zy_zd_responce_type.code), " +
 | 
	
		
			
				|  |  | +            "                         c.dis_diag, " +
 | 
	
		
			
				|  |  | +            "                         c.dis_diag_comment " +
 | 
	
		
			
				|  |  | +            "from zy_inactpatient a, " +
 | 
	
		
			
				|  |  | +            "     zy_inactpatient b, " +
 | 
	
		
			
				|  |  | +            "     ba_first_page1 c " +
 | 
	
		
			
				|  |  | +            "where a.inpatient_no = b.inpatient_no " +
 | 
	
		
			
				|  |  | +            "  and a.admiss_times = b.admiss_times + 1 " +
 | 
	
		
			
				|  |  | +            "  and a.inpatient_no not like 'JT%' " +
 | 
	
		
			
				|  |  | +            "  and DATEDIFF(day, b.dis_date, a.admiss_date) < 2 " +
 | 
	
		
			
				|  |  | +            "  and a.inpatient_no = c.inpatient_no " +
 | 
	
		
			
				|  |  | +            "  and a.admiss_times = c.admiss_times " +
 | 
	
		
			
				|  |  | +            "  and c.dis_diag_no = 1 " +
 | 
	
		
			
				|  |  | +            "<if test=\"start !=null and start != '' \">" +
 | 
	
		
			
				|  |  | +            " and a.admiss_date >= #{start} and a.admiss_date <= #{end} " +
 | 
	
		
			
				|  |  | +            "</if>" +
 | 
	
		
			
				|  |  | +            "<if test=\"responces.size > 0\" >" +
 | 
	
		
			
				|  |  | +            "and a.responce_type in " +
 | 
	
		
			
				|  |  | +            "<foreach collection='responces' item='item' index='index' open='(' close=')' separator=','>" +
 | 
	
		
			
				|  |  | +            "#{item}" +
 | 
	
		
			
				|  |  | +            "</foreach>" +
 | 
	
		
			
				|  |  | +            "</if>" +
 | 
	
		
			
				|  |  | +            "order by a.inpatient_no, " +
 | 
	
		
			
				|  |  | +            "         a.admiss_times" +
 | 
	
		
			
				|  |  |              "</script>")
 | 
	
		
			
				|  |  |      List<IllegalChargeData> queryHuanZheLiangCiRuYuanRiQi(@Param("start") String start,
 | 
	
		
			
				|  |  |                                                            @Param("end") String end,
 | 
	
		
			
				|  |  |                                                            @Param("responces") List<String> responces);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    @Select("<script>" +
 | 
	
		
			
				|  |  | -            "select rtrim(inpatient_no) inpatient_no,admiss_times,dis_diag_comment,dis_diag from ba_first_page1 where " +
 | 
	
		
			
				|  |  | -            "inpatient_no in  " +
 | 
	
		
			
				|  |  | -            "<foreach collection='inpatientNoList' item='item' index='index' open='(' close=')' separator=','>" +
 | 
	
		
			
				|  |  | -            "#{item.inpatientNo}" +
 | 
	
		
			
				|  |  | -            "</foreach>" +
 | 
	
		
			
				|  |  | -            " and dis_diag_no = 1" +
 | 
	
		
			
				|  |  | -            "</script>")
 | 
	
		
			
				|  |  | -    List<IllegalChargeData> queryZhenDuan(@Param("inpatientNoList") List<IllegalChargeData> inpatientNoList);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      @Select("select inpatient_no, " +
 | 
	
		
			
				|  |  |              "       rtrim(name) name, " +
 | 
	
		
			
				|  |  |              "       dept_name   = (select rtrim(name) name from zd_unit_code where code = small_dept), " +
 |