| | |
| | | import com.moral.common.util.ExampleUtil;
|
| | | import com.moral.common.util.RedisUtils;
|
| | | import com.moral.mapper.MonitorPointMapper;
|
| | | import com.moral.mapper.OrganizationMapper;
|
| | | import org.apache.commons.collections.MapUtils;
|
| | | import org.apache.commons.lang3.BooleanUtils;
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | |
| | | @Resource
|
| | | private AccountService accountService;
|
| | | private Class ENTITY_CLASS = Device.class;
|
| | | @Resource
|
| | | OrganizationMapper orgMapper;
|
| | | @Resource
|
| | | RedisUtils redisUtils;
|
| | | @Override
|
| | |
| | |
|
| | | /**
|
| | | *
|
| | | * @param map
|
| | | * @param params
|
| | | * map里 包括 组织id和4个坐标点
|
| | | * @return 返回未删除结果集
|
| | | */
|
| | | @Override
|
| | | public List<Device> query(Map<String, Object> map) {
|
| | | List <Device> list = deviceMapper.selectByMap(map);
|
| | | loadDeviceState(list);
|
| | | return list;
|
| | | public List<Device> query(Map<String, Object> params) {
|
| | | Object orgIdObj = params.get("orgId");
|
| | | List<Device> deviceList = null;
|
| | | if(orgIdObj != null) {
|
| | | Integer orgId = Integer.parseInt(orgIdObj.toString());
|
| | | List<Integer> orgIds = orgMapper.selectLowerOrgIds(orgId);
|
| | | params.put("orgIds", orgIds);
|
| | | deviceList = deviceMapper.selectByMap(params);
|
| | | loadDeviceState(deviceList);
|
| | | }
|
| | | return deviceList;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 根据组织id和设备名称 分页查询设备
|
| | | * @param orgId
|
| | |
| | | */
|
| | | @Override
|
| | | public PageResult query(Integer orgId, String deviceName, Integer pageSize, Integer pageNo) {
|
| | | List<Integer> orgIds = orgMapper.selectLowerOrgIds(orgId);
|
| | | if(!ObjectUtils.isEmpty(pageSize)&&!ObjectUtils.isEmpty(pageNo)){
|
| | | PageHelper.startPage(pageNo,pageSize);
|
| | | }
|
| | |
| | | state = "4";
|
| | | deviceName = null;break;
|
| | | }
|
| | | List<Device> list = deviceMapper.selectByOrgIdAndDevName(orgId,state,deviceName);
|
| | | List<Device> list = deviceMapper.selectByOrgIdAndDevName(orgId,orgIds,state,deviceName);
|
| | | //从redis里取状态
|
| | | loadDeviceState(list);
|
| | | if(list instanceof Page){
|
| | |
| | | */
|
| | | @Override
|
| | | public PageResult query(Integer orgId, Integer mpId, Integer pageSize, Integer pageNo) {
|
| | | List<Integer> orgIds = orgMapper.selectLowerOrgIds(orgId);
|
| | | if(!ObjectUtils.isEmpty(pageSize)&&!ObjectUtils.isEmpty(pageNo)){
|
| | | PageHelper.startPage(pageNo,pageSize);
|
| | | }
|
| | | List<Device> list = deviceMapper.selectByOrgIdAndMpId(orgId,mpId);
|
| | | List<Device> list = deviceMapper.selectByOrgIdAndMpId(orgId,orgIds,mpId);
|
| | | //从redis里取状态
|
| | | loadDeviceState(list);
|
| | | if(list instanceof Page){
|