|
@@ -28,7 +28,6 @@ import java.util.Map;
|
|
|
@Mapper
|
|
|
public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
|
|
|
-
|
|
|
@Select("<script>" +
|
|
|
"select a.admiss_times, a.inpatient_no, a.order_no, a.gen_time, a.ledger_sn, a.detail_sn, " +
|
|
|
" a.trans_flag_yb, " +
|
|
@@ -40,104 +39,28 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
" self_flag=isnull(a.self_flag,0), suppress_flag=a.suppress_flag, group_no='00', " +
|
|
|
" separate_flag=a.separate_flag, ope_flag=a.ope_flag, drugname=c.name, isnull(a.ori_detail_sn,0) ori_detail_sn " +
|
|
|
" FROM (select top ${pageSize} * from (select ROW_NUMBER() OVER (order by charge_date ${riQiPaiXu} ) as RowNumber,* from zy_detail_charge a " +
|
|
|
- "where a.charge_code " +
|
|
|
- "like 'BILL%' and a.ledger_sn = #{ledgerSn} and trans_flag_yb <> 2 and a.order_no <> 6 and inpatient_no = #{inpatientNo} " +
|
|
|
- "and admiss_times = #{admissTimes} and a.infant_flag = #{infantFlag} " +
|
|
|
- "<if test=\"chargeCode != null and chargeCode != '' \">" +
|
|
|
- "and charge_code_mx = #{chargeCode} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"startTime != null and startTime!= '' \">" +
|
|
|
- "and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"dept != null and dept != '' \"> " +
|
|
|
- "and exec_unit=#{dept} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"orderNo != 2 and orderNo != 1 \">" +
|
|
|
- "and order_no = #{orderNo} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"orderNo !=2 and orderNo == 1\">" +
|
|
|
- "and len(order_no) >2 " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 0 \">" +
|
|
|
- "and ori_detail_sn is null and charge_fee > 0" +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 1 \">" +
|
|
|
- "and (ori_detail_sn > 0 or charge_fee < 0) " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 2 \">" +
|
|
|
- "and (ori_detail_sn = -1 )" +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"actOrderNo != null\">" +
|
|
|
- " and order_no = #{actOrderNo} " +
|
|
|
- "</if>" +
|
|
|
+ " ${ew.customSqlSegment} " +
|
|
|
") temp where RowNumber > ${pageSize} * (${currentPage} - 1 )) a " +
|
|
|
" left join zd_charge_item b on (a.charge_code = b.code) " +
|
|
|
" left join yp_zd_dict c on (a.serial = c.serial and c.code= a.charge_code_mx) " +
|
|
|
" left join a_employee_mi d on (d.code = a.op_id_code) " +
|
|
|
"</script>")
|
|
|
- List<ZyDetailCharge> huanZheYaoPinFeiYong(@Param("currentPage") long currentPage,
|
|
|
- @Param("pageSize") long pageSize,
|
|
|
- @Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn,
|
|
|
- @Param("chargeCode") String chargeCode,
|
|
|
- @Param("infantFlag") int infantFlag,
|
|
|
- @Param("startTime") String startTime,
|
|
|
- @Param("endTime") String endTime,
|
|
|
- @Param("orderNo") BigDecimal orderNo,
|
|
|
- @Param("actOrderNo") BigDecimal actOrderNo,
|
|
|
- @Param("dept") String dept,
|
|
|
- @Param("riQiPaiXu") String riQiPaiXu,
|
|
|
- @Param("tuiFeiFlag") Integer tuiFeiFlag);
|
|
|
+ List<ZyDetailCharge> huanZheYaoPinFeiYongV2(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper,
|
|
|
+ @Param("currentPage") long currentPage,
|
|
|
+ @Param("pageSize") long pageSize,
|
|
|
+ @Param("riQiPaiXu") String riQiPaiXu);
|
|
|
|
|
|
- @Select("<script>" +
|
|
|
- "select count(*) total,sum(charge_fee) charge_fee" +
|
|
|
+ @Select("select count(*) total,sum(charge_fee) charge_fee" +
|
|
|
" FROM zy_detail_charge a " +
|
|
|
- "where a.charge_code " +
|
|
|
- "like 'BILL%' and a.ledger_sn = #{ledgerSn} and trans_flag_yb <> 2 and a.order_no <> 6 and inpatient_no = #{inpatientNo} " +
|
|
|
- "and admiss_times = #{admissTimes} and a.infant_flag = #{infantFlag} " +
|
|
|
- "<if test=\"chargeCode != null and chargeCode != '' \">" +
|
|
|
- "and charge_code_mx = #{chargeCode} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"startTime != null and startTime!= '' \">" +
|
|
|
- "and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"dept != null and dept != '' \"> " +
|
|
|
- "and exec_unit=#{dept} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"orderNo != 2 and orderNo != 1 \">" +
|
|
|
- "and order_no = #{orderNo} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"orderNo !=2 and orderNo == 1\">" +
|
|
|
- "and len(order_no) >2 " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 0 \">" +
|
|
|
- "and ori_detail_sn is null and charge_fee > 0" +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 1 \">" +
|
|
|
- "and (ori_detail_sn > 0 or charge_fee < 0) " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 2 \">" +
|
|
|
- "and (ori_detail_sn = -1 )" +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"actOrderNo != null\">" +
|
|
|
- " and order_no = #{actOrderNo} " +
|
|
|
- "</if>" +
|
|
|
- "</script>")
|
|
|
- long huanZheYaoPinFeiYongTotal(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn,
|
|
|
- @Param("chargeCode") String chargeCode,
|
|
|
- @Param("infantFlag") int infantFlag,
|
|
|
- @Param("startTime") String startTime,
|
|
|
- @Param("endTime") String endTime,
|
|
|
- @Param("orderNo") BigDecimal orderNo,
|
|
|
- @Param("actOrderNo") BigDecimal actOrderNo,
|
|
|
- @Param("dept") String dept,
|
|
|
- @Param("tuiFeiFlag") Integer tuiFeiFlag);
|
|
|
+ " ${ew.customSqlSegment} ")
|
|
|
+ long huanZheYaoPinFeiYongTotalV2(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
|
|
|
|
|
|
- @Select("<script>" +
|
|
|
- " SELECT " +
|
|
|
+ @Select(" select count(*) total,sum(charge_fee) charge_fee" +
|
|
|
+ " from zy_detail_charge ${ew.customSqlSegment} ")
|
|
|
+ long huanZheFeiYongToatalV2(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
|
|
|
+
|
|
|
+
|
|
|
+ @Select(" SELECT " +
|
|
|
" a.admiss_times, " +
|
|
|
" a.inpatient_no, " +
|
|
|
" a.order_no, " +
|
|
@@ -169,98 +92,16 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
" specification, " +
|
|
|
" drugname=b.name, " +
|
|
|
" isnull(a.ori_detail_sn,0) ori_detail_sn " +
|
|
|
- " FROM (select top ${pageSize} * from (select ROW_NUMBER() OVER (order by charge_date ${riQiPaiXu} ) as RowNumber,* from zy_detail_charge where inpatient_no= #{inpatientNo} and " +
|
|
|
- "admiss_times= #{admissTimes} and ledger_sn = #{ledgerSn} and infant_flag = #{infantFlag} and " +
|
|
|
- " isnull(trans_flag_yb,0) <> 2 AND charge_code not like 'BILL%' and order_no <> 6" +
|
|
|
- "<if test=\"chargeCode != null and chargeCode != '' \">" +
|
|
|
- "and charge_code_mx = #{chargeCode} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"startTime != null and startTime!= '' \">" +
|
|
|
- "and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"dept != null and dept != '' \"> " +
|
|
|
- "and exec_unit = #{dept} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"orderNo != 2 and orderNo != 1 \">" +
|
|
|
- "and order_no = #{orderNo} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"orderNo !=2 and orderNo == 1\">" +
|
|
|
- "and len(order_no) >2 " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 0 \">" +
|
|
|
- "and ori_detail_sn is null and charge_fee > 0" +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 1 \">" +
|
|
|
- "and (ori_detail_sn > 0 or charge_fee < 0) " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 2 \">" +
|
|
|
- "and (ori_detail_sn = -1 )" +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"actOrderNo != null\">" +
|
|
|
- " and order_no = #{actOrderNo} " +
|
|
|
- "</if>" +
|
|
|
+ " FROM (select top ${pageSize} * from (select ROW_NUMBER() OVER (order by charge_date ${riQiPaiXu} ) as RowNumber,* " +
|
|
|
+ "from zy_detail_charge " +
|
|
|
+ "${ew.customSqlSegment}" +
|
|
|
") temp where RowNumber > ${pageSize} * (${currentPage}-1) ) a " +
|
|
|
" left join zd_charge_item b on (a.charge_code=b.code) " +
|
|
|
- " left join a_employee_mi c on (c.code = a.op_id_code)" +
|
|
|
- "</script>")
|
|
|
- List<ZyDetailCharge> huanZheXiangMuFeiYong(@Param("currentPage") long currentPage,
|
|
|
- @Param("pageSize") long pageSize,
|
|
|
- @Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn,
|
|
|
- @Param("chargeCode") String chargeCode,
|
|
|
- @Param("infantFlag") int infantFlag,
|
|
|
- @Param("startTime") String startTime,
|
|
|
- @Param("endTime") String endTime,
|
|
|
- @Param("orderNo") BigDecimal orderNo,
|
|
|
- @Param("actOrderNo") BigDecimal actOrderNo,
|
|
|
- @Param("dept") String dept,
|
|
|
- @Param("riQiPaiXu") String riQiPaiXu,
|
|
|
- @Param("tuiFeiFlag") Integer tuiFeiFlag);
|
|
|
-
|
|
|
-
|
|
|
- @Select("<script>" +
|
|
|
- " select count(*) total,sum(charge_fee) charge_fee from zy_detail_charge where inpatient_no= #{inpatientNo} and " +
|
|
|
- "admiss_times= #{admissTimes} and ledger_sn = #{ledgerSn} and infant_flag = #{infantFlag} and trans_flag_yb <> 2 AND charge_code not like 'BILL%' and order_no <> 6" +
|
|
|
- "<if test=\"chargeCode != null and chargeCode != '' \">" +
|
|
|
- "and charge_code_mx = #{chargeCode} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"startTime != null and startTime!= '' \">" +
|
|
|
- "and charge_date >= #{startTime} and charge_date <= #{endTime} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"dept != null and dept != '' \"> " +
|
|
|
- "and exec_unit = #{dept} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"orderNo != 2 and orderNo != 1 \">" +
|
|
|
- "and order_no = #{orderNo} " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"orderNo !=2 and orderNo == 1\">" +
|
|
|
- "and len(order_no) >2 " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 0 \">" +
|
|
|
- "and ori_detail_sn is null and charge_fee > 0" +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 1 \">" +
|
|
|
- "and (ori_detail_sn > 0 or charge_fee < 0) " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"tuiFeiFlag != null and tuiFeiFlag == 2 \">" +
|
|
|
- "and (ori_detail_sn = -1 )" +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"actOrderNo != null\">" +
|
|
|
- " and order_no = #{actOrderNo} " +
|
|
|
- "</if>" +
|
|
|
- "</script>")
|
|
|
- long huanZheFeiYongToatal(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn,
|
|
|
- @Param("chargeCode") String chargeCode,
|
|
|
- @Param("infantFlag") int infantFlag,
|
|
|
- @Param("startTime") String startTime,
|
|
|
- @Param("endTime") String endTime,
|
|
|
- @Param("orderNo") BigDecimal orderNo,
|
|
|
- @Param("actOrderNo") BigDecimal actOrderNo,
|
|
|
- @Param("dept") String dept,
|
|
|
- @Param("tuiFeiFlag") Integer tuiFeiFlag);
|
|
|
+ " left join a_employee_mi c on (c.code = a.op_id_code)")
|
|
|
+ List<ZyDetailCharge> huanZheXiangMuFeiYongV2(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper,
|
|
|
+ @Param("currentPage") long currentPage,
|
|
|
+ @Param("pageSize") long pageSize,
|
|
|
+ @Param("riQiPaiXu") String riQiPaiXu);
|
|
|
|
|
|
|
|
|
@Select("select detail_sn,ori_detail_sn from zy_detail_charge where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} " +
|
|
@@ -341,63 +182,6 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
@Param("ledgerSn") Integer ledgerSn,
|
|
|
@Param("list") List<ZyDetailCharge> list);
|
|
|
|
|
|
- /**
|
|
|
- * 查询出 有哪些数据已经退过了 费用
|
|
|
- *
|
|
|
- * @param inpatientNo 住院号
|
|
|
- * @param admissTimes 住院次数
|
|
|
- * @param list 流水号
|
|
|
- * @return 返回 已经退过费用的数据
|
|
|
- */
|
|
|
- @Select("<script>" +
|
|
|
- "select " +
|
|
|
- "inpatient_no, " +
|
|
|
- " admiss_times, " +
|
|
|
- " ledger_sn, " +
|
|
|
- " detail_sn, " +
|
|
|
- " charge_date, " +
|
|
|
- " op_id_code, " +
|
|
|
- " charge_code, " +
|
|
|
- " bill_item_code = (select bill_item_zy from zd_charge_item where code = charge_code), " +
|
|
|
- " infant_flag, " +
|
|
|
- " charge_status, " +
|
|
|
- " retprice, " +
|
|
|
- " charge_amount, " +
|
|
|
- " charge_fee, " +
|
|
|
- " self_flag, " +
|
|
|
- " separate_flag, " +
|
|
|
- " suppress_flag, " +
|
|
|
- " ward_code, " +
|
|
|
- " dept_code, " +
|
|
|
- " order_no, " +
|
|
|
- " ope_flag, " +
|
|
|
- " exec_unit, " +
|
|
|
- " gen_time, " +
|
|
|
- " pay_percent, " +
|
|
|
- " zj_flag, " +
|
|
|
- " zfl, " +
|
|
|
- " charge_code_mx, " +
|
|
|
- " serial, " +
|
|
|
- " zy_serial_no, " +
|
|
|
- " doctor_code, " +
|
|
|
- " yb_self_flag, " +
|
|
|
- " orig_charge_fee, " +
|
|
|
- " confirm_id, " +
|
|
|
- " trans_flag_yb, " +
|
|
|
- " ss_code, " +
|
|
|
- " gs_flag, " +
|
|
|
- " refer_physician, " +
|
|
|
- " consult_physician, " +
|
|
|
- " ori_detail_sn" +
|
|
|
- " from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledgerSn} and detail_sn in " +
|
|
|
- "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
- "#{item.detailSn}" +
|
|
|
- "</foreach>" +
|
|
|
- "</script>")
|
|
|
- List<ZyDetailCharge> chaKanSFYiJingTuiFeiLe(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledgerSn") Integer ledgerSn,
|
|
|
- @Param("list") List<ZyDetailCharge> list);
|
|
|
|
|
|
/**
|
|
|
* 插入数据
|
|
@@ -653,20 +437,6 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
@Param("infantFlag") int infantFlag,
|
|
|
@Param("ledgerSn") Integer ledgerSn);
|
|
|
|
|
|
- @Select("<script>" +
|
|
|
- "select code as charge_code_mx, " +
|
|
|
- " CASE infusion_flag " +
|
|
|
- " when '1' then 'i' " +
|
|
|
- " else (case when code >= '30000' and code < '50000' then 'd' else 'j' end) end as drug_class " +
|
|
|
- "from yp_zd_dict " +
|
|
|
- "where rtrim(code) + rtrim(serial) in " +
|
|
|
- "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
- " '${item.chargeCodeMx}${item.serial}' " +
|
|
|
- "</foreach>" +
|
|
|
- "</script>")
|
|
|
- List<ZyDetailCharge> getDrugClass(List<ZyDetailCharge> yaoPingCode);
|
|
|
-
|
|
|
-
|
|
|
@Select("select b.class as class_code," +
|
|
|
" a.drug_flag as drug_class " +
|
|
|
"from yz_act_order a, " +
|
|
@@ -829,14 +599,6 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
Integer getHuanZheSFJieSuan(@Param("inpatientNo") String inpatientNo,
|
|
|
@Param("admissTimes") Integer admissTimes);
|
|
|
|
|
|
-
|
|
|
- @Select("select detail_sn,ori_detail_sn,trans_flag_yb from zy_detail_charge where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and ledger_sn = #{ledger} " +
|
|
|
- "and detail_sn = #{detailSn} and order_no <> 6 and trans_flag_yb <> 2 ")
|
|
|
- ZyDetailCharge beiTuiFeiYongXinXi(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("ledger") Integer ledger,
|
|
|
- @Param("detailSn") Integer detailSn);
|
|
|
-
|
|
|
@Select("<script>" +
|
|
|
"select code from yp_zd_dict where code in " +
|
|
|
"<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|