|
@@ -39,15 +39,44 @@ public interface ChargeListDao {
|
|
|
BriefPatInfo selectBriefPatInfo(String patNo, int times, String table);
|
|
|
|
|
|
@Select("execute zy_receive_drug #{patNo},#{times},#{patNo},'0';" +
|
|
|
- "execute zy_receive_one #{patNo},#{times},#{patNo},'0';" +
|
|
|
- "execute dbo.zy_cxtj_mxqd_new #{patNo},#{times}")
|
|
|
- List<ChargeItem> selectChargeList(String patNo, int times);
|
|
|
+ "execute zy_receive_one #{patNo},#{times},#{patNo},'0';")
|
|
|
+ List<ChargeItem> receiveCharges(String patNo, int times);
|
|
|
|
|
|
@Select("execute dbo.zy_cxtj_mxqd_new #{patNo},#{times}")
|
|
|
- List<ChargeItem> selectChargeList2(String patNo, int times);
|
|
|
+ List<ChargeItem> selectChargeList(String patNo, int times);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ "select " +
|
|
|
+ "code=case when isnull(nullif(serial,''),'00')='00' then " +
|
|
|
+ "(select national_code from zd_charge_item d where d.code=charge_code_mx) else " +
|
|
|
+ "(select max(national_code) from yp_zd_dict d where d.code=charge_code_mx) end, " +
|
|
|
+ "name=case when isnull(nullif(serial,''),'00')='00' then " +
|
|
|
+ "(select name from zd_charge_item d where d.code=charge_code_mx) else " +
|
|
|
+ "(select max(name) from yp_zd_dict d where d.code=charge_code_mx) end, " +
|
|
|
+ "specification=case when isnull(nullif(serial,''),'00')='00' then null else " +
|
|
|
+ "(select max(specification) from yp_zd_dict d where d.code=charge_code_mx) end, " +
|
|
|
+ "unit=case when isnull(nullif(serial,''),'00')='00' then " +
|
|
|
+ "(select d.charge_unit from zd_charge_item d where d.code=charge_code_mx) else " +
|
|
|
+ "(select name from yp_zd_unit e where e.code= " +
|
|
|
+ "(select d.pack_unit from yp_zd_dict d where d.code=charge_code_mx and d.serial=a.serial)) end, " +
|
|
|
+ "price=abs(round(charge_fee/case when charge_amount=0 then 1 else charge_amount end,2)), " +
|
|
|
+ "quantity=a.charge_amount,cost=charge_fee, " +
|
|
|
+ "execDept=(select d.name from zd_unit_code d where d.code= " +
|
|
|
+ "(case when isnull(exec_unit,'')='' then ward_code else exec_unit end)), " +
|
|
|
+ "billItemCode=case when isnull(nullif(serial,''),'00')='00' then " +
|
|
|
+ "(select d.bill_item_zy from zd_charge_item d where d.code=charge_code_mx) else " +
|
|
|
+ "(select max(d.bill_item_zy) from yp_zd_dict d where d.code=charge_code_mx) end " +
|
|
|
+ "from zy_detail_charge a where inpatient_no=#{patNo} and admiss_times=#{times} " +
|
|
|
+ "<if test=\"ledgerSn != null \">" +
|
|
|
+ "and ledger_sn=#{ledgerSn} and charge_amount!=0 " +
|
|
|
+ "</if>" +
|
|
|
+ "and trans_flag_yb!=2 " +
|
|
|
+ "</script>")
|
|
|
+ List<ChargeItem> getChargeList(PatOverview overview);
|
|
|
|
|
|
@Select("select count(1) from zy_actpatient where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
- Integer isDischargedPatients(String patNo, int times);
|
|
|
+ Integer isDischargedPatients(PatOverview overview);
|
|
|
|
|
|
@Select("select count(1) from zy_actpatient where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
int selectInhospCount(String patNo, int times);
|