|
@@ -40,12 +40,11 @@ public interface ChargeListDao {
|
|
|
|
|
|
@Select("execute zy_receive_drug #{patNo},#{times},#{patNo},'0';" +
|
|
|
"execute zy_receive_one #{patNo},#{times},#{patNo},'0';")
|
|
|
- List<ChargeItem> receiveCharges(String patNo, int times);
|
|
|
+ void receiveCharges(String patNo, int times);
|
|
|
|
|
|
@Select("execute dbo.zy_cxtj_mxqd_new #{patNo},#{times}")
|
|
|
List<ChargeItem> selectChargeList(String patNo, int times);
|
|
|
|
|
|
-
|
|
|
@Select("<script>" +
|
|
|
"select " +
|
|
|
"code=case when isnull(nullif(serial,''),'00')='00' then " +
|
|
@@ -68,12 +67,40 @@ public interface ChargeListDao {
|
|
|
"(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} " +
|
|
|
+ "and trans_flag_yb!=2 and charge_amount!=0 " +
|
|
|
"<if test=\"ledgerSn != null \">" +
|
|
|
- "and ledger_sn=#{ledgerSn} and charge_amount!=0 " +
|
|
|
+ "and ledger_sn=#{ledgerSn} " +
|
|
|
"</if>" +
|
|
|
- "and trans_flag_yb!=2 " +
|
|
|
"</script>")
|
|
|
- List<ChargeItem> getChargeList(PatOverview overview);
|
|
|
+ List<ChargeItem> getChargeListWithChargeDate(PatOverview overview);
|
|
|
+
|
|
|
+ @Select("select " +
|
|
|
+ "code,name,specification,unit,price,billItemCode,execDept, " +
|
|
|
+ "quantity=sum(quantity),cost=sum(cost) " +
|
|
|
+ "from (select * from ( " +
|
|
|
+ "select code=case when isnull(nullif(a.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(a.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(a.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(a.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(a.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} " +
|
|
|
+ "and trans_flag_yb!=2 and charge_amount!=0) temp) res group by " +
|
|
|
+ "code, name, specification, unit, price, billItemCode, execDept ")
|
|
|
+ List<ChargeItem> getChargeListWithoutChargeDate(PatOverview overview);
|
|
|
|
|
|
@Select("select count(1) from zy_actpatient where inpatient_no=#{patNo} and admiss_times=#{times}")
|
|
|
Integer isDischargedPatients(PatOverview overview);
|