dao/src/main/java/com/sandu/ximon/dao/mapper/LightMapper.java
@@ -23,6 +23,7 @@ /** * 获取用户所拥有的灯杆上的路灯code * * @param userId * @return */ dao/src/main/resources/mapper/LightMapper.xml
@@ -53,10 +53,10 @@ t1.device_code FROM light t1 LEFT JOIN pole t2 USING ( device_code ) LEFT JOIN pole t2 ON t1.device_code = t2.device_code <where> <if test="clientId != null"> AND (t2.user_id = #{clientId} OR t2.client_id = #{clientId}) <if test="userId != null"> AND (t2.user_id = #{userId} OR t2.client_id = #{userId}) </if> <if test="keyword != null and keyword != ''"> AND ( @@ -64,7 +64,7 @@ OR t2.pole_name LIKE CONCAT('%', #{keyword},'%') ) </if> <if test="deviceCode != null"> <if test="deviceCode != null and deviceCode!= ''"> AND t2.device_code = #{deviceCode} </if> </where> ximon-admin/src/main/java/com/sandu/ximon/admin/controller/LightController.java
@@ -18,6 +18,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -71,6 +72,9 @@ CommonPage commonPage = lightReportDataService.listReportData(conditionVO.getPageNo(), conditionVO.getPageSize(), keyword, deviceCode); List<LightReportDataBo> lightReportDataBos = ( List<LightReportDataBo>)commonPage.getList(); if(lightReportDataBos == null){ return ResponseUtil.success(CommonPage.restPage(new ArrayList<>())); } CommonPage commonPage1 = CommonPage.restPage(lightReportDataBos); commonPage1.setTotal(commonPage.getTotal()); commonPage1.setTotalPage(commonPage.getTotalPage()); ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java