浏览代码

优化代码

java110 5 年之前
父节点
当前提交
985e7c9e31
共有 1 个文件被更改,包括 4 次插入 和 1 次删除
  1. 4 1
      java110-db/src/main/resources/mapper/community/FloorServiceDaoImplMapper.xml

+ 4 - 1
java110-db/src/main/resources/mapper/community/FloorServiceDaoImplMapper.xml

@@ -154,7 +154,10 @@
         COUNT(1) count
         COUNT(1) count
         FROM
         FROM
         f_floor f
         f_floor f
-        where f.`community_id` = #{communityId}
+        where 1=1
+        <if test="communityId !=null and communityId != ''">
+            and f.`community_id` = #{communityId}
+        </if>
         <if test="floorId !=null and floorId != ''">
         <if test="floorId !=null and floorId != ''">
             and f.floor_id= #{floorId}
             and f.floor_id= #{floorId}
         </if>
         </if>