Browse Source

Merge remote-tracking branch 'origin/cooper-bug'

lyhzzz 1 year ago
parent
commit
250a264593
1 changed files with 16 additions and 0 deletions
  1. 16 0
      src/main/resources/mapper/ucenter/ScenePlusMapper.xml

+ 16 - 0
src/main/resources/mapper/ucenter/ScenePlusMapper.xml

@@ -33,9 +33,25 @@
         <if test="param.cameraId != null and param.userId ==null  and param.cooperationNumList !=null and param.cooperationNumList.size ==0 ">
             and   p.camera_id = #{param.cameraId}
         </if>
+        <if test="param.cameraId != null and param.userId ==null  and param.cooperationNumList !=null and param.cooperationNumList.size >0 ">
+            and (   p.camera_id = #{param.cameraId}  or p.num in
+            <foreach collection="param.cooperationNumList" item="coNum" open="(" separator="," close=")">
+                #{coNum}
+            </foreach>
+            )
+        </if>
         <if test="param.cameraId == null and param.userId !=null  and param.cooperationNumList !=null and param.cooperationNumList.size ==0 ">
             and   p.user_id = #{param.userId}
         </if>
+        <if test="param.cameraId == null and param.userId !=null  and param.cooperationNumList !=null and param.cooperationNumList.size >0 ">
+            and (  p.user_id = #{param.userId}  or p.num in
+            <foreach collection="param.cooperationNumList" item="coNum" open="(" separator="," close=")">
+                #{coNum}
+            </foreach>
+            )
+        </if>
+
+
     </sql>