Selaa lähdekoodia

场景增加公司部门查询

wangyangyang 4 vuotta sitten
vanhempi
commit
9173cb7132

+ 3 - 1
sms_water/src/main/java/com/huaxu/controller/SceneController.java

@@ -43,10 +43,12 @@ public class SceneController {
     @ApiOperation(value = "分页查询场景")
     @RequestMapping(value = "/selectPage", method = RequestMethod.GET)
     @ResponseBody
-    public AjaxMessage<Pagination<SceneEntity>> selectPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @RequestParam(value = "sceneName", required = false) String sceneName) {
+    public AjaxMessage<Pagination<SceneEntity>> selectPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @RequestParam(value = "sceneName", required = false) String sceneName,@RequestParam(required = false) Long comId,@RequestParam(required = false) Long deptId) {
         IPage<SceneEntity> iPage = new Page<>(pageNum, pageSize);
         SceneEntity sceneEntity = new SceneEntity();
         sceneEntity.setSceneName(sceneName);
+        sceneEntity.setCompanyOrgId(comId);
+        sceneEntity.setDeptOrgId(deptId);
         iPage = sceneService.findPage(iPage, sceneEntity);
         Pagination<SceneEntity> pages = new Pagination<>(iPage);
         return new AjaxMessage<>(ResultStatus.OK, pages);

+ 7 - 0
sms_water/src/main/resources/mapper/SceneMapper.xml

@@ -178,6 +178,13 @@
         <include refid="deviceJoins"/>
         <where>
             a.status=1 and a.parent_scene_id=0
+            <if test="scene.companyOrgId!=null">
+                 and a.COMPANY_ORG_ID = #{scene.companyOrgId}
+            </if>
+
+            <if test="scene.deptOrgId != null">
+                and a.DEPT_ORG_ID = #{scene.deptOrgId}
+            </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 != ''">