|
@@ -68,6 +68,14 @@
|
|
|
<include refid="deviceJoins"/>
|
|
|
<where>
|
|
|
a.status=1
|
|
|
+ <if test="scene.companyOrgId!=null and scene.deptOrgId!=null">
|
|
|
+ and a.DEPT_ORG_ID = #{scene.deptOrgId} and a.COMPANY_ORG_ID = #{scene.companyOrgId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="scene.companyOrgId!=null and scene.deptOrgId == null">
|
|
|
+ and a.DEPT_ORG_ID is null and a.COMPANY_ORG_ID = #{scene.companyOrgId}
|
|
|
+ </if>
|
|
|
+
|
|
|
<if test="scene.tenantId != null and scene.tenantId != ''">and a.tenant_id = #{scene.tenantId}</if>
|
|
|
<if test="scene.parentSceneId != null ">and a.parent_scene_id = #{scene.parentSceneId}</if>
|
|
|
<if test="scene.sceneName != null and scene.sceneName != ''">
|
|
@@ -169,7 +177,7 @@
|
|
|
FROM sms_scene a
|
|
|
<include refid="deviceJoins"/>
|
|
|
<where>
|
|
|
- a.status=1 and a.parent_scene_id=0
|
|
|
+ a.status=1
|
|
|
<if test="scene.tenantId != null and scene.tenantId != ''">and a.tenant_id = #{scene.tenantId}</if>
|
|
|
<if test="scene.parentSceneId != null ">and a.parent_scene_id = #{scene.parentSceneId}</if>
|
|
|
<if test="scene.sceneName != null and scene.sceneName != ''">
|
|
@@ -204,6 +212,6 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by a.date_create
|
|
|
+ order by a.date_create desc
|
|
|
</select>
|
|
|
</mapper>
|