|
@@ -52,25 +52,31 @@
|
|
|
from sms_camera_manage a
|
|
|
<where>
|
|
|
a.status=1
|
|
|
- <if test="items != null">
|
|
|
- and (a.COMPANY_ORG_ID in
|
|
|
- <foreach item="item" index="index" collection="items" open="(" separator="," close=")">
|
|
|
- <if test="item.orgCompanyId!= null">
|
|
|
-
|
|
|
- #{item.orgCompanyId}
|
|
|
- </if>
|
|
|
-
|
|
|
+ <if test="permissonType == 5 or permissonType == 2">
|
|
|
+ and ( a.DEPT_ORG_ID in
|
|
|
+ <foreach collection="programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
</foreach>
|
|
|
- or a.DEPT_ORG_ID in
|
|
|
- <foreach item="item" index="index" collection="items" open="(" separator="," close=")">
|
|
|
- <if test="item.orgDeparmtmentId!= null">
|
|
|
-
|
|
|
- #{item.orgDeparmtmentId}
|
|
|
- </if>
|
|
|
-
|
|
|
+ or
|
|
|
+ a.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
</foreach>
|
|
|
)
|
|
|
</if>
|
|
|
+ <if test="permissonType == 4 or permissonType == 3">
|
|
|
+ and a.DEPT_ORG_ID in
|
|
|
+ <foreach collection="programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="permissonType == 1">
|
|
|
+ and a.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ and (a.DEPT_ORG_ID is null or a.DEPT_ORG_ID =0)
|
|
|
+ </if>
|
|
|
<if test="id != null">
|
|
|
and ID = #{id}
|
|
|
</if>
|
|
@@ -239,25 +245,32 @@
|
|
|
from sms_camera_manage a join sms_scene b on a.SCENE_ID=b.ID
|
|
|
<where>
|
|
|
a.status=1
|
|
|
- <if test="cameraManage.items != null">
|
|
|
- and (a.COMPANY_ORG_ID in
|
|
|
- <foreach item="item" index="index" collection="cameraManage.items" open="(" separator="," close=")">
|
|
|
- <if test="item.orgCompanyId!= null">
|
|
|
-
|
|
|
- #{item.orgCompanyId}
|
|
|
- </if>
|
|
|
|
|
|
+ <if test="cameraManage.permissonType == 5 or cameraManage.permissonType == 2">
|
|
|
+ and ( a.DEPT_ORG_ID in
|
|
|
+ <foreach collection="cameraManage.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
</foreach>
|
|
|
- or a.DEPT_ORG_ID in
|
|
|
- <foreach item="item" index="index" collection="cameraManage.items" open="(" separator="," close=")">
|
|
|
- <if test="item.orgDeparmtmentId!= null">
|
|
|
-
|
|
|
- #{item.orgDeparmtmentId}
|
|
|
- </if>
|
|
|
-
|
|
|
+ or
|
|
|
+ a.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="cameraManage.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
</foreach>
|
|
|
)
|
|
|
</if>
|
|
|
+ <if test="cameraManage.permissonType == 4 or cameraManage.permissonType == 3">
|
|
|
+ and a.DEPT_ORG_ID in
|
|
|
+ <foreach collection="cameraManage.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="cameraManage.permissonType == 1">
|
|
|
+ and a.COMPANY_ORG_ID in
|
|
|
+ <foreach collection="cameraManage.programItems" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.orgId}
|
|
|
+ </foreach>
|
|
|
+ and (a.DEPT_ORG_ID is null or a.DEPT_ORG_ID =0)
|
|
|
+ </if>
|
|
|
<if test="cameraManage.id != null">
|
|
|
and ID = #{cameraManage.id}
|
|
|
</if>
|