浏览代码

APP场景及公司查询修改

wangyangyang 4 年之前
父节点
当前提交
9550179f72

+ 2 - 2
sms_water/src/main/java/com/huaxu/controller/AppReportMonitorController.java

@@ -39,7 +39,7 @@ public class AppReportMonitorController {
     @RequestMapping(value = "getSceneByCompany",method = RequestMethod.GET)
     @ApiOperation(value = "App报表展示——公司场景查询(点击公司查询水厂)")
     public AjaxMessage<List<SceneEntity>> getSceneByCompany(
-            @ApiParam(value = "场景类型名称:水源、水厂、泵站") @RequestParam String sceneTypeName,
+            @ApiParam(value = "场景类型名称:水源、水厂、泵站") @RequestParam(required = false)  String sceneTypeName,
             @ApiParam(value = "公司id") @RequestParam Integer companyOrgId){
         return new AjaxMessage<>(ResultStatus.OK,appReportMonitorService.getSceneByCompany(sceneTypeName,companyOrgId));
     }
@@ -49,7 +49,7 @@ public class AppReportMonitorController {
     @RequestMapping(value = "getSceneCompanyBySearch",method = RequestMethod.GET)
     @ApiOperation(value = "App报表展示——公司场景查询(条件查询)")
     public AjaxMessage<CompanySceneInfoDto> getSceneCompanyBySearch(
-            @ApiParam(value = "场景类型名称:水源、水厂、泵站") @RequestParam String sceneTypeName,
+            @ApiParam(value = "场景类型名称:水源、水厂、泵站") @RequestParam(required = false)  String sceneTypeName,
             @ApiParam(value = "查询条件") @RequestParam(required = false) String condition){
         return new AjaxMessage<>(ResultStatus.OK,appReportMonitorService.getSceneByCompanyBySearch(sceneTypeName,condition));
     }

+ 6 - 2
sms_water/src/main/resources/mapper/AppReportMonitorMapper.xml

@@ -10,7 +10,9 @@
         from sms_scene_type st
         left join sms_scene s on st.id=s.SCENE_TYPE_ID
         where st.STATUS = 1 and s.STATUS = 1
-        and st.SCENE_TYPE_NAME =#{sceneType}
+        <if test="sceneType != null and sceneType !=''">
+          and st.SCENE_TYPE_NAME =#{sceneType}
+        </if>
         and  s.COMPANY_ORG_ID = #{companyOrgId}
         and s.TENANT_ID = #{tenantId}
         <if test="userType!=null and userType!=-999 and userType!=-9999 and  programItems != null and programItems.size() > 0">
@@ -93,7 +95,9 @@
         from sms_scene_type st
         left join sms_scene s on st.id=s.SCENE_TYPE_ID
         where st.STATUS = 1 and s.STATUS = 1
-        and st.SCENE_TYPE_NAME =#{sceneType}
+        <if test="sceneType != null and sceneType !=''">
+          and st.SCENE_TYPE_NAME =#{sceneType}
+        </if>
         <if test="condition != null and condition !=''">
             and s.SCENE_NAME like concat('%',#{condition},'%')
         </if>