Commit 002fc467 authored by wanghao's avatar wanghao

1 大屏端 全局搜素 设备,场站,用户信息,监控 ,以及点击查看 详情功能初步实现,待跟前段界面联调测试。

parent 68628511
...@@ -10,25 +10,22 @@ import com.zehong.common.core.domain.model.LoginUser; ...@@ -10,25 +10,22 @@ import com.zehong.common.core.domain.model.LoginUser;
import com.zehong.common.utils.SecurityUtils; import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.ServletUtils; import com.zehong.common.utils.ServletUtils;
import com.zehong.framework.web.service.TokenService; import com.zehong.framework.web.service.TokenService;
import com.zehong.system.domain.Listaw; import com.zehong.system.domain.*;
import com.zehong.system.domain.TDetailInfoList; import com.zehong.system.service.*;
import com.zehong.system.domain.TDeviceInfoS;
import com.zehong.system.service.ITDetectorInfoService;
import com.zehong.system.service.ITDetectorUserService;
import com.zehong.system.service.ITEmployedPeopleInfoService;
import com.zehong.web.codeconfig.CodeConFig; import com.zehong.web.codeconfig.CodeConFig;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.zehong.common.annotation.Log; import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController; import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult; import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType; import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.service.ITDeviceInfoService;
import com.zehong.common.utils.poi.ExcelUtil; import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo; import com.zehong.common.core.page.TableDataInfo;
import javax.annotation.Resource;
/** /**
* 设备信息Controller * 设备信息Controller
* *
...@@ -52,6 +49,9 @@ public class TDeviceInfoController extends BaseController ...@@ -52,6 +49,9 @@ public class TDeviceInfoController extends BaseController
@Autowired @Autowired
private TokenService tokenService; private TokenService tokenService;
@Resource
private ITDeviceUserService tDeviceUserService;
/** /**
* 查询设备信息列表 * 查询设备信息列表
*/ */
...@@ -65,6 +65,25 @@ public class TDeviceInfoController extends BaseController ...@@ -65,6 +65,25 @@ public class TDeviceInfoController extends BaseController
List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo); List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo);
return getDataTable(list); return getDataTable(list);
} }
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤一
* */
@GetMapping("/queryBasicInforByNameForBigWindows")
public AjaxResult queryBasicInforByNameForBigWindows(String name) {
return AjaxResult.success(tDeviceInfoService.queryBasicInforByNameForBigWindows(name));
}
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤二
* */
@GetMapping("/queryBasicInforByNameForBigWindows")
public AjaxResult queryBasicInforByTypeAndIdForBigWindows(String type,String id) {
return AjaxResult.success(tDeviceInfoService.queryBasicInforByTypeAndIdForBigWindows(type,id));
}
@GetMapping("/alllist") @GetMapping("/alllist")
public AjaxResult alllist(TDeviceInfo tDeviceInfo) public AjaxResult alllist(TDeviceInfo tDeviceInfo)
{ {
......
...@@ -27,7 +27,7 @@ import com.zehong.common.core.page.TableDataInfo; ...@@ -27,7 +27,7 @@ import com.zehong.common.core.page.TableDataInfo;
* @date 2022-09-14 * @date 2022-09-14
*/ */
@RestController @RestController
@RequestMapping("/system/yehuaqiDevice") @RequestMapping("/ system/yehuaqiDevice")
public class TYehuaqiDeviceController extends BaseController public class TYehuaqiDeviceController extends BaseController
{ {
......
...@@ -25,6 +25,13 @@ public interface PipeInterfaceMapper { ...@@ -25,6 +25,13 @@ public interface PipeInterfaceMapper {
*/ */
List<PipeDate> getPipeForSelect(String enterId); List<PipeDate> getPipeForSelect(String enterId);
/**
* 按照企业id he
* @param pipeId
* @return
*/
PipeDate getPipeBypipeId(@Param("pipeId") String pipeId);
/** /**
* 获取分组数据 * 获取分组数据
* @return * @return
......
...@@ -6,6 +6,7 @@ import java.util.Map; ...@@ -6,6 +6,7 @@ import java.util.Map;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TDeviceInfoS; import com.zehong.system.domain.TDeviceInfoS;
import com.zehong.system.domain.vo.TDetectorUserVO; import com.zehong.system.domain.vo.TDetectorUserVO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
...@@ -38,6 +39,13 @@ public interface TDeviceInfoMapper ...@@ -38,6 +39,13 @@ public interface TDeviceInfoMapper
* @return 设备信息集合 * @return 设备信息集合
*/ */
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo); public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo);
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤一
* */
@MapKey(value="id")
public List<Map<String,Object>> queryBasicInforByNameForBigWindows(@Param(value = "name") String name);
public List<TDeviceInfo> selectDeviceList(TDeviceInfo tDeviceInfo); public List<TDeviceInfo> selectDeviceList(TDeviceInfo tDeviceInfo);
/** /**
......
...@@ -21,6 +21,8 @@ public interface IPipeInterfaceService { ...@@ -21,6 +21,8 @@ public interface IPipeInterfaceService {
*/ */
List<PipeDate> getPipeForSelect(String enterId); List<PipeDate> getPipeForSelect(String enterId);
PipeDate getPipeBypipeId(String pipeId);
/** /**
* 获取分组数据 * 获取分组数据
* @return * @return
......
...@@ -30,6 +30,20 @@ public interface ITDeviceInfoService ...@@ -30,6 +30,20 @@ public interface ITDeviceInfoService
* @return 设备信息集合 * @return 设备信息集合
*/ */
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo); public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo);
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤一
* */
public Map<Object, List<Map<String, Object>>> queryBasicInforByNameForBigWindows(String name);
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤二
* */
public Object queryBasicInforByTypeAndIdForBigWindows(String type,String id);
public List<TDeviceInfo> selectDeviceList(TDeviceInfo tDeviceInfo); public List<TDeviceInfo> selectDeviceList(TDeviceInfo tDeviceInfo);
/** /**
......
...@@ -36,6 +36,11 @@ public class PipeInterfaceServiceImpl implements IPipeInterfaceService { ...@@ -36,6 +36,11 @@ public class PipeInterfaceServiceImpl implements IPipeInterfaceService {
return pipeDates; return pipeDates;
} }
@Override
public PipeDate getPipeBypipeId(String pipeId) {
return pipeInterfaceMapper.getPipeBypipeId(pipeId);
}
/** /**
* 获取分组数据 * 获取分组数据
* @return * @return
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.core.domain.model.LoginUser;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDeviceInfoS; import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.ServletUtils;
import com.zehong.system.domain.*;
import com.zehong.system.service.*;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceInfoMapper; import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.service.ITDeviceInfoService; import javax.annotation.Resource;
/** /**
* 设备信息Service业务层处理 * 设备信息Service业务层处理
...@@ -21,9 +30,25 @@ import com.zehong.system.service.ITDeviceInfoService; ...@@ -21,9 +30,25 @@ import com.zehong.system.service.ITDeviceInfoService;
@Service @Service
public class TDeviceInfoServiceImpl implements ITDeviceInfoService public class TDeviceInfoServiceImpl implements ITDeviceInfoService
{ {
@Autowired @Resource
private TDeviceInfoMapper tDeviceInfoMapper; private TDeviceInfoMapper tDeviceInfoMapper;
@Resource
IPipeInterfaceService iPipeInterfaceService;
@Resource
private ITDetectorUserService tDetectorUserService;
@Resource
private ITDeviceUserService tDeviceUserService;
@Resource
private ITVideoManagerService itVideoManagerService;
@Resource
private ITYehuaqiUserService yehuaqiUserService;
/** /**
* 查询设备信息 * 查询设备信息
* *
...@@ -47,6 +72,277 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -47,6 +72,277 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
{ {
return tDeviceInfoMapper.selectTDeviceInfoList(tDeviceInfo); return tDeviceInfoMapper.selectTDeviceInfoList(tDeviceInfo);
} }
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤一
* */
@Override
public Map<Object, List<Map<String, Object>>> queryBasicInforByNameForBigWindows(String name) {
Map<Object, List<Map<String, Object>>> stringListHashMap = new HashMap<>();
List<Map<String, Object>> maps = tDeviceInfoMapper.queryBasicInforByNameForBigWindows(name);
if (maps.size() > 0) {
stringListHashMap = maps.stream().collect(Collectors.groupingBy((item -> item.get("type"))));
}
return stringListHashMap;
}
/**
*
* 大屏端 全局搜素 设备,场站,用户信息,监控 步骤二
* */
@Override
public Object queryBasicInforByTypeAndIdForBigWindows(String type, String id) {
// 1 是阀门井 2 是调压箱 都是查询 device 表
if(("1".equals(type) || "2".equals(type)) && id != null) {
return initPressureFlow(id);
}
// 3 是场站
if(("3".equals(type)) && id != null) {
return initTSiteStationInfoData(id);
}
// 4 5 6 是居民用户,商业用户,工业用户
if(("4".equals(type) || "5".equals(type) || "6".equals(type)) && id != null) {
TDetectorUser tDetectorUser = new TDetectorUser();
tDetectorUser.setUserId(Long.parseLong(id));
return tDetectorUserService.detectorUserList(tDetectorUser);
}
//7 是监控
if ("7".equals(type)) {
return itVideoManagerService.selectTVideoManagerById(Long.parseLong(id));
}
//8 是餐饮单位液化气用户
if("8".equals(type) && id != null) {
TYehuaqiUser tYehuaqiUser = new TYehuaqiUser();
tYehuaqiUser.setUserId(Long.parseLong(id));
List<TYehuaqiUser> tYehuaqiUsers = yehuaqiUserService.selectAllUserList(tYehuaqiUser);
if (tYehuaqiUsers.size() > 0) {
return tYehuaqiUsers.get(0);
}
}
//9 是管道
if("9".equals(type) && id != null) {
return iPipeInterfaceService.getPipeBypipeId(id);
}
return null;
}
/**
* 封装场站信息
* @param deviceId 设备id
* @return object
*/
private Object initTSiteStationInfoData(String deviceId) {
TSiteStationInfoDataList tSiteStationInfoDataList = new TSiteStationInfoDataList();
List<TSiteStationInfoData> TSiteStationInfoDataList=new ArrayList<>();
//查询场站下级设备数据
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(deviceId);
//临时存储压力表数据数组
List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//临时存储探测器数据数组
List<PressureFlow> detectorList=new ArrayList();
/**循环下级全部数据*/
for (int s=0;s<pressureFlows.size();s++){
//判断是压力表还是流量计 1压力表 2流量计 3探测器
if (pressureFlows.get(s).getDeviceType().equals("1")){
pressureList.add(pressureFlows.get(s));
}else if (pressureFlows.get(s).getDeviceType().equals("2")){
flowmeterList.add(pressureFlows.get(s));
}else if (pressureFlows.get(s).getDeviceType().equals("3")){
detectorList.add(pressureFlows.get(s));
}
}
//创建下级数据list数组
List<SubordinateEquipmentList> subordinateEquipmentLists=new ArrayList<>();
/**循环三次 每次代表 1压力表 2流量计 3探测器*/
for (int t=0;t<3;t++){
SubordinateEquipmentList subordinateEquipmentList=new SubordinateEquipmentList();
if (t==0){ /**添加压力表数据*/
if (pressureList.size()!=0){
/**查询下级在线设备数量*/
int onLine = iPipeInterfaceService.selectOnlineQuantity(pressureList, 0);
subordinateEquipmentList.setOnlineEquipment(onLine);
/**查询下级离线设备数量*/
int offLine = iPipeInterfaceService.selectOnlineQuantity(pressureList, 1);
subordinateEquipmentList.setOfflineEquipment(offLine);
/**查询历史报警数量*/
int historicalAlarm = iPipeInterfaceService.selectHistoricalAlarm(pressureList);
subordinateEquipmentList.setHistoricalAlarm(historicalAlarm);
/**查询已处理报警*/
int processAlarm = iPipeInterfaceService.selectProcessAlarm(pressureList);
subordinateEquipmentList.setAlarmProcessed(processAlarm);
/**查询报警中*/
int inAlarm = iPipeInterfaceService.selectInAlarm(pressureList);
subordinateEquipmentList.setInAlarm(inAlarm);
subordinateEquipmentList.setNumberPressureGauges(pressureList.size());
}
subordinateEquipmentList.setDataType(1);
}else if (t==1){ /**添加流量计数据*/
if (flowmeterList.size()!=0){
/**查询下级在线设备数量*/
int onLine = iPipeInterfaceService.selectOnlineQuantity(flowmeterList, 0);
subordinateEquipmentList.setOnlineEquipment(onLine);
/**查询下级离线设备数量*/
int offLine = iPipeInterfaceService.selectOnlineQuantity(flowmeterList, 1);
subordinateEquipmentList.setOfflineEquipment(offLine);
/**查询历史报警数量*/
int historicalAlarm = iPipeInterfaceService.selectHistoricalAlarm(flowmeterList);
subordinateEquipmentList.setHistoricalAlarm(historicalAlarm);
/**查询已处理报警*/
int processAlarm = iPipeInterfaceService.selectProcessAlarm(flowmeterList);
subordinateEquipmentList.setAlarmProcessed(processAlarm);
/**查询报警中*/
int inAlarm = iPipeInterfaceService.selectInAlarm(flowmeterList);
subordinateEquipmentList.setInAlarm(inAlarm);
subordinateEquipmentList.setNumberPressureGauges(flowmeterList.size());
}
subordinateEquipmentList.setDataType(2);
}else if (t==2){ /**添加探测器数据*/
if (detectorList.size()!=0){
/**查询下级在线设备数量*/
int onLine = iPipeInterfaceService.selectOnlineQuantity(detectorList, 0);
subordinateEquipmentList.setOnlineEquipment(onLine);
/**查询下级离线设备数量*/
int offLine = iPipeInterfaceService.selectOnlineQuantity(detectorList, 1);
subordinateEquipmentList.setOfflineEquipment(offLine);
/**查询历史报警数量*/
int historicalAlarm = iPipeInterfaceService.selectHistoricalAlarm(detectorList);
subordinateEquipmentList.setHistoricalAlarm(historicalAlarm);
/**查询已处理报警*/
int processAlarm = iPipeInterfaceService.selectProcessAlarm(detectorList);
subordinateEquipmentList.setAlarmProcessed(processAlarm);
/**查询报警中*/
int inAlarm = iPipeInterfaceService.selectInAlarm(detectorList);
subordinateEquipmentList.setInAlarm(inAlarm);
subordinateEquipmentList.setNumberPressureGauges(detectorList.size());
}
subordinateEquipmentList.setDataType(3);
}
subordinateEquipmentLists.add(subordinateEquipmentList);
}
TSiteStationInfoData deviceData=new TSiteStationInfoData();
deviceData.setSubordinateEquipmentList(subordinateEquipmentLists);
TSiteStationInfoDataList.add(deviceData);
tSiteStationInfoDataList.setData(TSiteStationInfoDataList);
return tSiteStationInfoDataList;
}
/**
* 封装 阀门井和调压箱数据
* @param deviceId 设备id
* @return object
*/
private Object initPressureFlow (String deviceId) {
//最后返回的封装类型
DeviceList deviceList=new DeviceList();
List<DeviceData> DeviceList=new ArrayList<>();
//查询关联设备下级数据方法
List<PressureFlow> pressureFlows = iPipeInterfaceService.selectPressureFlow(deviceId);
//临时存储压力表数据数组
List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//临时存储探测器数据数组
List<PressureFlow> detectorList=new ArrayList();
/**循环下级全部数据*/
for (int s=0;s<pressureFlows.size();s++){
//判断是压力表还是流量计 1压力表 2流量计 3探测器
if (pressureFlows.get(s).getDeviceType().equals("1")){
pressureList.add(pressureFlows.get(s));
}else if (pressureFlows.get(s).getDeviceType().equals("2")){
flowmeterList.add(pressureFlows.get(s));
}else if (pressureFlows.get(s).getDeviceType().equals("3")){
detectorList.add(pressureFlows.get(s));
}
}
//创建下级数据list数组
List<SubordinateEquipmentList> subordinateEquipmentLists=new ArrayList<>();
/**循环三次 每次代表 1压力表 2流量计 3探测器*/
for (int t=0;t<3;t++){
SubordinateEquipmentList subordinateEquipmentList=new SubordinateEquipmentList();
if (t==0){ /**添加压力表数据*/
if (pressureList.size()!=0){
/**查询下级在线设备数量*/
int onLine = iPipeInterfaceService.selectOnlineQuantity(pressureList, 0);
subordinateEquipmentList.setOnlineEquipment(onLine);
/**查询下级离线设备数量*/
int offLine = iPipeInterfaceService.selectOnlineQuantity(pressureList, 1);
subordinateEquipmentList.setOfflineEquipment(offLine);
/**查询历史报警数量*/
int historicalAlarm = iPipeInterfaceService.selectHistoricalAlarm(pressureList);
subordinateEquipmentList.setHistoricalAlarm(historicalAlarm);
/**查询已处理报警*/
int processAlarm = iPipeInterfaceService.selectProcessAlarm(pressureList);
subordinateEquipmentList.setAlarmProcessed(processAlarm);
/**查询报警中*/
int inAlarm = iPipeInterfaceService.selectInAlarm(pressureList);
subordinateEquipmentList.setInAlarm(inAlarm);
subordinateEquipmentList.setNumberPressureGauges(pressureList.size());
}
subordinateEquipmentList.setDataType(1);
}else if (t==1){ /**添加流量计数据*/
if (flowmeterList.size()!=0){
/**查询下级在线设备数量*/
int onLine = iPipeInterfaceService.selectOnlineQuantity(flowmeterList, 0);
subordinateEquipmentList.setOnlineEquipment(onLine);
/**查询下级离线设备数量*/
int offLine = iPipeInterfaceService.selectOnlineQuantity(flowmeterList, 1);
subordinateEquipmentList.setOfflineEquipment(offLine);
/**查询历史报警数量*/
int historicalAlarm = iPipeInterfaceService.selectHistoricalAlarm(flowmeterList);
subordinateEquipmentList.setHistoricalAlarm(historicalAlarm);
/**查询已处理报警*/
int processAlarm = iPipeInterfaceService.selectProcessAlarm(flowmeterList);
subordinateEquipmentList.setAlarmProcessed(processAlarm);
/**查询报警中*/
int inAlarm = iPipeInterfaceService.selectInAlarm(flowmeterList);
subordinateEquipmentList.setInAlarm(inAlarm);
subordinateEquipmentList.setNumberPressureGauges(flowmeterList.size());
}
subordinateEquipmentList.setDataType(2);
}else if (t==2){ /**添加探测器数据*/
if (detectorList.size()!=0){
/**查询下级在线设备数量*/
int onLine = iPipeInterfaceService.selectOnlineQuantity(detectorList, 0);
subordinateEquipmentList.setOnlineEquipment(onLine);
/**查询下级离线设备数量*/
int offLine = iPipeInterfaceService.selectOnlineQuantity(detectorList, 1);
subordinateEquipmentList.setOfflineEquipment(offLine);
/**查询历史报警数量*/
int historicalAlarm = iPipeInterfaceService.selectHistoricalAlarm(detectorList);
subordinateEquipmentList.setHistoricalAlarm(historicalAlarm);
/**查询已处理报警*/
int processAlarm = iPipeInterfaceService.selectProcessAlarm(detectorList);
subordinateEquipmentList.setAlarmProcessed(processAlarm);
/**查询报警中*/
int inAlarm = iPipeInterfaceService.selectInAlarm(detectorList);
subordinateEquipmentList.setInAlarm(inAlarm);
subordinateEquipmentList.setNumberPressureGauges(detectorList.size());
}
subordinateEquipmentList.setDataType(3);
}
subordinateEquipmentLists.add(subordinateEquipmentList);
}
DeviceData deviceData=new DeviceData();
deviceData.setSubordinateEquipmentList(subordinateEquipmentLists);
DeviceList.add(deviceData);
deviceList.setData(DeviceList);
return deviceList;
}
@Override @Override
public List<TDeviceInfo> selectDeviceList(TDeviceInfo tDeviceInfo) public List<TDeviceInfo> selectDeviceList(TDeviceInfo tDeviceInfo)
{ {
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDetectorUser;
import com.zehong.system.domain.TYehuaqiDevice; import com.zehong.system.domain.TYehuaqiDevice;
import com.zehong.system.domain.vo.TDetectorUserVO;
import com.zehong.system.domain.vo.TYehuaqiUserVO;
import com.zehong.system.mapper.TYehuaqiDeviceMapper; import com.zehong.system.mapper.TYehuaqiDeviceMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TYehuaqiUserMapper; import com.zehong.system.mapper.TYehuaqiUserMapper;
...@@ -56,12 +51,12 @@ public class TYehuaqiUserServiceImpl implements ITYehuaqiUserService ...@@ -56,12 +51,12 @@ public class TYehuaqiUserServiceImpl implements ITYehuaqiUserService
public List<TYehuaqiUser> selectAllUserList(TYehuaqiUser tYehuaqiUser) public List<TYehuaqiUser> selectAllUserList(TYehuaqiUser tYehuaqiUser)
{ {
List<TYehuaqiUser> list = tYehuaqiUserMapper.selectTYehuaqiUserListTwo(tYehuaqiUser); List<TYehuaqiUser> list = tYehuaqiUserMapper.selectTYehuaqiUserListTwo(tYehuaqiUser);
// for (TYehuaqiUser user : list){ for (TYehuaqiUser user : list){
// TYehuaqiDevice d = new TYehuaqiDevice(); TYehuaqiDevice d = new TYehuaqiDevice();
// d.setUserId(user.getUserId()); d.setUserId(user.getUserId());
// List<TYehuaqiDevice> devices = tYehuaqiDeviceMapper.selectTYehuaqiDeviceList(d); List<TYehuaqiDevice> devices = tYehuaqiDeviceMapper.selectTYehuaqiDeviceList(d);
// user.setDeviceNum(devices.size()); user.setDeviceNum(devices.size());
// } }
return list; return list;
} }
......
...@@ -135,6 +135,14 @@ ...@@ -135,6 +135,14 @@
</if> </if>
</select> </select>
<select id="getPipeBypipeId" parameterType="PipeDate" resultMap="PipeDateResult">
select format(pipe_length,2)pipe_length,pipe_pressure,beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,
buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name,
pipe_name,detaild_address,ind_reg_auth,ind_reg_auth_per,ind_reg_auth_per_con,key_areas_gas_usage,
aff_gas_com,aff_gas_com_sec_per,aff_gas_com_sec_per_con,sec_check_time,unit_gas_user_res,unit_gas_user_res_con from t_pipe_info
where pipe_id = #{pipeId}
</select>
<!--获取分组数据--> <!--获取分组数据-->
<select id="selectGroupPipeData" parameterType="PipeDate" resultMap="PipeDateResult"> <select id="selectGroupPipeData" parameterType="PipeDate" resultMap="PipeDateResult">
select beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name from t_pipe_info select beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name from t_pipe_info
......
...@@ -59,6 +59,81 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -59,6 +59,81 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by a.device_id desc order by a.device_id desc
</select> </select>
<select id="queryBasicInforByNameForBigWindows" resultType="map">
SELECT
device_id AS id,
device_name AS NAME,
CONCAT( '[[', longitude, ', ', latitude, ']]' ) AS coordinates,
device_type AS type
FROM
t_device_info
WHERE
<if test="name != null and name != ''"> device_name like concat('%', #{name}, '%') AND</if>
longitude IS NOT NULL
AND latitude IS NOT NULL UNION
SELECT
site_station_id AS id,
site_station_name AS NAME,
CONCAT( '[[', longitude, ', ', latitude, ']]' ) AS coordinates,
'3' AS type
FROM
t_site_station_info
WHERE
<if test="name != null and name != ''"> site_station_name like concat('%', #{name}, '%') AND</if>
longitude IS NOT NULL
AND latitude IS NOT NULL UNION
SELECT
user_id AS id,
nick_name AS NAME,
CONCAT( '[[', longitude, ', ', latitude, ']]' ) AS coordinates,
CASE
user_type
WHEN '1' THEN
'4'
WHEN '2' THEN
'5'
WHEN '3' THEN
'6'
END AS type
FROM
t_detector_user
WHERE
<if test="name != null and name != ''"> nick_name like concat('%', #{name}, '%') AND</if>
longitude IS NOT NULL
AND latitude IS NOT NULL UNION
SELECT
video_manager_id AS id,
video_name AS NAME,
CONCAT( '[[', longitude, ', ', latitude, ']]' ) AS coordinates,
'7' AS type
FROM
t_video_manager
WHERE
<if test="name != null and name != ''"> video_name like concat('%', #{name}, '%') AND</if>
longitude IS NOT NULL
AND latitude IS NOT NULL UNION
SELECT
user_id AS id,
nick_name AS NAME,
CONCAT( '[[', longitude, ', ', latitude, ']]' ) AS coordinates,
'8' AS type
FROM
t_yehuaqi_user
WHERE
<if test="name != null and name != ''"> nick_name like concat('%', #{name}, '%') AND</if>
longitude IS NOT NULL
AND latitude IS NOT NULL UNION
SELECT
pipe_id AS id,
pipe_addr AS NAME,
coordinates,
'9' AS type
FROM
t_pipe_info
WHERE
<if test="name != null and name != ''"> pipe_addr like concat('%', #{name}, '%') AND</if>
coordinates IS NOT NULL
</select>
<select id="selectDeviceList" parameterType="TDeviceInfo" resultMap="TDeviceInfoResult"> <select id="selectDeviceList" parameterType="TDeviceInfo" resultMap="TDeviceInfoResult">
SELECT * FROM t_device_info WHERE device_name like concat('%', #{deviceName}, '%') SELECT * FROM t_device_info WHERE device_name like concat('%', #{deviceName}, '%')
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment