|
@@ -0,0 +1,119 @@
|
|
|
+package thyyxxk.webserver.dao.his.yibao;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import org.apache.ibatis.annotations.*;
|
|
|
+import thyyxxk.webserver.entity.datamodify.YzActOrder;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 描述: 医嘱退费
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author xc
|
|
|
+ * @date 2021-09-17 10:25
|
|
|
+ */
|
|
|
+@Mapper
|
|
|
+public interface ZhuYuanYiZhuDao {
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ "select drug_flag, " +
|
|
|
+ " order_name, " +
|
|
|
+ " dose, " +
|
|
|
+ " dose_unit = b.name, " +
|
|
|
+ " drug_occ," +
|
|
|
+ " drug_quan, " +
|
|
|
+ " rtrim(frequ_code) frequ_code, " +
|
|
|
+ " supply_code_name = c.supply_name, " +
|
|
|
+ " start_time, " +
|
|
|
+ " end_time, " +
|
|
|
+ " physician_name = d.name, " +
|
|
|
+ " order_code, " +
|
|
|
+ " drug_specification, " +
|
|
|
+ " exec_unit_name = e.name, " +
|
|
|
+ " group_no = (select rtrim(group_name) from yp_zd_group_name where a.group_no = yp_zd_group_name.group_no), " +
|
|
|
+ " serial, " +
|
|
|
+ " discription, " +
|
|
|
+ " act_order_no," +
|
|
|
+ " isnull(tf_flag,0) tf_flag " +
|
|
|
+ "from yz_act_order a ,yp_zd_unit b ,yz_supply_type c, a_employee_mi d , zd_unit_code e " +
|
|
|
+ "where group_no != 00 and frequ_code = 'ONCE' and a.dose_unit = b.code and a.supply_code = c.supply_code " +
|
|
|
+ "and a.physician = d.code and a.exec_unit = e.code and infant_flag = #{infantFlag} " +
|
|
|
+ "and inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} " +
|
|
|
+ "<if test=\"orderCode != null and orderCode != '' \">" +
|
|
|
+ "and order_code = #{orderCode} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"actOrderNo != null\">" +
|
|
|
+ "and act_order_no = #{actOrderNo} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"startTime != null and startTime != '' \">" +
|
|
|
+ "and order_time >= #{startTime} and order_time <= #{endTime} " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test=\"tfFlag != null and tfFlag != 3 \">" +
|
|
|
+ "and isnull(tf_flag,0) = #{tfFlag}" +
|
|
|
+ "</if>" +
|
|
|
+ "</script>")
|
|
|
+ IPage<YzActOrder> getYzXinXi(IPage<YzActOrder> page,
|
|
|
+ @Param("inpatientNo") String inpatientNo,
|
|
|
+ @Param("admissTimes") Integer admissTimes,
|
|
|
+ @Param("orderCode") String orderCode,
|
|
|
+ @Param("actOrderNo") BigDecimal actOrderNo,
|
|
|
+ @Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime,
|
|
|
+ @Param("infantFlag") int infantFlag,
|
|
|
+ @Param("tfFlag") int tfFlag);
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ "select order_code, order_name, frequ_code, discription, infant_flag, " +
|
|
|
+ " order_time, start_time, confirm_time,status_time,enter_time, end_time,performance_time,print_order_change,refer_physician,consult_physician," +
|
|
|
+ " drug_specification, drug_quan,drug_flag,act_order_no, " +
|
|
|
+ " mini_unit, drug_weight_unit,self_buy, dose, dose_unit, drug_occ, drug_volume, " +
|
|
|
+ " drug_vol_unit, pay_self, serial, group_no, doctor_flag,isnull(tf_flag,0) tf_flag, " +
|
|
|
+ " inpatient_no, admiss_times, exec_unit, dept_code, ward_code, reg_flag, yb_self_flag " +
|
|
|
+ " from yz_act_order where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and act_order_no in " +
|
|
|
+ "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
+ " #{item.actOrderNo} " +
|
|
|
+ "</foreach>" +
|
|
|
+ "</script>")
|
|
|
+ List<YzActOrder> yuanYiZhu(@Param("inpatientNo") String inpatientNo,
|
|
|
+ @Param("admissTimes") Integer admissTimes,
|
|
|
+ @Param("list") List<YzActOrder> tuiFeiList);
|
|
|
+
|
|
|
+ @Insert("<script>" +
|
|
|
+ "INSERT INTO " +
|
|
|
+ " yz_act_order " +
|
|
|
+ "( order_code, order_name, frequ_code, discription, infant_flag, " +
|
|
|
+ " order_time, start_time, confirm_time,status_time,enter_time, " +
|
|
|
+ " drug_specification, drug_quan,drug_flag, " +
|
|
|
+ " act_order_no, " +
|
|
|
+ " mini_unit, drug_weight_unit,self_buy, dose, dose_unit, drug_occ, drug_volume, " +
|
|
|
+ " drug_vol_unit, pay_self, serial, group_no, doctor_flag, " +
|
|
|
+ " inpatient_no, admiss_times, exec_unit, dept_code, ward_code, reg_flag, yb_self_flag, " +
|
|
|
+ " supply_code, " +
|
|
|
+ " status_flag, " +
|
|
|
+ " enter_oper,physician,signer,tf_flag,end_time,performance_time,print_order_change,refer_physician,consult_physician) values " +
|
|
|
+ "<foreach collection='list' item='item' separator=','>" +
|
|
|
+ "(#{item.orderCode},#{item.orderName},#{item.frequCode},#{item.discription},#{item.infantFlag}, " +
|
|
|
+ "#{item.orderTime},#{item.startTime},#{item.confirmTime},#{item.statusTime},#{item.enterTime}, " +
|
|
|
+ "#{item.drugSpecification}, cast(#{item.drugQuan,jdbcType=DECIMAL} as decimal(14,5)),#{item.drugFlag}, " +
|
|
|
+ "#{item.newActOrderNo},#{item.miniUnit},#{item.drugWeightUnit},#{item.selfBuy},cast(#{item.dose,jdbcType=DECIMAL} as decimal(14,5)),#{item.doseUnit}, " +
|
|
|
+ "cast(#{item.drugOcc,jdbcType=DECIMAL} as decimal(14,5)),cast(#{item.drugVolume,jdbcType=DECIMAL} as decimal(14,5)) ,#{item.drugVolUnit},#{item.paySelf},#{item.serial},#{item.groupNo},#{item.doctorFlag}, " +
|
|
|
+ "#{item.inpatientNo},#{item.admissTimes},#{item.execUnit},#{item.deptCode},#{item.wardCode},#{item.regFlag},#{item.ybSelfFlag}, " +
|
|
|
+ "'068','2',#{code},#{code},#{code},2,#{item.endTime},#{item.performanceTime},#{item.printOrderChange},#{item.referPhysician},#{item.consultPhysician})" +
|
|
|
+ "</foreach>" +
|
|
|
+ "</script>")
|
|
|
+ void yiZhuTuiFei(@Param("list") List<YzActOrder> list,
|
|
|
+ @Param("code") String code);
|
|
|
+
|
|
|
+ @Update("<script>" +
|
|
|
+ "update yz_act_order set tf_flag = 1 where inpatient_no = #{inpatientNo} and admiss_times = #{admissTimes} and act_order_no in " +
|
|
|
+ "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
|
|
|
+ "#{item.actOrderNo}" +
|
|
|
+ "</foreach>" +
|
|
|
+ "</script>")
|
|
|
+ void genXinTuiFeiFlag(@Param("inpatientNo") String inpatientNo,
|
|
|
+ @Param("admissTimes") Integer admissTimes,
|
|
|
+ @Param("list") List<YzActOrder> list);
|
|
|
+}
|