package thyyxxk.webserver.dao.his.zhuyuanyisheng; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.*; import thyyxxk.webserver.entity.datamodify.GetDropdownBox; import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.OpRecord; import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.ShouShuFanHui; import thyyxxk.webserver.entity.zhuyuanyisheng.shoushu.ZdIcd9Cm3; import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.XinZhenYiZhu; import java.util.List; import java.util.Map; /** *

* 描述: 手术申请 *

* * @author xc * @date 2022-02-22 15:45 */ @Mapper public interface ShouShuShenQingDao extends BaseMapper { @Select("") List obtainSurgicalItems(String name, Integer type); @Select("select rtrim(op_name) as value " + "from op_record with (NOLOCK) " + "where inpatient_no = #{patNo} " + " and admiss_times = #{times}" + " and op_name like #{name} ") List> huoQuShouShuMing(@Param("patNo") String patNo, @Param("times") Integer times, @Param("name") String name); @Select("SELECT a.code, a.name " + "FROM ysh_zd_ss_type a with (NOLOCK), " + " yz_order_item b with (NOLOCK) " + "where a.code = b.ss_type " + " and isnull(b.del_flag, '') <> '1' " + " and b.operation = 'p' " + "group by a.code, a.name " + "order by a.name") List shouShuShenQingCeBianLan(); @Select("select a.record_id /*申请单号*/," + " a.op_name," + " a.urgent_clinic_flag," + " a.apply_date, " + " part_code, " + " dept_code, " + " dept_code_name = (select rtrim(name) from zd_unit_code with (NOLOCK) where code = dept_code), " + " urgent_clinic_flag, " + " inpatient_no, " + " admiss_times, " + " bed_no, " + " patient_name, " + " diag_before_op /* 术前诊断 */, " + " diag_before_code, " + " hocus_code, " + " hocus_code_name = (select rtrim(name) from zd_anaesthesia with (NOLOCK) where code = hocus_code), " + " op_scale, " + " /*术后等级不知道*/ " + " doctor_zd_name = (select rtrim(name) from a_employee_mi with (NOLOCK) where code = doctor_zd)/*主刀医生*/, " + " doctor_1_name = (select rtrim(name) from a_employee_mi with (NOLOCK) where code = doctor_1)/*第1助手*/, " + " doctor_2_name = (select rtrim(name) from a_employee_mi with (NOLOCK) where code = doctor_2)/*第2助手*/, " + " doctor_3_name = (select rtrim(name) from a_employee_mi with (NOLOCK) where code = doctor_3)/*第2助手*/, " + " doctor_mz_name = (select rtrim(name) from a_employee_mi with (NOLOCK) where code = doctor_mz)/*麻醉医生*/, " + " nurse_qx_name = (select rtrim(name) from a_employee_mi with (NOLOCK) where code = nurse_qx)/*器械护士*/, " + " nurse_xh_name = (select rtrim(name) from a_employee_mi with (NOLOCK) where code = nurse_xh)/*巡回护士*/, " + " req_date, " + " op_datetime, " + " remark/*附注说明*/ " + "from op_record a with (NOLOCK), " + " op_record_join b with (NOLOCK)" + "where inpatient_no = #{patNo} " + " and admiss_times = #{times} " + " and a.record_id = #{recordId} " + " and a.record_id = b.record_id") OpRecord daYingShouShu(@Param("patNo") String patNo, @Param("times") Integer times, @Param("recordId") Integer recordId); @Select("select refer_physician_name = (select rtrim(name) from a_employee_mi with (NOLOCK) where code = refer_physician) /*住院医生*/, " + " dept_director_name = (select rtrim(name) from a_employee_mi with (NOLOCK) where code = dept_director) /*科主任*/, " + " sex, " + " birth_date = (select (convert(varchar(10), birth_date, 21)) " + " from a_patient_mi with (NOLOCK) " + " where zy_actpatient.inpatient_no = a_patient_mi.inpatient_no) " + "from zy_actpatient with (NOLOCK) " + "where inpatient_no = #{patNo} " + " and admiss_times = #{times};") OpRecord daYingHuanZheXinXi(@Param("patNo") String patNo, @Param("times") Integer times); @Select("") IPage fenLeiXiangQing(IPage page, @Param("code") String code, @Param("name") String name); @Select("select code,name from op_zd_part_new " + "with (NOLOCK) where " + "(name like #{code} or py_code like #{code} or d_code like #{code} or code like #{code})") List huoQuShouShuBuWei(String code); @Select("Select isnull(Max(op_times),0) " + "From op_record with (NOLOCK) " + "Where inpatient_no = #{patNo} " + " And admiss_times = #{times} ") Integer shouShuShenQingCiShu(@Param("patNo") String patNo, @Param("times") Integer times); @Insert("") void chaRuShouShuYiSheng(@Param("list") List list); @Insert("") void chaRuShouShu(@Param("list") List list, @Param("patNo") String patNo, @Param("name") String name, @Param("times") Integer times, @Param("dept") String dept, @Param("ward") String ward, @Param("userCode") String userCode, @Param("bedNo") String bedNo, @Param("admissWard") String admissWard); @Insert("") void chaRuYiZhu(@Param("list") List list, @Param("p") XinZhenYiZhu p, @Param("userCode") String userCode, @Param("execUnit") String execUnit, @Param("yzCode") String yzCode); @Select("select * from op_record with (NOLOCK) where record_id = #{id}") OpRecord shouShuXinXi(Integer id); @Update("update op_record set status = 'd' where record_id = #{id}") void genXingShanChuBiaoZhi(Integer id); @Select("select count(1) from op_zd_part where name = #{name} and del_flag = 0") Boolean repeatPartName(String name); @Select("select cast(max(code) as INTEGER) as code from op_zd_part") Integer getTheMaximumSurgicalCode(); @Insert("insert into op_zd_part (code, name, py_code, d_code) " + "values (#{code}, #{name}, #{py}, #{wb})") void insertNewSurgicalSite(@Param("code") String code, @Param("name") String name, @Param("py") String py, @Param("wb") String wb); @Update("update op_zd_part set del_flag = 1 where code = #{code}") void removeSurgicalSite(String code); }