| | |
| | | private Integer deviceType; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 客户id |
| | | */ |
| | | private Long clientId; |
| | |
| | | light_report_data t1 |
| | | LEFT JOIN pole t2 USING ( device_code ) |
| | | <where> |
| | | 1 = 1 |
| | | |
| | | <if test="deviceCode != null and deviceCode != ''"> |
| | | AND t1.device_code = #{deviceCode} |
| | | </if> |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND ( |
| | | t1.device_code LIKE CONCAT('%', #{keyword},'%') |
| | | OR t2.pole_name LIKE CONCAT('%', #{keyword},'%') |
| | | ) |
| | | </if> |
| | | <if test="deviceCode != null and keyword != ''"> |
| | | AND t1.device_code = #{deviceCode} |
| | | </if> |
| | | |
| | | </where> |
| | | ORDER BY t1.light_report_data_id DESC |
| | | </select> |
| | |
| | | <result property="poleCode" column="pole_code" jdbcType="BIGINT"/> |
| | | <result property="poleName" column="pole_name" jdbcType="VARCHAR"/> |
| | | <result property="deviceType" column="device_type" jdbcType="INTEGER"/> |
| | | <result property="userId" column="user_id" jdbcType="BIGINT"/> |
| | | <result property="clientId" column="client_id" jdbcType="BIGINT"/> |
| | | <result property="province" column="province" jdbcType="VARCHAR"/> |
| | | <result property="city" column="city" jdbcType="VARCHAR"/> |
| | |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,pole_code,pole_name, |
| | | device_type,client_id,province, |
| | | city,region,address, |
| | | lon,lat,device_code, |
| | | on_line_state,binding_count,create_time, |
| | | update_time |
| | | device_type,user_id,client_id, |
| | | province,city,region, |
| | | address,lon,lat, |
| | | device_code,on_line_state,binding_count, |
| | | create_time,update_time |
| | | </sql> |
| | | </mapper> |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查找自己拥有的灯杆 |
| | | */ |
| | | @PostMapping("/getOwnerPole") |
| | | public ResponseVO<Object> getOwnerPole(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | //public ResponseVO<Object> setMac() { |
| | | return ResponseUtil.success(poleService.getOwnerPole(baseConditionVO,keyword)); |
| | | // return ResponseUtil.success(poleService.setMac()); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.redis.RedisService; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.dto.DeviceStatus; |
| | |
| | | private final RedisService redisService; |
| | | private final PoleBindingService poleBindingService; |
| | | private final PoleGroupRelationService groupRelationService; |
| | | private final ClientService clientService; |
| | | |
| | | public boolean addPole(PoleParam param) { |
| | | Pole pole = new Pole(); |
| | |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | |
| | | public List<Pole> getOwnerPole(BaseConditionVO baseConditionVO, String keyword) { |
| | | LambdaQueryWrapper<Pole> eq; |
| | | if(SecurityUtils.getClientId()!=null){ |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | if(clientService.findClientId()){ |
| | | eq = Wrappers.lambdaQuery(Pole.class).eq(Pole::getUserId, SecurityUtils.getUserId()); |
| | | }else{ |
| | | eq = Wrappers.lambdaQuery(Pole.class).eq(Pole::getClientId, SecurityUtils.getUserId()); |
| | | } |
| | | |
| | | }else { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | eq = Wrappers.lambdaQuery(Pole.class); |
| | | } |
| | | if (!keyword.isEmpty()){ |
| | | eq.like(Pole::getPoleName,keyword).or( |
| | | code->{ |
| | | code.like(Pole::getPoleCode,keyword); |
| | | } |
| | | ).or( |
| | | deviceCode->{ |
| | | deviceCode.like(Pole::getDeviceCode,keyword); |
| | | } |
| | | ); |
| | | } |
| | | List<Pole> list ; |
| | | list =list(eq); |
| | | setCount(list); |
| | | setOnline(list); |
| | | return list; |
| | | } |
| | | } |