ソースを参照

住院医生dao中添加with (NOLOCK)

xiaochan 3 年 前
コミット
5551fc6df4

+ 14 - 14
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/CaoYaoYiZhuDao.java

@@ -39,7 +39,7 @@ public interface CaoYaoYiZhuDao {
             "       input_date," +
             "       exec_dept, " +
             "       exec_dept_name = (select name from zd_unit_code where code = exec_dept) " +
-            "from yz_act_order_cy " +
+            "from yz_act_order_cy with (NOLOCK) " +
             "${ew.customSqlSegment} ")
     IPage<YzActOrderCy> huoQuCaoYaoShuJu(IPage<YzActOrderCy> page,
                                          @Param(Constants.WRAPPER) Wrapper<?> wp);
@@ -50,20 +50,20 @@ public interface CaoYaoYiZhuDao {
      *
      * @return 返回金额
      */
-    @Select("select isnull(charge_amount,0) from zd_charge_item where code = (select charge_code_zydj from yz_sequence) ")
+    @Select("select isnull(charge_amount,0) from zd_charge_item with (NOLOCK) where code = (select charge_code_zydj from yz_sequence) ")
     BigDecimal huoQuDaiJianFei();
 
 
-    @Select("select chargeCodeName = (select rtrim(name) from view_yp_zd_dict_base_yf where code = charge_code)," +
+    @Select("select chargeCodeName = (select rtrim(name) from view_yp_zd_dict_base_yf with (NOLOCK) where code = charge_code)," +
             "       group_no_name  = (select rtrim(group_name) " +
-            "                         from yp_zd_group_name " +
+            "                         from yp_zd_group_namewith (NOLOCK)  " +
             "                         where yz_act_order_cy_detail.group_no = yp_zd_group_name.group_no), " +
             "       * " +
-            "from yz_act_order_cy_detail " +
+            "from yz_act_order_cy_detail with (NOLOCK) " +
             "where order_no = #{orderNo}")
     List<YzActOrderCyDetail> huoQuChaoYaoMingXi(BigDecimal orderNo);
 
-    @Select("SELECT code, name FROM mzysh_zd_fysm")
+    @Select("SELECT code, name FROM mzysh_zd_fysm with (NOLOCK)")
     List<GetDropdownBox> fuYongFangFa();
 
 
@@ -81,7 +81,7 @@ public interface CaoYaoYiZhuDao {
             "    retprice=pack_retprice, " +
             "    self_flag   = isnull(self_flag, '0'), " +
             "                  suprice_flag " +
-            "FROM view_yp_zd_dict_base_yf " +
+            "FROM view_yp_zd_dict_base_yf with (NOLOCK) " +
             "${ew.customSqlSegment} AND isnull(visible_flag_zy, '') <> '1' ")
     IPage<YiZhuMingChen> huoQuCaoYao(IPage<YiZhuMingChen> page,
                                      @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
@@ -90,7 +90,7 @@ public interface CaoYaoYiZhuDao {
     @Select("select pattern_name, " +
             "       group_no =max(group_no), " +
             "       dept_code=max(dept_code) " +
-            "from yz_order_pattern_cy " +
+            "from yz_order_pattern_cy with (NOLOCK) " +
             " ${ew.customSqlSegment} ")
     IPage<YzOrderPatternCy> huoQuMuBan(IPage<YzOrderPatternCy> page,
                                        @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
@@ -107,9 +107,9 @@ public interface CaoYaoYiZhuDao {
             "                b.specification, " +
             "                b.self_flag, " +
             "                b.suprice_flag " +
-            "FROM yz_order_pattern_cy a, " +
-            "     yp_zd_dict b, " +
-            "     yp_base_yf c " +
+            "FROM yz_order_pattern_cy a with (NOLOCK), " +
+            "     yp_zd_dict b with (NOLOCK), " +
+            "     yp_base_yf c with (NOLOCK) " +
             "where a.charge_code = b.code " +
             "  and a.serial = b.serial " +
             "  and a.charge_code = c.charge_code " +
@@ -125,7 +125,7 @@ public interface CaoYaoYiZhuDao {
                                           @Param("deptCode") String deptCode);
 
     @Select("select count(1) " +
-            "from yz_order_pattern_cy " +
+            "from yz_order_pattern_cy with (NOLOCK) " +
             "where pattern_name = #{name}")
     Integer chongFuMuBanMing(String name);
 
@@ -196,13 +196,13 @@ public interface CaoYaoYiZhuDao {
                     @Param("infantFlag") Integer infantFlag);
 
 
-    @Select("select top(1) * from yz_order_pattern_cy where pattern_name = #{name}")
+    @Select("select top(1) * from yz_order_pattern_cy with (NOLOCK) where pattern_name = #{name}")
     YzOrderPatternCy caoYaoMuBanXiangQing(String name);
 
     @Delete("delete from yz_order_pattern_cy where pattern_name = #{name} ")
     void shanChuMuBan(String name);
 
-    @Select("select * from yz_act_order_cy " +
+    @Select("select * from yz_act_order_cy with (NOLOCK) " +
             "where inpatient_no = #{patNo} and admiss_times = #{times} and order_no = #{orderNo}")
     YzActOrderCy caoYaoXinXi(@Param("patNo") String patNo,
                              @Param("times") Integer times,

+ 34 - 34
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/JianYanJianChaDao.java

@@ -29,7 +29,7 @@ public interface JianYanJianChaDao {
 
     @Select("select order_code code, " +
             "       rtrim(order_name) value " +
-            "from ysh_yj_req " +
+            "from ysh_yj_req with (NOLOCK) " +
             "where inpatient_no = #{patNo} " +
             "  and admiss_times = #{times} " +
             "  and bed_no = #{bedNo} " +
@@ -44,7 +44,7 @@ public interface JianYanJianChaDao {
 
     @Select("<script>" +
             "select order_name,req_no,act_order_no, start_time,inpatient_no,admiss_times,receive_flag " +
-            "from ysh_yj_req " +
+            "from ysh_yj_req with (NOLOCK) " +
             "where inpatient_no = #{patNo}" +
             "  and admiss_times = #{times} " +
             "  and req_type = '3' " +
@@ -66,19 +66,19 @@ public interface JianYanJianChaDao {
     @Select("select *, " +
             "       req_dept_name   = (select rtrim(name) from zd_unit_code where code = req_dept), " +
             "       req_doctor_name = (select rtrim(name) from a_employee_mi where code = req_doctor) " +
-            "from ysh_yj_req " +
+            "from ysh_yj_req with (NOLOCK) " +
             "where req_no = #{reqNo}")
     YshYjReq huoQuShengQingXiangQing(@Param("reqNo") Integer reqNo);
 
     @Select("select sex, " +
             "       home_street," +
             "       home_tel " +
-            "from a_patient_mi " +
+            "from a_patient_mi with (NOLOCK) " +
             "where inpatient_no = #{patNo}")
     PatientTemp huoQuHuanZheXinXi(@Param("patNo") String patNo);
 
     @Select("select responce_type_name = (select rtrim(name) from zy_zd_responce_type where code = responce_type) " +
-            "from zy_actpatient " +
+            "from zy_actpatient with (NOLOCK) " +
             "where inpatient_no = #{patNo}")
     String huoQuHuanZheShenFen(@Param("patNo") String patNo);
 
@@ -91,7 +91,7 @@ public interface JianYanJianChaDao {
             "       comment6, " +
             "       comment7, " +
             "       comment8 " +
-            "from jc_zd_class " +
+            "from jc_zd_class with (NOLOCK) " +
             "where code = #{code}")
     JcZdClass daYingXiangQing(@Param("code") String code);
 
@@ -134,7 +134,7 @@ public interface JianYanJianChaDao {
     @Select("<script>" +
             "SELECT tc_name name, " +
             "       tc_no   code " +
-            "FROM zy_tc_yj " +
+            "FROM zy_tc_yj with (NOLOCK) " +
             "where isnull(del_flag, '0') &lt;&gt; '1' " +
             "  and req_type = #{reqType} " +
             "<if test=\"leiXing == 2\">" +
@@ -158,9 +158,9 @@ public interface JianYanJianChaDao {
             "       a.exec_dept as execDept," +
             "       (select rtrim(name) from zd_unit_code where code = a.exec_dept) execDeptName," +
             "       getdate() as startTime " +
-            "FROM yz_order_item a, " +
-            "     jc_zd_item b, " +
-            "     ysh_zd_part_code c " +
+            "FROM yz_order_item a with (NOLOCK), " +
+            "     jc_zd_item b with (NOLOCK), " +
+            "     ysh_zd_part_code c with (NOLOCK) " +
             "where a.order_type = #{orderType} " +
             "          and isnull(b.bw_code, 0) = #{bwCode} and " +
             "      isnull(a.del_flag, '') <> '1' and " +
@@ -175,12 +175,12 @@ public interface JianYanJianChaDao {
             "               rtrim(a.yb_comment)                                             ybComment, " +
             "    checkFlag='0', " +
             "               a.exec_dept   as                                                execDept, " +
-            "               (select rtrim(name) from zd_unit_code where code = a.exec_dept) execDeptName, " +
+            "               (select rtrim(name) from zd_unit_code with (NOLOCK) where code = a.exec_dept) execDeptName, " +
             "               getdate()     as                                                startTime, " +
             "               b.sample_code as                                                inspectStuff," +
-            "    (select name from jy_zd_sample where jy_zd_sample.code = b.sample_code) as inspectStuffName " +
-            "FROM yz_order_item a, " +
-            "     jy_zd_item b " +
+            "    (select name from jy_zd_sample with (NOLOCK) where jy_zd_sample.code = b.sample_code) as inspectStuffName " +
+            "FROM yz_order_item a with (NOLOCK), " +
+            "     jy_zd_item b with (NOLOCK) " +
             "where jy_type = #{code} " +
             "  and isnull(a.del_flag, '') <> '1' " +
             "  and a.order_code = b.zy_order_code " +
@@ -188,7 +188,7 @@ public interface JianYanJianChaDao {
     List<Map<String, String>> chaKanJianYanXiangQing(@Param("code") String code);
 
     @Select("select op_id,tc_exec " +
-            "from zy_tc_yj " +
+            "from zy_tc_yj with (NOLOCK) " +
             "where tc_no = #{code}")
     ZyTcYj jianChaLuRuRen(String code);
 
@@ -205,13 +205,13 @@ public interface JianYanJianChaDao {
             "       '0'                 as                                          checkFlag, " +
             "       a.exec_dept         as                                          execDept, " +
             "       a.order_type        as                                          orderType, " +
-            "       (select rtrim(name) from zd_unit_code where code = a.exec_dept) execDeptName, " +
+            "       (select rtrim(name) from zd_unit_code with (NOLOCK) where code = a.exec_dept) execDeptName, " +
             "       getdate()           as                                          startTime," +
             "       inspect_stuff, " +
-            "       inspectStuffName = (select rtrim(name) from jy_zd_sample where code = inspect_stuff) " +
-            "FROM yz_order_item a, " +
-            "     zy_tc_detail_yj b, " +
-            "     zy_tc_yj c " +
+            "       inspectStuffName = (select rtrim(name) from jy_zd_sample with (NOLOCK) where code = inspect_stuff) " +
+            "FROM yz_order_item a with (NOLOCK), " +
+            "     zy_tc_detail_yj b with (NOLOCK), " +
+            "     zy_tc_yj c with (NOLOCK) " +
             "where b.tc_no = c.tc_no " +
             "  and b.tc_no = #{code} " +
             "  and c.req_type = #{reqType} " +
@@ -223,7 +223,7 @@ public interface JianYanJianChaDao {
 
     @Select("<script>" +
             "SELECT jc_text,name,code,wh_flag,op_id " +
-            "FROM ysh_zd_yj_template " +
+            "FROM ysh_zd_yj_template with (NOLOCK) " +
             "WHERE (py_code like #{name} or d_code like #{name} or name like #{name}) " +
             "<if test=\"leiXing == 1\">" +
             "  and op_id = #{userCode} " +
@@ -240,7 +240,7 @@ public interface JianYanJianChaDao {
                                              @Param("leiXing") Integer leiXing,
                                              @Param("userCode") String userCode);
 
-    @Select("select * from ysh_zd_yj_template where code = #{code}")
+    @Select("select * from ysh_zd_yj_template with (NOLOCK) where code = #{code}")
     YshZdYjTemplate muBanShuJu(String code);
 
     @Update("update ysh_zd_yj_template " +
@@ -266,13 +266,13 @@ public interface JianYanJianChaDao {
 
 
     @Select("select diagnosis_code as code, diagnosis_name as name " +
-            "from t_si_dl_dss_dns " +
+            "from t_si_dl_dss_dns with (NOLOCK) " +
             "where (diagnosis_code like #{name} or diagnosis_name like #{name} or py_code like #{name})")
     List<GetDropdownBox> yiBaoZhenDuan(String name);
 
     @Select("SELECT rtrim(a.code) as code, " +
             "       rtrim(a.name) as name " +
-            "FROM zd_icd_code a " +
+            "FROM zd_icd_code a with (NOLOCK) " +
             "where (a.py_code like #{name} " +
             "    or a.code like #{name} " +
             "    or a.name like #{name}) " +
@@ -280,7 +280,7 @@ public interface JianYanJianChaDao {
     List<GetDropdownBox> benYuanLinChuangZhenDuan(String name);
 
     @Select("select tc_no " +
-            "from zy_tc_yj " +
+            "from zy_tc_yj with (NOLOCK) " +
             "where op_id = #{code} " +
             "  and tc_name = #{name}" +
             "  and req_type = #{reqType} ")
@@ -374,17 +374,17 @@ public interface JianYanJianChaDao {
             "       order_code, " +
             "       req_comment, " +
             "       req_doctor, " +
-            "       req_doctor_name= (select rtrim(name) from a_employee_mi where code = req_doctor), " +
+            "       req_doctor_name= (select rtrim(name) from a_employee_mi with (NOLOCK) where code = req_doctor), " +
             "       req_dept, " +
-            "       req_dept_name = (select rtrim(name) from zd_unit_code where code = req_dept), " +
+            "       req_dept_name = (select rtrim(name) from zd_unit_code with (NOLOCK) where code = req_dept), " +
             "       exec_dept, " +
-            "       exec_dept_name = (select rtrim(name) from zd_unit_code where code = exec_dept), " +
+            "       exec_dept_name = (select rtrim(name) from zd_unit_code with (NOLOCK) where code = exec_dept), " +
             "       req_date, " +
             "       inspect_stuff, " +
-            "       inspect_stuff_name = (select rtrim(name) from jy_zd_sample where code = inspect_stuff), " +
+            "       inspect_stuff_name = (select rtrim(name) from jy_zd_sample with (NOLOCK) where code = inspect_stuff), " +
             "       jz_flag," +
             "       receive_flag " +
-            "from ysh_yj_req " +
+            "from ysh_yj_req with (NOLOCK) " +
             "where inpatient_no = #{patNo} " +
             "  and admiss_times = #{times} " +
             "  and req_type = '2'" +
@@ -405,15 +405,15 @@ public interface JianYanJianChaDao {
 
     @Select("SELECT rtrim(a.code) as code, " +
             "       rtrim(a.name) as name " +
-            "FROM jy_zd_class a, " +
-            "     yz_order_item b " +
+            "FROM jy_zd_class a with (NOLOCK), " +
+            "     yz_order_item b with (NOLOCK) " +
             "where a.code = b.jy_type " +
             "  and isnull(b.del_flag, '') <> '1' " +
             "group by a.code, a.name ")
     IPage<JcZdClass> jianYanFenLei(IPage<JcZdClass> page);
 
 
-    @Select("select rtrim(code) as code,name from jy_zd_sample " +
+    @Select("select rtrim(code) as code,name from jy_zd_sample with (NOLOCK) " +
             "where (name like #{name} " +
             "    or py_code like #{name} " +
             "    or code like #{name} or d_code like #{name} )")
@@ -421,7 +421,7 @@ public interface JianYanJianChaDao {
 
 
     @Select("select * " +
-            "from ysh_yj_req where req_no = #{reqNo} and inpatient_no = #{patNo} and admiss_times = #{times}")
+            "from ysh_yj_req with (NOLOCK) where req_no = #{reqNo} and inpatient_no = #{patNo} and admiss_times = #{times}")
     YshYjReq huoQuJianYanJianCha(@Param("reqNo") Integer reqNo,
                                  @Param("patNo") String patNo,
                                  @Param("times") Integer times);

+ 22 - 22
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/ShouShuShenQingDao.java

@@ -22,7 +22,7 @@ import java.util.Map;
 public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
 
     @Select("select rtrim(op_name) as  value " +
-            "from op_record " +
+            "from op_record with (NOLOCK) " +
             "where inpatient_no = #{patNo} " +
             "  and admiss_times = #{times}" +
             "  and op_name like #{name} ")
@@ -31,8 +31,8 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
                                                @Param("name") String name);
 
     @Select("SELECT a.code, a.name " +
-            "FROM ysh_zd_ss_type a, " +
-            "     yz_order_item b " +
+            "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' " +
@@ -47,7 +47,7 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
             "       a.apply_date, " +
             "       part_code, " +
             "       dept_code, " +
-            "       dept_code_name  = (select rtrim(name) from zd_unit_code where 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, " +
@@ -56,21 +56,21 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
             "       diag_before_op /* 术前诊断 */, " +
             "       diag_before_code, " +
             "       hocus_code, " +
-            "       hocus_code_name = (select rtrim(name) from zd_anaesthesia where 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 where code = doctor_zd)/*主刀医生*/, " +
-            "       doctor_1_name   = (select rtrim(name) from a_employee_mi where code = doctor_1)/*第1助手*/, " +
-            "       doctor_2_name   = (select rtrim(name) from a_employee_mi where code = doctor_2)/*第2助手*/, " +
-            "       doctor_3_name   = (select rtrim(name) from a_employee_mi where code = doctor_3)/*第2助手*/, " +
-            "       doctor_mz_name  = (select rtrim(name) from a_employee_mi where code = doctor_mz)/*麻醉医生*/, " +
-            "       nurse_qx_name   = (select rtrim(name) from a_employee_mi where code = nurse_qx)/*器械护士*/, " +
-            "       nurse_xh_name   = (select rtrim(name) from a_employee_mi where code = nurse_xh)/*巡回护士*/, " +
+            "       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, " +
-            "     op_record_join b " +
+            "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} " +
@@ -80,13 +80,13 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
                            @Param("recordId") Integer recordId);
 
 
-    @Select("select refer_physician_name = (select rtrim(name) from a_employee_mi where code = refer_physician) /*住院医生*/, " +
-            "       dept_director_name   = (select rtrim(name) from a_employee_mi where code = dept_director) /*科主任*/, " +
+    @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 " +
+            "                               from a_patient_mi with (NOLOCK) " +
             "                               where zy_actpatient.inpatient_no = a_patient_mi.inpatient_no) " +
-            "from zy_actpatient " +
+            "from zy_actpatient with (NOLOCK) " +
             "where inpatient_no = #{patNo} " +
             "  and admiss_times = #{times};")
     OpRecord daYingHuanZheXinXi(@Param("patNo") String patNo,
@@ -97,7 +97,7 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
             "SELECT rtrim(order_code) as opCode, " +
             "       rtrim(order_name) as opName, " +
             "       rtrim(ss_type)    as orderType " +
-            "FROM yz_order_item " +
+            "FROM yz_order_item with (NOLOCK) " +
             "where operation = 'p' " +
             "<if test=\"code != null and code != '' \">" +
             " and  ss_type = #{code} " +
@@ -109,11 +109,11 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
                                          @Param("code") String code,
                                          @Param("name") String name);
 
-    @Select("select code,name from op_zd_part where (name like #{code} or py_code like #{code} or d_code like #{code})")
+    @Select("select code,name from op_zd_part with (NOLOCK) where (name like #{code} or py_code like #{code} or d_code like #{code})")
     List<GetDropdownBox> huoQuShouShuBuWei(String code);
 
     @Select("Select isnull(Max(op_times),0) " +
-            "From op_record " +
+            "From op_record with (NOLOCK) " +
             "Where inpatient_no = #{patNo} " +
             "  And admiss_times = #{times} ")
     Integer shouShuShenQingCiShu(@Param("patNo") String patNo,
@@ -176,7 +176,7 @@ public interface ShouShuShenQingDao extends BaseMapper<OpRecord> {
                     @Param("execUnit") String execUnit);
 
 
-    @Select("select * from op_record where record_id = #{id}")
+    @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}")