|
@@ -1,6 +1,7 @@
|
|
|
package thyyxxk.webserver.dao.his.yibao;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import org.apache.ibatis.annotations.*;
|
|
|
import thyyxxk.webserver.entity.datamodify.FeiYongLeiXin;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
@@ -56,19 +57,29 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
"and charge_code_mx = #{chargeCode} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"startTime != null and startTime!= '' \">" +
|
|
|
- "and convert(varchar(100),a.charge_date,23) = #{startTime} " +
|
|
|
+ "and a.charge_date >= #{startTime} and a.charge_date <= #{endTime} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"dept != null and dept != '' \"> " +
|
|
|
"and a.exec_unit=#{dept} " +
|
|
|
"</if>" +
|
|
|
+ "<if test=\"orderNo != 2 and orderNo != 1 \">" +
|
|
|
+ "and a.order_no = #{orderNo} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"orderNo !=2 and orderNo == 1\">" +
|
|
|
+ "and len(a.order_no) >2 " +
|
|
|
+ "</if>" +
|
|
|
+ "order by a.charge_date ${riQiPaiXu}" +
|
|
|
"</script>")
|
|
|
- List<ZyDetailCharge> huanZheYaoPinFeiYong(@Param("inpatientNo") String inpatientNo,
|
|
|
+ Page<ZyDetailCharge> huanZheYaoPinFeiYong(Page<ZyDetailCharge> page,
|
|
|
+ @Param("inpatientNo") String inpatientNo,
|
|
|
@Param("admissTimes") Integer admissTimes,
|
|
|
@Param("chargeCode") String chargeCode,
|
|
|
@Param("infantFlag") int infantFlag,
|
|
|
@Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
@Param("orderNo") BigDecimal orderNo,
|
|
|
- @Param("dept") String dept);
|
|
|
+ @Param("dept") String dept,
|
|
|
+ @Param("riQiPaiXu") String riQiPaiXu);
|
|
|
|
|
|
|
|
|
@Select("<script>" +
|
|
@@ -108,150 +119,63 @@ public interface XiangMuLuRuDao extends BaseMapper<ZyDetailCharge> {
|
|
|
"and charge_code_mx = #{chargeCode} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"startTime != null and startTime!= '' \">" +
|
|
|
- "and convert(varchar(100),a.charge_date,23) = #{startTime} " +
|
|
|
+ "and a.charge_date >= #{startTime} and a.charge_date <= #{endTime} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"dept != null and dept != '' \"> " +
|
|
|
- "and a.exec_unit=#{dept} " +
|
|
|
+ "and a.exec_unit = #{dept} " +
|
|
|
"</if>" +
|
|
|
+ "<if test=\"orderNo != 2 and orderNo != 1 \">" +
|
|
|
+ "and a.order_no = #{orderNo} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"orderNo !=2 and orderNo == 1\">" +
|
|
|
+ "and len(a.order_no) >2 " +
|
|
|
+ "</if>" +
|
|
|
+ "order by a.charge_date ${riQiPaiXu}" +
|
|
|
"</script>")
|
|
|
- List<ZyDetailCharge> huanZheXiangMuFeiYong(@Param("inpatientNo") String inpatientNo,
|
|
|
+ Page<ZyDetailCharge> huanZheXiangMuFeiYong(Page<ZyDetailCharge> page,
|
|
|
+ @Param("inpatientNo") String inpatientNo,
|
|
|
@Param("admissTimes") Integer admissTimes,
|
|
|
@Param("chargeCode") String chargeCode,
|
|
|
@Param("infantFlag") int infantFlag,
|
|
|
@Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
@Param("orderNo") BigDecimal orderNo,
|
|
|
- @Param("dept") String dept);
|
|
|
+ @Param("dept") String dept,
|
|
|
+ @Param("riQiPaiXu") String riQiPaiXu);
|
|
|
+
|
|
|
|
|
|
- /**
|
|
|
- * 获取患者的费用
|
|
|
- *
|
|
|
- * @param inpatientNo 住院号
|
|
|
- * @param admissTimes 住院次数
|
|
|
- * @param chargeCode 项目编码
|
|
|
- * @return 返回患者的费用信息
|
|
|
- */
|
|
|
@Select("<script>" +
|
|
|
- "select * from (" +
|
|
|
- "SELECT a.admiss_times, " +
|
|
|
- " a.inpatient_no, " +
|
|
|
- " a.ledger_sn, " +
|
|
|
- " a.detail_sn," +
|
|
|
- " a.charge_date, " +
|
|
|
- " a.op_id_code, " +
|
|
|
- " d.name op_name," +
|
|
|
- " a.charge_code, " +
|
|
|
- " a.charge_fee, " +
|
|
|
- " a.charge_status , " +
|
|
|
- " bill_item_code= b.bill_item_zy," +
|
|
|
- " bill_item_name=(select name from zy_bill_item where code = b.bill_item_zy), " +
|
|
|
- " charge_name=b.name, " +
|
|
|
- " spec=b.charge_unit, " +
|
|
|
- " a.charge_code_mx, " +
|
|
|
- " a.serial, " +
|
|
|
- " price=0.0000, " +
|
|
|
- " charge_amount=a.charge_amount, " +
|
|
|
- " exec_dept=(select name from zd_unit_code where code = a.exec_unit), " +
|
|
|
- " dept_code = (select name from zd_unit_code where code = a.ward_code) , " +
|
|
|
- " 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," +
|
|
|
- " a.ori_detail_sn " +
|
|
|
- "FROM zy_detail_charge a ,zd_charge_item b,yp_zd_dict c,a_employee_mi d " +
|
|
|
- "where a.inpatient_no=#{inpatientNo} and " +
|
|
|
- " a.admiss_times=#{admissTimes} and " +
|
|
|
- "<if test=\"chargeCode !=null and chargeCode != '' \">" +
|
|
|
- " a.charge_code_mx = #{chargeCode} and" +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"dept != null and dept != '' \"> " +
|
|
|
- " a.exec_unit=#{dept} and " +
|
|
|
+ "SELECT count(*) " +
|
|
|
+ " FROM zy_detail_charge a " +
|
|
|
+ " where a.inpatient_no= #{inpatientNo} and " +
|
|
|
+ " a.admiss_times= #{admissTimes} and " +
|
|
|
+ " a.infant_flag = #{infantFlag} and trans_flag_yb !=2 " +
|
|
|
+ " AND a.charge_code ${isLike} 'BILL%' and a.ledger_sn >0 " +
|
|
|
+ "<if test=\"chargeCode != null and chargeCode != '' \">" +
|
|
|
+ "and charge_code_mx = #{chargeCode} " +
|
|
|
"</if>" +
|
|
|
- " a.charge_code=b.code and " +
|
|
|
- "<if test=\"startTime != null and startTime!= '' \">" +
|
|
|
- " convert(varchar(100),a.charge_date,23) = #{startTime} and " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"orderNo !=null\">" +
|
|
|
- "<choose>" +
|
|
|
- "<when test=\"orderNo == 1\">" +
|
|
|
- " len(a.order_no) > 2 and " +
|
|
|
- "</when>" +
|
|
|
- "<when test=\"orderNo == 4\">" +
|
|
|
- " a.order_no != 6 and " +
|
|
|
- "</when>" +
|
|
|
- "<otherwise>" +
|
|
|
- " a.order_no = #{orderNo} and " +
|
|
|
- "</otherwise>" +
|
|
|
- "</choose>" +
|
|
|
- "</if>" +
|
|
|
- " a.serial=c.serial and a.charge_code like 'BILL%' and " +
|
|
|
- " c.code= a.charge_code_mx and a.ledger_sn > 0 and " +
|
|
|
- " a.infant_flag = #{infantFlag} and d.code = a.op_id_code and trans_flag_yb !=2 " +
|
|
|
- "union " +
|
|
|
- "SELECT a.admiss_times, " +
|
|
|
- " a.inpatient_no, " +
|
|
|
- " a.ledger_sn, " +
|
|
|
- " a.detail_sn, " +
|
|
|
- " a.charge_date, " +
|
|
|
- " a.op_id_code, " +
|
|
|
- " c.name op_name," +
|
|
|
- " a.charge_code, " +
|
|
|
- " a.charge_fee, " +
|
|
|
- " a.charge_status , " +
|
|
|
- " bill_item_code = b.bill_item_zy," +
|
|
|
- " bill_item_name=(select name from zy_bill_item where code = b.bill_item_zy), " +
|
|
|
- " charge_name=b.name, " +
|
|
|
- " spec=b.charge_unit, " +
|
|
|
- " a.charge_code_mx, " +
|
|
|
- " a.serial, " +
|
|
|
- " price=0.0000, " +
|
|
|
- " charge_amount=a.charge_amount, " +
|
|
|
- " exec_dept=(select name from zd_unit_code where code = a.exec_unit), " +
|
|
|
- " dept_code = (select name from zd_unit_code where code = a.ward_code) , " +
|
|
|
- " self_flag=a.self_flag, " +
|
|
|
- " suppress_flag=a.suppress_flag, " +
|
|
|
- " group_no='00', " +
|
|
|
- " separate_flag=a.separate_flag, " +
|
|
|
- " ope_flag=a.ope_flag, " +
|
|
|
- " drugname=b.name," +
|
|
|
- " a.ori_detail_sn " +
|
|
|
- "FROM zy_detail_charge a ,zd_charge_item b , a_employee_mi c " +
|
|
|
- "where a.inpatient_no= #{inpatientNo} and " +
|
|
|
- " a.admiss_times= #{admissTimes} and " +
|
|
|
- "<if test=\"chargeCode !=null and chargeCode != '' \">" +
|
|
|
- " a.charge_code_mx = #{chargeCode} and" +
|
|
|
- "</if>" +
|
|
|
- " a.charge_code=b.code and " +
|
|
|
"<if test=\"startTime != null and startTime!= '' \">" +
|
|
|
- " convert(varchar(100),a.charge_date,23) = #{startTime} and " +
|
|
|
+ "and a.charge_date >= #{startTime} and a.charge_date <= #{endTime} " +
|
|
|
"</if>" +
|
|
|
"<if test=\"dept != null and dept != '' \"> " +
|
|
|
- " a.exec_unit=#{dept} and " +
|
|
|
- "</if>" +
|
|
|
- "<if test=\"orderNo !=null\">" +
|
|
|
- "<choose>" +
|
|
|
- "<when test=\"orderNo == 1\">" +
|
|
|
- " len(a.order_no) > 2 and " +
|
|
|
- "</when>" +
|
|
|
- "<when test=\"orderNo == 4\">" +
|
|
|
- " a.order_no != 6 and " +
|
|
|
- "</when>" +
|
|
|
- "<otherwise>" +
|
|
|
- " a.order_no = #{orderNo} and " +
|
|
|
- "</otherwise>" +
|
|
|
- "</choose>" +
|
|
|
- "</if>" +
|
|
|
- "a.infant_flag = #{infantFlag} and c.code = a.op_id_code and trans_flag_yb !=2 AND a.charge_code not like 'BILL%' " +
|
|
|
- "and a.ledger_sn > 0 ) temp" +
|
|
|
+ "and a.exec_unit = #{dept} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"orderNo != 2 and orderNo != 1 \">" +
|
|
|
+ "and a.order_no = #{orderNo} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"orderNo !=2 and orderNo == 1\">" +
|
|
|
+ "and len(a.order_no) >2 " +
|
|
|
+ "</if>" +
|
|
|
"</script>")
|
|
|
- List<ZyDetailCharge> getHuanZheFeiYong(@Param("inpatientNo") String inpatientNo,
|
|
|
- @Param("admissTimes") Integer admissTimes,
|
|
|
- @Param("chargeCode") String chargeCode,
|
|
|
- @Param("infantFlag") int infantFlag,
|
|
|
- @Param("startTime") String startTime,
|
|
|
- @Param("orderNo") BigDecimal orderNo,
|
|
|
- @Param("dept") String dept);
|
|
|
+ long huanZheFeiYongCount(@Param("inpatientNo") String inpatientNo,
|
|
|
+ @Param("admissTimes") Integer admissTimes,
|
|
|
+ @Param("chargeCode") String chargeCode,
|
|
|
+ @Param("infantFlag") int infantFlag,
|
|
|
+ @Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
+ @Param("orderNo") BigDecimal orderNo,
|
|
|
+ @Param("dept") String dept,
|
|
|
+ @Param("isLike") String isLike);
|
|
|
|
|
|
|
|
|
@Select("select detail_sn,ori_detail_sn from zy_detail_charge where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes} " +
|