|
@@ -75,26 +75,27 @@ public interface TransferInOfExpensesDao {
|
|
|
" b.receipt_sn=#{serialNo} and " +
|
|
|
" a.charge_item_code=c.code and " +
|
|
|
" isnull(a.group_no,'00')='00' " +
|
|
|
- "union all " +
|
|
|
+ "union " +
|
|
|
"select patient_name =rtrim(a.name), " +
|
|
|
" item_name = (select name from yp_zd_dict where yp_zd_dict.code=c.charge_code and yp_zd_dict.serial=c.serial),/*c.drugname,*/ " +
|
|
|
" charge_amount = a.quantity, " +
|
|
|
" self_flag=a.self_flag, " +
|
|
|
" separate_flag = (select separate_flag from yp_zd_dict where yp_zd_dict.code=c.charge_code and yp_zd_dict.serial=c.serial), " +
|
|
|
" suppress_flag = (select suprice_flag from yp_zd_dict where yp_zd_dict.code=c.charge_code and yp_zd_dict.serial=c.serial), " +
|
|
|
- " charge_code = a.charge_item_code, " +
|
|
|
+ " charge_code = (select charge_code from zy_bill_item where zy_bill_item.code = e.bill_item_zy), " +
|
|
|
" charge_code_mx = a.charge_item_code, " +
|
|
|
" serial = a.serial, " +
|
|
|
" group_no = a.group_no, " +
|
|
|
" price = a.unit_price, " +
|
|
|
- " charge_fee=a.unit_price * a.quantity * isnull(a.drug_win,1), " +
|
|
|
+ " charge_fee= Convert(decimal(18,2),a.unit_price * a.quantity * isnull(a.drug_win,1)) , " +
|
|
|
" check_flag='0', " +
|
|
|
" warn_dept =a.warn_dept, " +
|
|
|
" doctor_code = a.doctor_code, " +
|
|
|
" bill_item_code = rtrim(a.bill_item_code), " +
|
|
|
" exec_dept = a.exec_dept " +
|
|
|
- "from ${tableName} a,mz_receipt_serial b,yp_base_yf c " +
|
|
|
+ "from ${tableName} a,mz_receipt_serial b,yp_base_yf c ,view_yp_zd_dict e " +
|
|
|
"where a.patient_id = b.patient_id and " +
|
|
|
+ " e.code = a.charge_item_code and a.serial = e.serial and" +
|
|
|
" a.times = b.times and " +
|
|
|
" a.receipt_no = b.receipt_no and " +
|
|
|
" a.serial_no= b.serial_no and " +
|
|
@@ -180,7 +181,7 @@ public interface TransferInOfExpensesDao {
|
|
|
"gen_time,charge_code_mx,serial,doctor_code,trans_flag_yb,refer_physician,consult_physician,exec_unit,zy_serial_no) VALUES " +
|
|
|
"<foreach collection='list' item='fee' separator=',' open='' close=''>" +
|
|
|
"(#{info.inpatientNo}, #{info.admissTimes}, #{info.ledgerSn}, #{fee.detailSn}, getDate(), #{info.staffId}, " +
|
|
|
- "#{fee.chargeCode}, 0, 2, #{fee.chargeAmount}, cast(#{fee.chargeFee,jdbcType=DECIMAL} as decimal(14,5)), #{info.ward}, #{info.dept}, 6, " +
|
|
|
+ "#{fee.chargeCode}, 0, 2, #{fee.chargeAmount}, cast(#{fee.chargeFee,jdbcType=DECIMAL} as decimal(14,5)), #{info.zkWard}, #{info.dept}, 6, " +
|
|
|
"'',getDate(), #{fee.chargeCodeMx},#{fee.serial},#{fee.doctorCode},0,#{info.referPhysician}," +
|
|
|
"#{info.consultPhysician},#{info.reqExecUnit},#{info.zySerialNo})" +
|
|
|
"</foreach>" +
|