| | |
| | | * 服务器获取路灯列表 |
| | | * |
| | | * @param clientId 客户id |
| | | * @param keyword 关键字 |
| | | * @param keyword 关键字 |
| | | * @return 路灯列表 |
| | | */ |
| | | List<LightBo> listLight(Long clientId, String keyword); |
| | | |
| | | /** |
| | | * 获取用户所拥有的灯杆上的路灯code |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<String> listCode( Long userId,String keyword, String deviceCode); |
| | | List<String> listCode(Long userId, String keyword, String deviceCode); |
| | | } |
| | | |
| | | |
| | |
| | | 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 ( |
| | |
| | | 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> |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | 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()); |
| | |
| | | /** |
| | | * 获取用户所有的设备码 |
| | | */ |
| | | public CommonPage<String> listDeviceCode(int pageNo, int pageSize,String keyword, String deviceCode) { |
| | | public CommonPage<String> listDeviceCode(int pageNo, int pageSize, String keyword, String deviceCode) { |
| | | List<String> list; |
| | | if (SecurityUtils.getClientId() != null) { |
| | | PageHelper.startPage(pageNo, pageSize); |
| | | list = baseMapper.listCode(SecurityUtils.getUserId(),keyword,deviceCode); |
| | | list = baseMapper.listCode(SecurityUtils.getUserId(), keyword, deviceCode); |
| | | } else { |
| | | |
| | | PageHelper.startPage(pageNo, pageSize); |
| | | list = baseMapper.listCode(null,keyword,deviceCode); |
| | | list = baseMapper.listCode(null, keyword, deviceCode); |
| | | } |
| | | |
| | | return CommonPage.restPage(list); |