|
@@ -70,29 +70,32 @@ public interface IllegalChargesAnalysisDao {
|
|
|
@Param("end") String end,
|
|
|
@Param("code") String code);
|
|
|
|
|
|
- @Select("select rtrim(inpatient_no) as inpatientNo,admiss_times, " +
|
|
|
- "name=(select rtrim(name) from a_patient_mi where a_patient_mi.inpatient_no=a.inpatient_no), " +
|
|
|
- "responceType=(select rtrim(responce_type) from yb_zy_review_record where yb_zy_review_record.inpatient_no=" +
|
|
|
- "a.inpatient_no and yb_zy_review_record.admiss_times=a.admiss_times), " +
|
|
|
- "deptName=(select rtrim(name) from zd_unit_code where code=a.ward_code), " +
|
|
|
- "wardName=(select rtrim(name) from zd_unit_code where code=a.dept_code), " +
|
|
|
- "diag=(select rtrim(dis_diag_comment) from zy_dis_diag_yb where zy_dis_diag_yb.inpatient_no=a.inpatient_no and " +
|
|
|
- "zy_dis_diag_yb.admiss_times=a.admiss_times and dis_diag_no=1), " +
|
|
|
- "rtrim(charge_code_mx) as chargeCode, " +
|
|
|
- "chargeName=rtrim(isnull((select name from zd_charge_item where code=charge_code_mx)," +
|
|
|
- "(select top 1 name from yp_zd_dict where code=charge_code_mx))), " +
|
|
|
- "charge_fee,charge_amount from zy_detail_charge a " +
|
|
|
+ @Select("select *, " +
|
|
|
+ "name=(select rtrim(name) from a_patient_mi where inpatient_no=temp.inpatient_no), " +
|
|
|
+ "responceType=(select rtrim(responce_type) from yb_zy_review_record where inpatient_no= " +
|
|
|
+ "temp.inpatient_no and admiss_times=temp.admiss_times), " +
|
|
|
+ "wardName=(select rtrim(name) from zd_unit_code where code=temp.ward_code), " +
|
|
|
+ "diag=(select rtrim(dis_diag_comment) from zy_dis_diag_yb where zy_dis_diag_yb.inpatient_no=temp.inpatient_no and " +
|
|
|
+ "zy_dis_diag_yb.admiss_times=temp.admiss_times and dis_diag_no=1), " +
|
|
|
+ "chargeName=rtrim(isnull((select name from zd_charge_item where code=temp.chargeCode), " +
|
|
|
+ "(select top 1 name from yp_zd_dict where code=temp.chargeCode))) " +
|
|
|
+ "from (select inpatient_no,admiss_times,rtrim(charge_code_mx) as chargeCode,ward_code, " +
|
|
|
+ "convert(varchar(10), charge_date, 21) as chargeDay, sum(charge_amount) as chargeAmount, " +
|
|
|
+ "sum((charge_fee)) as chargeFee from zy_detail_charge " +
|
|
|
"where charge_fee>0 and isnull(trans_flag_yb,0)!=2 and charge_date>=#{start} and " +
|
|
|
- "charge_date<=#{end} and charge_code_mx=#{code}")
|
|
|
+ "charge_date<=#{end} and charge_code_mx=#{code} group by " +
|
|
|
+ "inpatient_no, admiss_times, charge_code_mx,ward_code, convert(varchar(10), charge_date, 21)) " +
|
|
|
+ "temp where chargeAmount>#{num} ")
|
|
|
List<IllegalChargeData> selectChargeDataForOverLimit(@Param("start") String start,
|
|
|
@Param("end") String end,
|
|
|
- @Param("code") String code);
|
|
|
+ @Param("code") String code,
|
|
|
+ @Param("num") int num);
|
|
|
|
|
|
|
|
|
@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," +
|
|
|
- " a.responce_type " +
|
|
|
+ "(select name from zd_unit_code where code=isnull(a.small_dept,a.admiss_dept)) dept_name," +
|
|
|
+ "a.responce_type " +
|
|
|
"from zy_inactpatient a ,zy_inactpatient b " +
|
|
|
"where a.inpatient_no=b.inpatient_no" +
|
|
|
" and a.admiss_times=b.admiss_times+1" +
|