|
@@ -1,9 +1,7 @@
|
|
|
package thyyxxk.webserver.dao.his.executeItem;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
-import org.apache.ibatis.annotations.Insert;
|
|
|
-import org.apache.ibatis.annotations.Mapper;
|
|
|
-import org.apache.ibatis.annotations.Update;
|
|
|
+import org.apache.ibatis.annotations.*;
|
|
|
import thyyxxk.webserver.entity.executeItem.YpZyPatient;
|
|
|
import thyyxxk.webserver.entity.executeItem.YzYpZyOrder;
|
|
|
|
|
@@ -69,5 +67,72 @@ public interface YzYpZyOrderDao extends BaseMapper<YzYpZyOrder> {
|
|
|
" </foreach> " +
|
|
|
" </script> ")
|
|
|
int batchInsertYpZyPatient(List<YpZyPatient> list);
|
|
|
+ @Insert(" insert into yz_yp_zy_order (inpatient_no, admiss_times, name, bed_no, dept_code, ward_code, charge_code, amount, retprice, charge_date, infant_flag, drawer, always_flag, status_flag, drug_class, serail, occ_time, act_order_no, page_no, pay_self, self_flag, separate_flag, suprice_flag, drug_flag, serial, group_no, doctor_name, zy_serial_no, page_class, yb_self_flag, ledger_sn, detail_sn) values" +
|
|
|
+ " ( #{item.inpatientNo},#{item.admissTimes} ,#{item.name}, #{item.bedNo}, #{item.deptCode}, #{item.wardCode}, #{item.chargeCode}, #{item.amount,jdbcType=DECIMAL}, #{item.retprice,jdbcType=DECIMAL}, #{item.chargeDate,jdbcType=TIMESTAMP}, #{item.infantFlag}, #{item.drawer},#{item.alwaysFlag}, #{item.statusFlag}, #{item.drugClass}, #{item.serail}, #{item.occTime,jdbcType=TIMESTAMP}, ${item.actOrderNoStr} ,#{item.pageNo,jdbcType=DECIMAL} , #{item.paySelf}, #{item.selfFlag}, #{item.separateFlag}, #{item.supriceFlag}, #{item.drugFlag}, #{item.serial}, #{item.groupNo}, #{item.doctorName}, #{item.zySerialNo}, #{item.pageClass}, #{item.ybSelfFlag}, #{item.ledgerSn}, #{item.detailSn}) ")
|
|
|
+ int insertOne(@Param("item") YzYpZyOrder yzYpZyOrder);
|
|
|
+
|
|
|
+ @Select(" select order_date, out_seri, dept_code, ward_code, section_code, inpatient_no, name, bed_no, charge_code, retprice, amount, infant_flag, drawer, keeper, date1, date2, always_flag, drug_class, acct_sign, total_flag, admiss_times, supply_code, act_order_no, page_no, self_flag, separate_flag, suprice_flag, drug_flag, pay_self, group_no, confirm_time, serial, doctor_name, country_flag, zy_serial_no, page_type, jy_flag, manu_no from yp_zy_patient where act_order_no = ${actOrderNoStr} and order_date > #{endTime} and amount > 0 ")
|
|
|
+ List<YpZyPatient> selectYpZyPatientByOccTime(@Param("actOrderNoStr") String actOrderNoStr, @Param("endTime") String endTime);
|
|
|
+ @Update(" update yz_yp_zy_order set amount=-amount where act_order_no=${actOrderNoStr} and occ_time > #{endTime} ")
|
|
|
+ int updateTfAmount(@Param("actOrderNoStr") String actOrderNoStr, @Param("endTime") String endTime);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询需要执行时间超过结束时间的医嘱
|
|
|
+ * @author lihong
|
|
|
+ * @since 2025/8/7 15:07
|
|
|
+ * @param
|
|
|
+ * @param wardCode
|
|
|
+ * @return List<YzYpZyOrder>
|
|
|
+ **/
|
|
|
+ @Select(" SELECT yz_yp_zy_order.act_order_no, " +
|
|
|
+ " yz_yp_zy_order.charge_code, " +
|
|
|
+ " yz_yp_zy_order.occ_time, " +
|
|
|
+ " yz_yp_zy_order.status_flag, " +
|
|
|
+ " yz_yp_zy_order.amount, " +
|
|
|
+ " yz_yp_zy_order.pay_self, " +
|
|
|
+ " yz_yp_zy_order.inpatient_no, " +
|
|
|
+ " yz_yp_zy_order.admiss_times, " +
|
|
|
+ " yz_yp_zy_order.name, " +
|
|
|
+ " yz_yp_zy_order.bed_no, " +
|
|
|
+ " yz_yp_zy_order.dept_code, " +
|
|
|
+ " yz_yp_zy_order.ward_code, " +
|
|
|
+ " yz_yp_zy_order.retprice, " +
|
|
|
+ " yz_yp_zy_order.charge_date, " +
|
|
|
+ " yz_yp_zy_order.infant_flag, " +
|
|
|
+ " yz_yp_zy_order.drawer, " +
|
|
|
+ " yz_yp_zy_order.always_flag, " +
|
|
|
+ " yz_yp_zy_order.drug_class, " +
|
|
|
+ " yz_yp_zy_order.serail, " +
|
|
|
+ " yz_yp_zy_order.page_no, " +
|
|
|
+ " yz_yp_zy_order.self_flag, " +
|
|
|
+ " yz_yp_zy_order.separate_flag, " +
|
|
|
+ " yz_yp_zy_order.suprice_flag, " +
|
|
|
+ " yz_yp_zy_order.drug_flag, " +
|
|
|
+ " yz_yp_zy_order.serial, " +
|
|
|
+ " yz_yp_zy_order.group_no, " +
|
|
|
+ " yz_yp_zy_order.doctor_name " +
|
|
|
+ "FROM yz_yp_zy_order ,yz_act_order b " +
|
|
|
+ "WHERE yz_yp_zy_order.dept_code = #{wardCode} and " +
|
|
|
+ " yz_yp_zy_order.ward_code = #{wardCode} and " +
|
|
|
+ " yz_yp_zy_order.status_flag in ('3','4') and " +
|
|
|
+ " yz_yp_zy_order.amount > 0 and " +
|
|
|
+ " yz_yp_zy_order.occ_time > b.end_time and " +
|
|
|
+ " yz_yp_zy_order.inpatient_no=b.inpatient_no and " +
|
|
|
+ " yz_yp_zy_order.admiss_times=b.admiss_times and " +
|
|
|
+ " yz_yp_zy_order.act_order_no=b.act_order_no and " +
|
|
|
+ " yz_yp_zy_order.drug_class <> 'd'")
|
|
|
+ List<YzYpZyOrder> selectYzYpZyOrderByEnd(@Param("wardCode") String wardCode);
|
|
|
+
|
|
|
+ @Delete(" delete a from yz_yp_zy_order as a join yz_act_order b on a.inpatient_no=b.inpatient_no " +
|
|
|
+ " and a.admiss_times=b.admiss_times " +
|
|
|
+ " and a.act_order_no = b.act_order_no " +
|
|
|
+ " where a.drug_class <>'d' " +
|
|
|
+ " and a.occ_time > b.end_time " +
|
|
|
+ " and a.amount > 0" +
|
|
|
+ " and a.status_flag in ('3','4') " +
|
|
|
+ " and a.dept_code = #{wardCode} " +
|
|
|
+ " and a.ward_code = #{wardCode} ")
|
|
|
+ int deleteYzYpZyOrderEnd(@Param("wardCode") String wardCode);
|
|
|
+
|
|
|
}
|
|
|
|