|
@@ -800,34 +800,34 @@ public interface MzPharmacyMapper {
|
|
|
" CASE" +
|
|
|
" WHEN yb_zf_flag = 1 THEN" +
|
|
|
" a.quantity- 1 ELSE a.quantity " +
|
|
|
- " END," +
|
|
|
+ " END as quantity," +
|
|
|
" CASE" +
|
|
|
" WHEN yb_zf_flag = 1 " +
|
|
|
" AND a.quantity > 1 THEN" +
|
|
|
" ( a.unit_price * a.quantity ) / ( a.quantity- 1 ) ELSE a.unit_price " +
|
|
|
- " END," +
|
|
|
+ " END as unit_price," +
|
|
|
" a.pay_mark ," +
|
|
|
" a.serial ," +
|
|
|
" a.country_flag ," +
|
|
|
- " '1'," +
|
|
|
+ " '1' as confirm_flag," +
|
|
|
"a.serial_no ," +
|
|
|
"a.name ," +
|
|
|
"a.charge_date ," +
|
|
|
"a.group_no ," +
|
|
|
- "#{confirmTime}," +
|
|
|
- "left(b.name,15) ," +
|
|
|
+ "#{confirmTime} as confirm_time," +
|
|
|
+ "left(b.name,15) as drugname," +
|
|
|
"left(b.specification,8)specification ," +
|
|
|
- "#{confirmId}," +
|
|
|
- "#{confirmName}," +
|
|
|
- "#{doctorId}," +
|
|
|
- "#{doctorName}," +
|
|
|
+ "#{confirmId} as confirm_id," +
|
|
|
+ "#{confirmName} as confirm_name," +
|
|
|
+ "#{doctorId} as doctor_id," +
|
|
|
+ "#{doctorName} as doctor_name," +
|
|
|
"a.drug_win ," +
|
|
|
"a.input_id ," +
|
|
|
"a.input_date ," +
|
|
|
"a.responce_type ," +
|
|
|
"a.self_flag ," +
|
|
|
- "#{winNo}," +
|
|
|
- "#{groupNo}," +
|
|
|
+ "#{winNo} as win_no," +
|
|
|
+ "#{groupNo} as group_no_out," +
|
|
|
"a.warn_dept ," +
|
|
|
"#{inputTime} as input_time," +
|
|
|
"a.real_no, " +
|
|
@@ -852,6 +852,129 @@ public interface MzPharmacyMapper {
|
|
|
" AND ( IsNull( a.confirm_flag , '0' ) IN ( '0', '2','5' ) OR a.print_flag_yj = '1' )")
|
|
|
int insertFyclFytj(YpMzFytj ypMzFytj);
|
|
|
|
|
|
+ @Select("SELECT " +
|
|
|
+ "a.patient_id ," +
|
|
|
+ "a.times ," +
|
|
|
+ "a.receipt_no ," +
|
|
|
+ "a.order_no ," +
|
|
|
+ "a.item_no ," +
|
|
|
+ "a.charge_item_code ," +
|
|
|
+ "a.bill_item_code ," +
|
|
|
+ " CASE" +
|
|
|
+ " WHEN yb_zf_flag = 1 THEN" +
|
|
|
+ " a.quantity- 1 ELSE a.quantity " +
|
|
|
+ " END as quantity," +
|
|
|
+ " CASE" +
|
|
|
+ " WHEN yb_zf_flag = 1 " +
|
|
|
+ " AND a.quantity > 1 THEN" +
|
|
|
+ " ( a.unit_price * a.quantity ) / ( a.quantity- 1 ) ELSE a.unit_price " +
|
|
|
+ " END as unit_price," +
|
|
|
+ " a.pay_mark ," +
|
|
|
+ " a.serial ," +
|
|
|
+ " a.country_flag ," +
|
|
|
+ " '1' as confirm_flag," +
|
|
|
+ "a.serial_no ," +
|
|
|
+ "a.name ," +
|
|
|
+ "a.charge_date ," +
|
|
|
+ "a.group_no ," +
|
|
|
+ "#{confirmTime} as confirm_time," +
|
|
|
+ "left(b.name,15) as drugname," +
|
|
|
+ "left(b.specification,8)specification ," +
|
|
|
+ "#{confirmId} as confirm_id," +
|
|
|
+ "#{confirmName} as confirm_name," +
|
|
|
+ "#{doctorId} as doctor_id," +
|
|
|
+ "#{doctorName} as doctor_name," +
|
|
|
+ "a.drug_win ," +
|
|
|
+ "a.input_id ," +
|
|
|
+ "a.input_date ," +
|
|
|
+ "a.responce_type ," +
|
|
|
+ "a.self_flag ," +
|
|
|
+ "#{winNo} as win_no," +
|
|
|
+ "#{groupNo} as group_no_out," +
|
|
|
+ "a.warn_dept ," +
|
|
|
+ "#{inputTime} as input_time," +
|
|
|
+ "a.real_no, " +
|
|
|
+ "a.manu_no " +
|
|
|
+ " FROM " +
|
|
|
+ " mz_charge_detail a WITH(NOLOCK)," +
|
|
|
+ " yp_zd_dict b," +
|
|
|
+ " yp_base_yf c " +
|
|
|
+ " WHERE" +
|
|
|
+ " a.patient_id = #{patientId} " +
|
|
|
+ " AND a.times = #{times} " +
|
|
|
+ " AND a.receipt_no = #{receiptNo} " +
|
|
|
+ " AND a.order_no = #{orderNo} " +
|
|
|
+ " AND a.item_no = #{itemNo} " +
|
|
|
+ " AND a.charge_item_code = #{chargeItemCode} " +
|
|
|
+ " AND a.serial = #{serial} " +
|
|
|
+ " AND a.charge_item_code = b.code " +
|
|
|
+ " AND a.serial = b.serial " +
|
|
|
+ " AND a.charge_item_code = c.charge_code " +
|
|
|
+ " AND a.serial = c.serial " +
|
|
|
+ " AND c.group_no = #{groupNo} " +
|
|
|
+ " AND ( IsNull( a.confirm_flag , '0' ) IN ( '0', '2','5' ) OR a.print_flag_yj = '1' )")
|
|
|
+ YpMzFytj selectFytjData(YpMzFytj ypMzFytj);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description: 放射科发药记录入库
|
|
|
+ * @author: hsh
|
|
|
+ * @date: 2023/5/10 11:31
|
|
|
+ * @param: [ypMzFytj]
|
|
|
+ * @return: int
|
|
|
+ **/
|
|
|
+ @Insert("INSERT INTO yp_mz_fytj (" +
|
|
|
+ "patient_id,times,receipt_no,order_no,item_no, " +
|
|
|
+ " charge_item_code,bill_item_code,quantity,unit_price, " +
|
|
|
+ " pay_mark,serial,country_flag,confirm_flag, " +
|
|
|
+ " serial_no,name,charge_date,group_no,confirm_time, " +
|
|
|
+ " drugname,specification,confirm_id,confirm_name, " +
|
|
|
+ " doctor_id,doctor_name,cy_fy,input_id,input_date, " +
|
|
|
+ " response_type,self_flag,win_no,group_no_out, " +
|
|
|
+ " warn_dept,input_time,real_no,manu_no " +
|
|
|
+ ") 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},#{unitPrice,jdbcType=DECIMAL}," +
|
|
|
+ " #{payMark,jdbcType=CHAR},#{serial,jdbcType=CHAR},#{countryFlag,jdbcType=CHAR},#{confirmFlag,jdbcType=INTEGER}," +
|
|
|
+ " #{serialNo,jdbcType=INTEGER},#{name,jdbcType=CHAR},#{chargeDate,jdbcType=TIMESTAMP},#{groupNo,jdbcType=CHAR},#{confirmTime,jdbcType=TIMESTAMP}," +
|
|
|
+ " #{drugname,jdbcType=CHAR},#{specification,jdbcType=CHAR},#{confirmId,jdbcType=CHAR},#{confirmName,jdbcType=CHAR}," +
|
|
|
+ " #{doctorId,jdbcType=CHAR},#{doctorName,jdbcType=CHAR},#{cyFy,jdbcType=INTEGER},#{inputId,jdbcType=CHAR},#{inputDate,jdbcType=TIMESTAMP}," +
|
|
|
+ " #{responseType,jdbcType=CHAR},#{selfFlag,jdbcType=CHAR},#{winNo,jdbcType=CHAR},#{groupNoOut,jdbcType=CHAR}," +
|
|
|
+ " #{warnDept,jdbcType=CHAR},#{inputTime,jdbcType=TIMESTAMP},#{realNo,jdbcType=INTEGER},#{manuNo,jdbcType=CHAR}) ")
|
|
|
+ int insertFyclFytjNew(YpMzFytj ypMzFytj);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description: 放射科发药记录批量入库
|
|
|
+ * @author: hsh
|
|
|
+ * @date: 2023/5/10 11:32
|
|
|
+ * @param:
|
|
|
+ * @return: int
|
|
|
+ **/
|
|
|
+ @Insert({
|
|
|
+ "<script>" +
|
|
|
+ "INSERT INTO yp_mz_fytj (" +
|
|
|
+ "patient_id,times,receipt_no,order_no,item_no, " +
|
|
|
+ " charge_item_code,bill_item_code,quantity,unit_price, " +
|
|
|
+ " pay_mark,serial,country_flag,confirm_flag, " +
|
|
|
+ " serial_no,name,charge_date,group_no,confirm_time, " +
|
|
|
+ " drugname,specification,confirm_id,confirm_name, " +
|
|
|
+ " doctor_id,doctor_name,cy_fy,input_id,input_date, " +
|
|
|
+ " response_type,self_flag,win_no,group_no_out, " +
|
|
|
+ " warn_dept,input_time,real_no,manu_no " +
|
|
|
+ ") values " +
|
|
|
+ "<foreach collection='mzFytjList' 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.unitPrice,jdbcType=DECIMAL}," +
|
|
|
+ " #{item.payMark,jdbcType=CHAR},#{item.serial,jdbcType=CHAR},#{item.countryFlag,jdbcType=CHAR},#{item.confirmFlag,jdbcType=INTEGER}," +
|
|
|
+ " #{item.serialNo,jdbcType=INTEGER},#{item.name,jdbcType=CHAR},#{item.chargeDate,jdbcType=TIMESTAMP},#{item.groupNo,jdbcType=CHAR},#{item.confirmTime,jdbcType=TIMESTAMP}," +
|
|
|
+ " #{item.drugname,jdbcType=CHAR},#{item.specification,jdbcType=CHAR},#{item.confirmId,jdbcType=CHAR},#{item.confirmName,jdbcType=CHAR}," +
|
|
|
+ " #{item.doctorId,jdbcType=CHAR},#{item.doctorName,jdbcType=CHAR},#{item.cyFy,jdbcType=INTEGER},#{item.inputId,jdbcType=CHAR},#{item.inputDate,jdbcType=TIMESTAMP}," +
|
|
|
+ " #{item.responseType,jdbcType=CHAR},#{item.selfFlag,jdbcType=CHAR},#{item.winNo,jdbcType=CHAR},#{item.groupNoOut,jdbcType=CHAR}," +
|
|
|
+ " #{item.warnDept,jdbcType=CHAR},#{item.inputTime,jdbcType=TIMESTAMP},#{item.realNo,jdbcType=INTEGER},#{item.manuNo,jdbcType=CHAR})" +
|
|
|
+ "</foreach>" +
|
|
|
+ "</script>"
|
|
|
+ })
|
|
|
+ int batchInsertFyclFytj(@Param(value = "mzFytjList") List<YpMzFytj> mzFytjList);
|
|
|
+
|
|
|
/**
|
|
|
* 发药处理修改收费详细发药状态
|
|
|
*
|
|
@@ -959,6 +1082,12 @@ public interface MzPharmacyMapper {
|
|
|
" and c.charge_item_code = y.code and c.serial = y.serial and y.class_code = '210100' group by y.code,y.name,y.manu_code,y.specification,y.serial,c.unit_price")
|
|
|
List<Map<String, Object>> selectRadSendStat(@Param("startTime") String startTime,@Param("endTime") String endTime);
|
|
|
|
|
|
+ @Select("select sum(c.quantity)quantity,y.code,y.name,y.manu_code,y.specification,y.serial,c.unit_price" +
|
|
|
+ " from mz_charge_detail c WITH(NOLOCK),yp_zd_dict y WITH(NOLOCK) " +
|
|
|
+ " where c.group_no = '71' and c.charge_date >= #{addTime} and c.charge_date <= #{endTime} and c.confirm_time is null and c.confirm_flag in (0,2) and serial_no > 0" +
|
|
|
+ " and c.charge_item_code = y.code and c.serial = y.serial and y.class_code = '210100' group by y.code,y.name,y.manu_code,y.specification,y.serial,c.unit_price")
|
|
|
+ List<Map<String, Object>> selectRadSendStatAdd(@Param("addTime") String addTime,@Param("endTime") String endTime);
|
|
|
+
|
|
|
/**
|
|
|
* 根据缴费时间范围查询待发药处方
|
|
|
* @param startTime
|
|
@@ -972,6 +1101,13 @@ public interface MzPharmacyMapper {
|
|
|
" and c.charge_item_code = y.code and c.serial = y.serial and y.class_code = '210100' ")
|
|
|
List<MzChargeDetail> selectRadSendPrescription(@Param("startTime") String startTime,@Param("endTime") String endTime);
|
|
|
|
|
|
+ @Select("select distinct rtrim(c.patient_id)patient_id,c.times,c.order_no,c.quantity,c.unit_price,c.charge_item_code,y.serial " +
|
|
|
+ ",c.receipt_no,c.group_no,c.item_no,c.serial_no,c.doctor_code,c.windows_no_yf" +
|
|
|
+ " from mz_charge_detail c WITH(NOLOCK),yp_zd_dict y WITH(NOLOCK) " +
|
|
|
+ " where c.group_no = '71' and c.charge_date >= #{addTime} and c.charge_date <= #{endTime} and c.confirm_time is null and c.confirm_flag in (0,2) and serial_no > 0" +
|
|
|
+ " and c.charge_item_code = y.code and c.serial = y.serial and y.class_code = '210100' ")
|
|
|
+ List<MzChargeDetail> selectRadSendPrescriptionAdd(@Param("addTime") String addTime, @Param("endTime") String endTime);
|
|
|
+
|
|
|
/**
|
|
|
* 修改当前病人当前就诊次数下的西药房发药信息
|
|
|
*
|