浏览代码

优化sql2

wangfeng 4 年之前
父节点
当前提交
9ffd9667e8
共有 1 个文件被更改,包括 3 次插入6 次删除
  1. 3 6
      src/main/resources/mapper/BehospitalInfoMapper.xml

+ 3 - 6
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -2412,9 +2412,8 @@
         WHERE is_deleted = 'N') g
         ON tp.behospitalCode = g.behospital_code
         AND tp.hospitalId = g.hospital_id ) tu
-        where tu.checkStatus is not null
         <if test="checkStatus != null ">
-            and tu.checkStatus = #{checkStatus}
+            where tu.checkStatus = #{checkStatus}
         </if>
     </select>
 
@@ -2581,9 +2580,8 @@
         WHERE is_deleted = 'N') g
         ON tp.behospitalCode = g.behospital_code
         AND tp.hospitalId = g.hospital_id ) tu
-        where tu.checkStatus is not null
         <if test="checkStatus != null ">
-            and tu.checkStatus = #{checkStatus}
+            where tu.checkStatus = #{checkStatus}
         </if>
     </select>
 
@@ -2756,9 +2754,8 @@
         WHERE is_deleted = 'N') g
         ON tp.behospitalCode = g.behospital_code
         AND tp.hospitalId = g.hospital_id ) tu
-        WHERE tu.checkStatus IS NOT NULL
         <if test="checkStatus != null ">
-            and tu.checkStatus = #{checkStatus}
+            where tu.checkStatus = #{checkStatus}
         </if>
     </select>