|
|
@@ -111,7 +111,7 @@ public interface MzChargeDetailMapper {
|
|
|
"instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,",
|
|
|
"rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
|
|
|
"dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
|
|
|
- "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
|
|
|
+ "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag ",
|
|
|
"from dbo.mz_charge_detail WITH(NOLOCK) where pay_mark=#{payMark,jdbcType=CHAR} and patient_id =#{patientId,jdbcType=CHAR} and times = #{times,jdbcType=INTEGER} and receipt_no=#{receiptNo,jdbcType=INTEGER}",
|
|
|
"<choose>",
|
|
|
"<when test='billItemCode==3'>",
|
|
|
@@ -253,7 +253,7 @@ public interface MzChargeDetailMapper {
|
|
|
"instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,",
|
|
|
"rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
|
|
|
"dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
|
|
|
- "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
|
|
|
+ "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag ",
|
|
|
"from dbo.mz_charge_detail WITH(NOLOCK) where patient_id =#{patientId,jdbcType=CHAR} and times =#{times} and pay_mark = 5 ",
|
|
|
"</script>"})
|
|
|
List<MzChargeDetail> selectNotPayMzChargeDetailByPatientId(@Param("patientId") String patientId, @Param("times") Integer times);
|
|
|
@@ -332,7 +332,7 @@ public interface MzChargeDetailMapper {
|
|
|
"instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,",
|
|
|
"rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
|
|
|
"dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
|
|
|
- "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
|
|
|
+ "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag ",
|
|
|
"from dbo.${tableName} WITH(NOLOCK) where patient_id =#{patientId,jdbcType=CHAR} and times =#{times,jdbcType=INTEGER}" +
|
|
|
"<choose>" +
|
|
|
"<when test='payMark!=null and payMark ==0 '>",
|
|
|
@@ -371,7 +371,7 @@ public interface MzChargeDetailMapper {
|
|
|
"audit_code,gongnks_flag,print_flag,confirm_flag,warn_dept,jz_flag,group_order,cash_id,doctor_code,supply_code,frequency,drug_quan,drug_unit,doctor_flag,inject_res,inject_times," +
|
|
|
"confirm_zs,real_no,windows_no_yf,ybbx_flag,tc_no,tc_name,detail_flag,gl_percent,order_type,supply_no,instruction_code,instruction_text,order_days,pay_self,try_flag,req_yj," +
|
|
|
"req_no,group_type,order_bill,charge_bill_code,self_flag,responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,cy_jssm," +
|
|
|
- "dept_no,gl_percent_ft,yb_zf_flag,orig_price,try_result,supply_exec,cy_dj,receive_flag,chequ_type,print_flag_yj,confirm_flag_qx,group_id) " +
|
|
|
+ "dept_no,gl_percent_ft,yb_zf_flag,orig_price,try_result,supply_exec,cy_dj,receive_flag,chequ_type,print_flag_yj,confirm_flag_qx,group_id,hosp_appr_flag) " +
|
|
|
" VALUES (#{patientId,jdbcType=CHAR},#{times,jdbcType=INTEGER},#{receiptNo,jdbcType=SMALLINT},#{orderNo,jdbcType=TINYINT},#{itemNo,jdbcType=TINYINT}," +
|
|
|
"#{chargeItemCode,jdbcType=CHAR},#{billItemCode,jdbcType=CHAR},#{quantity,jdbcType=DOUBLE},#{unitPriceStr,jdbcType=DECIMAL},#{payMark,jdbcType=CHAR}," +
|
|
|
"#{serial,jdbcType=CHAR},#{chargeItemType,jdbcType=CHAR},#{countryFlag,jdbcType=CHAR},#{drugFlag,jdbcType=CHAR},#{serialNo,jdbcType=INTEGER},#{name,jdbcType=CHAR}," +
|
|
|
@@ -386,7 +386,7 @@ public interface MzChargeDetailMapper {
|
|
|
"#{chargeBillCode,jdbcType=VARCHAR},#{selfFlag,jdbcType=CHAR},#{responceType,jdbcType=CHAR},#{decAmount,jdbcType=DECIMAL},#{backSerial,jdbcType=INTEGER},#{inputTime,jdbcType=TIMESTAMP}," +
|
|
|
"#{cyMtjs,jdbcType=SMALLINT},#{cyJsl,jdbcType=SMALLINT},#{cyZql,jdbcType=SMALLINT},#{cyFj,jdbcType=SMALLINT},#{cyFfcs,jdbcType=SMALLINT},#{cyFysm,jdbcType=SMALLINT}," +
|
|
|
"#{supplyAmount,jdbcType=SMALLINT},#{cyJssm,jdbcType=CHAR},#{deptNo,jdbcType=VARCHAR},#{glPercentFt,jdbcType=DECIMAL},#{ybZfFlag,jdbcType=CHAR},#{origPriceStr,jdbcType=DECIMAL}," +
|
|
|
- "#{tryResult,jdbcType=CHAR},#{supplyExec,jdbcType=CHAR},#{cyDj,jdbcType=CHAR},#{receiveFlag,jdbcType=CHAR},#{chequType,jdbcType=CHAR},#{printFlagYj,jdbcType=CHAR},#{confirmFlagQx,jdbcType=CHAR},#{groupId,jdbcType=CHAR}) ")
|
|
|
+ "#{tryResult,jdbcType=CHAR},#{supplyExec,jdbcType=CHAR},#{cyDj,jdbcType=CHAR},#{receiveFlag,jdbcType=CHAR},#{chequType,jdbcType=CHAR},#{printFlagYj,jdbcType=CHAR},#{confirmFlagQx,jdbcType=CHAR},#{groupId,jdbcType=CHAR},#{hospApprFlag,jdbcType=VARCHAR}) ")
|
|
|
int insertMzChargeDetail(MzChargeDetail mzChargeDetail);
|
|
|
|
|
|
|
|
|
@@ -403,7 +403,7 @@ public interface MzChargeDetailMapper {
|
|
|
"audit_code,gongnks_flag,print_flag,confirm_flag,warn_dept,jz_flag,group_order,cash_id,doctor_code,supply_code,frequency,drug_quan,drug_unit,doctor_flag,inject_res,inject_times,",
|
|
|
"confirm_zs,real_no,windows_no_yf,ybbx_flag,tc_no,tc_name,detail_flag,gl_percent,order_type,supply_no,instruction_code,instruction_text,order_days,pay_self,try_flag,req_yj,",
|
|
|
"req_no,group_type,order_bill,charge_bill_code,self_flag,responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,cy_jssm,",
|
|
|
- "dept_no,gl_percent_ft,yb_zf_flag,orig_price,try_result,supply_exec,cy_dj,receive_flag,chequ_type,print_flag_yj,confirm_flag_qx,group_id) VALUES ",
|
|
|
+ "dept_no,gl_percent_ft,yb_zf_flag,orig_price,try_result,supply_exec,cy_dj,receive_flag,chequ_type,print_flag_yj,confirm_flag_qx,group_id,hosp_appr_flag) VALUES ",
|
|
|
"<foreach collection='mzChargeDetails' item='item' index='index' separator=','>",
|
|
|
" (#{item.patientId,jdbcType=CHAR},#{item.times,jdbcType=INTEGER},#{item.receiptNo,jdbcType=SMALLINT},#{item.orderNo,jdbcType=TINYINT},#{item.itemNo,jdbcType=TINYINT},",
|
|
|
"#{item.chargeItemCode,jdbcType=CHAR},#{item.billItemCode,jdbcType=CHAR},#{item.quantity,jdbcType=DOUBLE},#{item.unitPriceStr,jdbcType=DECIMAL},#{item.payMark,jdbcType=CHAR},",
|
|
|
@@ -419,7 +419,7 @@ public interface MzChargeDetailMapper {
|
|
|
"#{item.chargeBillCode,jdbcType=VARCHAR},#{item.selfFlag,jdbcType=CHAR},#{item.responceType,jdbcType=CHAR},#{item.decAmount,jdbcType=DECIMAL},#{item.backSerial,jdbcType=INTEGER},#{item.inputTime,jdbcType=TIMESTAMP},",
|
|
|
"#{item.cyMtjs,jdbcType=SMALLINT},#{item.cyJsl,jdbcType=SMALLINT},#{item.cyZql,jdbcType=SMALLINT},#{item.cyFj,jdbcType=SMALLINT},#{item.cyFfcs,jdbcType=SMALLINT},#{item.cyFysm,jdbcType=SMALLINT},",
|
|
|
"#{item.supplyAmount,jdbcType=SMALLINT},#{item.cyJssm,jdbcType=CHAR},#{item.deptNo,jdbcType=VARCHAR},#{item.glPercentFt,jdbcType=DECIMAL},#{item.ybZfFlag,jdbcType=CHAR},#{item.origPriceStr,jdbcType=DECIMAL},",
|
|
|
- "#{item.tryResult,jdbcType=CHAR},#{item.supplyExec,jdbcType=CHAR},#{item.cyDj,jdbcType=CHAR},#{item.receiveFlag,jdbcType=CHAR},#{item.chequType,jdbcType=CHAR},#{item.printFlagYj,jdbcType=CHAR},#{item.confirmFlagQx,jdbcType=CHAR},#{item.groupId,jdbcType=CHAR}) ",
|
|
|
+ "#{item.tryResult,jdbcType=CHAR},#{item.supplyExec,jdbcType=CHAR},#{item.cyDj,jdbcType=CHAR},#{item.receiveFlag,jdbcType=CHAR},#{item.chequType,jdbcType=CHAR},#{item.printFlagYj,jdbcType=CHAR},#{item.confirmFlagQx,jdbcType=CHAR},#{item.groupId,jdbcType=CHAR},#{item.hospApprFlag,jdbcType=VARCHAR}) ",
|
|
|
"</foreach>",
|
|
|
"</script>"
|
|
|
})
|
|
|
@@ -568,7 +568,7 @@ public interface MzChargeDetailMapper {
|
|
|
"instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,",
|
|
|
"rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
|
|
|
"dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
|
|
|
- "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
|
|
|
+ "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag ",
|
|
|
"from dbo.mz_charge_detail WITH(NOLOCK) where patient_id =#{patientId,jdbcType=CHAR} and pay_mark=0 and times =#{times} and receipt_no =#{receiptNo} ",
|
|
|
"</script>"})
|
|
|
List<MzChargeDetail> selectJiZhangDetails(@Param(value = "patientId") String patientId, @Param("times") Integer times, @Param("receiptNo") Integer receiptNo);
|
|
|
@@ -840,7 +840,7 @@ public interface MzChargeDetailMapper {
|
|
|
"instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,",
|
|
|
"rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,",
|
|
|
"dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,",
|
|
|
- "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id ",
|
|
|
+ "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag ",
|
|
|
"from dbo.mz_charge_detail WITH(NOLOCK) where patient_id =#{patientId,jdbcType=CHAR} and times =#{times} and receipt_no =#{receiptNo} ",
|
|
|
"</script>"})
|
|
|
List<MzChargeDetail> selectByPatientIdAndTimesAndReceiptNo(@Param("patientId") String patientId, @Param("times") Integer times, @Param("receiptNo") Integer receiptNo);
|
|
|
@@ -874,11 +874,11 @@ public interface MzChargeDetailMapper {
|
|
|
"SELECT c.patient_id,c.times,c.receipt_no,c.order_no,c.real_no,c.bill_item_code," +
|
|
|
"c.group_no,c.charge_item_code,c.serial,c.warn_dept,c.price_time,c.doctor_code,c.confirm_id," +
|
|
|
"c.quantity,c.drug_quan,c.frequency,c.charge_item_code,c.drug_unit,c.supply_code,c.doctor_code," +
|
|
|
- "c.unit_price,c.yb_zf_flag,c.jz_flag,instruction_text,try_result,try_flag,c.pay_self, " +
|
|
|
+ "c.unit_price,c.yb_zf_flag,c.jz_flag,c.instruction_code,c.instruction_text,c.try_result,c.try_flag,c.pay_self, " +
|
|
|
" (case when y.class_code = '210100' then 1 else 0 end ) as is_hide,c.print_flag,c.drug_win,cy_jssm,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,rtrim(cy_dj)cy_dj" +
|
|
|
" FROM mz_charge_detail c WITH(NOLOCK) ,yp_zd_dict y WITH(NOLOCK) " +
|
|
|
" where 1=1 " +
|
|
|
- " and c.charge_item_code = y.code and c.serial = y.serial" +
|
|
|
+ " and c.charge_item_code = y.code and c.serial = y.serial and c.pay_mark = '0' " +
|
|
|
"<when test='patientId!=null'>" +
|
|
|
" and c.patient_id =#{patientId}" +
|
|
|
"</when>" +
|
|
|
@@ -1160,7 +1160,7 @@ public interface MzChargeDetailMapper {
|
|
|
"instruction_text,order_days,rtrim(pay_self) pay_self,rtrim(try_flag) try_flag,rtrim(req_yj) req_yj,req_no,rtrim(group_type) group_type,order_bill,charge_bill_code,"+
|
|
|
"rtrim(self_flag) self_flag,rtrim(responce_type) responce_type,dec_amount,back_serial,input_time,cy_mtjs,cy_jsl,cy_zql,cy_fj,cy_ffcs,cy_fysm,supply_amount,rtrim(cy_jssm) cy_jssm,"+
|
|
|
"dept_no,gl_percent_ft,rtrim(yb_zf_flag) yb_zf_flag,orig_price,rtrim(try_result) try_result,rtrim(supply_exec) supply_exec,rtrim(cy_dj) cy_dj,rtrim(receive_flag) receive_flag,"+
|
|
|
- "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id "+
|
|
|
+ "rtrim(chequ_type) chequ_type,rtrim(print_flag_yj) print_flag_yj,rtrim(confirm_flag_qx) confirm_flag_qx,group_id,hosp_appr_flag "+
|
|
|
" from mz_charge_detail where patient_id=#{patientId} and pay_mark = 0 and confirm_flag<>4 and DateDiff(dd,charge_date,getDate()) =0 and group_no in('71','81','82') ")
|
|
|
List<MzChargeDetail> selectCurrentYpList(@Param("patientId") String patientId);
|
|
|
|
|
|
@@ -1183,4 +1183,65 @@ public interface MzChargeDetailMapper {
|
|
|
void updateCashIdByPatientId(@Param("userIdCode") String userIdCode, @Param("mzDepositFileVo") MzDepositFileVo mzDepositFileVo);
|
|
|
@Delete(" delete from mz_charge_detail where patient_id =#{patientId} and times = #{times} ")
|
|
|
int deleteChargeDetailByPatientIdAndTimes(@Param("patientId") String patientId, @Param("times")Integer times);
|
|
|
+ /**
|
|
|
+ * @description: 获取指引单项目指引数据
|
|
|
+ * @author: lihong
|
|
|
+ * @date: 2025/1/16 16:28
|
|
|
+ * @param: patientId
|
|
|
+ * @param: times
|
|
|
+ * @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
|
|
+ **/
|
|
|
+ @Select(" select type='诊疗服务',c.name name,c.office_pos address " +
|
|
|
+ "from mz_charge_detail a,zd_charge_item b,zd_unit_code c " +
|
|
|
+ "where patient_id=#{patientId} and times=#{times} and req_no=0 " +
|
|
|
+ " and a.charge_item_code=b.code " +
|
|
|
+ " and a.exec_dept=c.code " +
|
|
|
+ " and c.office_pos is not null " +
|
|
|
+ " and a.exec_dept!='2060500' " +
|
|
|
+ "group by c.name,c.office_pos " +
|
|
|
+ "union all " +
|
|
|
+ "select type='检查',c.name name,d.office_pos address " +
|
|
|
+ "from mz_yj_req a,jc_zd_item b,jc_zd_class c,zd_unit_code d " +
|
|
|
+ "where patient_id=#{patientId} and times=#{times} " +
|
|
|
+ " and a.order_code=b.code " +
|
|
|
+ " and b.class=c.code " +
|
|
|
+ " and a.exec_dept=d.code " +
|
|
|
+ " and d.office_pos is not null " +
|
|
|
+ "group by c.name,a.exec_dept,d.office_pos " +
|
|
|
+ "union all " +
|
|
|
+ "select type='药品',c.group_name name,c.office_pos address " +
|
|
|
+ "from mz_charge_detail a,yp_zd_group_name c " +
|
|
|
+ "where patient_id=#{patientId} and times=#{times} " +
|
|
|
+ " and a.group_no=c.group_no " +
|
|
|
+ "group by c.group_name,c.office_pos " +
|
|
|
+ "union all " +
|
|
|
+ "select type='检验化验',d.name name,(select office_pos from zd_unit_code where code=a.exec_dept) address " +
|
|
|
+ "from mz_yj_req a,jy_zd_item b,zd_unit_code d " +
|
|
|
+ "where patient_id=#{patientId} and times=#{times} " +
|
|
|
+ " and a.order_code=b.code " +
|
|
|
+ " and a.exec_dept=d.code " +
|
|
|
+ "group by a.exec_dept,d.name " +
|
|
|
+ "order by type,address,name ")
|
|
|
+ List<Map<String, Object>> getChargeDetailForGuideCard(@Param("patientId") String patientId, @Param("times") Integer times);
|
|
|
+ /**
|
|
|
+ * @description: 查询优惠后 和 未优惠的金额
|
|
|
+ * @author: lihong
|
|
|
+ * @date: 2025/3/7 16:14
|
|
|
+ * @param: patientId
|
|
|
+ * @param: times
|
|
|
+ * @return: cn.hnthyy.thmz.entity.his.mz.MzChargeDetail
|
|
|
+ **/
|
|
|
+ @Select(" select sum((case " +
|
|
|
+ " when convert(decimal(18, 2), unit_price) = 0.00 then 0.00 " +
|
|
|
+ " else convert(decimal(18, 2), unit_price) end) * quantity * drug_win) amount, " +
|
|
|
+ " sum((case " +
|
|
|
+ " when convert(decimal(18, 2), orig_price) = 0.00 then 0.00 " +
|
|
|
+ " else convert(decimal(18, 2), orig_price) end) * quantity * drug_win) not_discount_amount " +
|
|
|
+ " from mz_charge_detail " +
|
|
|
+ " where patient_id = #{patientId} " +
|
|
|
+ " and times = #{times} ")
|
|
|
+ MzChargeDetail selectSumTotalFee(@Param("patientId") String patientId, @Param("times")Integer times);
|
|
|
+
|
|
|
+ @Update("update ${tableName} set tf_flag =#{tfFlag} where patient_id =#{patientId} and times=#{times} and abs(receipt_no) =#{receiptNo} ")
|
|
|
+ int updateTfFlag(@Param("patientId") String patientId, @Param("times") Integer times, @Param("tfFlag") Integer tfFlag, @Param("receiptNo")Integer receiptNo, @Param("tableName") String tableName);
|
|
|
}
|