lyhzzz 2 년 전
부모
커밋
1d3b5a0e86
2개의 변경된 파일14개의 추가작업 그리고 7개의 파일을 삭제
  1. 7 3
      src/main/resources/mapper/LogMapper.xml
  2. 7 4
      src/main/resources/mapper/UserMapper.xml

+ 7 - 3
src/main/resources/mapper/LogMapper.xml

@@ -23,9 +23,13 @@
         <if test="param.endTime != null and param.endTime != ''">
             and l.create_time  &lt;=   #{param.endTime}
         </if>
-        <foreach collection="param.deptIds" item="deptId" open="(" separator="," close=")">
-            and u.dept_id in #{deptId}
-        </foreach>
+        <if test="param.deptIds != null and param.deptIds.length >0 ''">
+            and u.dept_id in
+            <foreach collection="param.deptIds" item="deptId" open="(" separator="," close=")">
+                #{deptId}
+            </foreach>
+        </if>
+
         order by l.create_time desc
     </select>
 </mapper>

+ 7 - 4
src/main/resources/mapper/UserMapper.xml

@@ -22,10 +22,13 @@
         <if test="param.endTime != null and param.endTime != ''">
             and u.create_time  &lt;=   #{param.endTime}
         </if>
-        and u.dept_id in
-        <foreach collection="param.deptIds" item="deptId" open="(" separator="," close=")">
-            #{deptId}
-        </foreach>
+        <if test="param.deptIds != null and param.deptIds.length >0 ''">
+            and u.dept_id in
+            <foreach collection="param.deptIds" item="deptId" open="(" separator="," close=")">
+                #{deptId}
+            </foreach>
+        </if>
+
         order by u.create_time desc
     </select>
 </mapper>