|
|
@@ -624,20 +624,24 @@ public interface MzChargeDetailMapper {
|
|
|
* @param serialNo
|
|
|
* @param beginDate
|
|
|
* @param endDate
|
|
|
+ * @param warnDept 申请科室
|
|
|
* @return
|
|
|
*/
|
|
|
@Select({"<script>",
|
|
|
- "SELECT distinct rtrim(a.patient_id) patient_id,name,a.times,a.receipt_no,charge_date=convert(char(10),a.charge_date,111) ,a.serial_no,real_no ,a.responce_type," +
|
|
|
- " cheque_type=case when mz_receipt_serial.cheque_type='Y' and cash_id <![CDATA[<>]]> '99999' " +
|
|
|
- " and (len(ltrim(rtrim(mz_receipt_serial.receipt_bill))) >= 10 or len(ltrim(rtrim(mz_receipt_serial.receipt_bill)))=0) then '本院记账' else '自费' end, " +
|
|
|
- " serial_no_order=ABS(a.serial_no) " +
|
|
|
- " FROM mz_charge_detail a WITH(NOLOCK),mz_receipt_serial WITH(NOLOCK) " +
|
|
|
- " WHERE " +
|
|
|
- " a.patient_id=mz_receipt_serial.patient_id " +
|
|
|
- " and a.times = mz_receipt_serial.times " +
|
|
|
- " and a.receipt_no = mz_receipt_serial.receipt_no " +
|
|
|
- " and a.charge_date <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP} and a.charge_date <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP} and a.pay_mark <![CDATA[<>]]> 9 " +
|
|
|
- "<when test='patientId!=null'>",
|
|
|
+ "SELECT distinct rtrim(a.patient_id) patient_id,name,a.times,a.receipt_no,charge_date=convert(char(10),a.charge_date,111) ,a.serial_no,real_no ,a.responce_type,",
|
|
|
+ " cheque_type=case when mz_receipt_serial.cheque_type='Y' and cash_id <![CDATA[<>]]> '99999' ",
|
|
|
+ " and (len(ltrim(rtrim(mz_receipt_serial.receipt_bill))) >= 10 or len(ltrim(rtrim(mz_receipt_serial.receipt_bill)))=0) then '本院记账' else '自费' end, ",
|
|
|
+ " serial_no_order=ABS(a.serial_no) ",
|
|
|
+ " FROM mz_charge_detail a WITH(NOLOCK),mz_receipt_serial WITH(NOLOCK) ",
|
|
|
+ " WHERE ",
|
|
|
+ " a.patient_id=mz_receipt_serial.patient_id ",
|
|
|
+ " and a.times = mz_receipt_serial.times ",
|
|
|
+ " and a.receipt_no = mz_receipt_serial.receipt_no ",
|
|
|
+ " and a.charge_date <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP} and a.charge_date <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP} and a.pay_mark <![CDATA[<>]]> 9 ",
|
|
|
+ "<when test='warnDept!=null'>",
|
|
|
+ " and a.warn_dept = #{warnDept}",
|
|
|
+ "</when>",
|
|
|
+ "<when test='patientId!=null'>",
|
|
|
" and a.patient_id like #{patientId}",
|
|
|
"</when>",
|
|
|
"<when test='name!=null'>",
|
|
|
@@ -648,7 +652,7 @@ public interface MzChargeDetailMapper {
|
|
|
"</when>",
|
|
|
" and real_no=receipt_sn and a.name is not null and a.responce_type is not null order by serial_no_order desc" +
|
|
|
"</script>"})
|
|
|
- List<Map<String, Object>> selectChargeListByPatient(@Param("patientId") String patientId, @Param("name") String name, @Param("serialNo") String serialNo, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
|
|
|
+ List<Map<String, Object>> selectChargeListByPatient(@Param("patientId") String patientId, @Param("name") String name, @Param("serialNo") String serialNo, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("warnDept") String warnDept);
|
|
|
|
|
|
/**
|
|
|
* 查询某个病人最近一段时间购买某一药品的总数量
|
|
|
@@ -1122,5 +1126,4 @@ public interface MzChargeDetailMapper {
|
|
|
Integer selectCountMzChargeDetailByPatientIdAndChargeItemCode(@Param("patientId") String patientId, @Param("chargeItemCode") String chargeItemCode);
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|