冀北地图信息开发
This commit is contained in:
@@ -0,0 +1,84 @@
|
|||||||
|
package com.njcn.device.pms.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhuxinyu
|
||||||
|
* @since 2023-05-08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("pms_substation_expend")
|
||||||
|
public class SubstationExpend implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变电站类型:Sys_dict_data表主键
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级
|
||||||
|
*/
|
||||||
|
private String voltageLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private BigDecimal lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private BigDecimal lat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属单位
|
||||||
|
*/
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联台账变电站:pq_substation表主键
|
||||||
|
*/
|
||||||
|
private String substationId;
|
||||||
|
|
||||||
|
private String breakSite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连接回路:Sys_dict_data表主键(双回路、单回路)
|
||||||
|
*/
|
||||||
|
private String connectType;
|
||||||
|
|
||||||
|
private List<SimpleDTO> sites;
|
||||||
|
|
||||||
|
// public SubstationExpend(String name, String type, BigDecimal lng, BigDecimal lat, String deptId) {
|
||||||
|
// this.name = name;
|
||||||
|
// this.type = type;
|
||||||
|
// this.lng = lng;
|
||||||
|
// this.lat = lat;
|
||||||
|
// this.deptId = deptId;
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.njcn.device.pms.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 2.电网拓扑图关系表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhuxinyu
|
||||||
|
* @since 2023-05-08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("pms_substation_relation")
|
||||||
|
public class SubstationRelation extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 起点变电站id:pms_substation_jb主键
|
||||||
|
*/
|
||||||
|
private String startStationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终点变电站id:pms_substation_jb主键
|
||||||
|
*/
|
||||||
|
private String endStationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连接回路:Sys_dict_data表主键(双回路、单回路)
|
||||||
|
*/
|
||||||
|
private String connectType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 折点经纬度:[[0,0],[x,y]]
|
||||||
|
*/
|
||||||
|
private String breakSite;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.njcn.device.pms.controller.ledgerManger;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.device.pms.pojo.param.PmsBaseParam;
|
||||||
|
import com.njcn.device.pms.pojo.po.SubstationExpend;
|
||||||
|
import com.njcn.device.pms.service.ISubstationExpendService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhuxinyu
|
||||||
|
* @since 2023-05-08
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "变电站地图信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pms/substationExpend")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SubstationExpendController extends BaseController {
|
||||||
|
|
||||||
|
private final ISubstationExpendService substationExpendService;
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getSubstationExpendInfo")
|
||||||
|
@ApiOperation("变电站信息")
|
||||||
|
@ApiImplicitParam(name = "param", value = "变电站信息参数", required = true)
|
||||||
|
public HttpResult<Map<String, List<SubstationExpend>>> getSubstationExpendInfo(@RequestBody StatisticsBizBaseParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("getSubstationExpendInfo");
|
||||||
|
Map<String, List<SubstationExpend>> result = substationExpendService.getSubstationExpendInfo(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
// @PostMapping("/insert")
|
||||||
|
// @ApiOperation("变电站信息")
|
||||||
|
// @ApiImplicitParam(name = "insert", value = "变电站信息", required = true)
|
||||||
|
// public HttpResult<Boolean> insert(@RequestBody StatisticsBizBaseParam param) {
|
||||||
|
// String methodDescribe = getMethodDescribe("insert");
|
||||||
|
// List<SubstationExpend> list = Arrays.asList(
|
||||||
|
// new SubstationExpend("500kV天马变电站", "1fa650685c77db1656c70f9db4a2edc6",new BigDecimal(119.292327),new BigDecimal(40.215015),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("500kV昌黎变电站", "1fa650685c77db1656c70f9db4a2edc6",new BigDecimal(118.990809),new BigDecimal(40.016014),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("220kV陈官屯变电站", "1b7b58ed8fcc2992b95334eaa9010c41",new BigDecimal(118.998356),new BigDecimal(39.990971),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("220kV小营变电站", "1b7b58ed8fcc2992b95334eaa9010c41",new BigDecimal(119.298044),new BigDecimal(39.814401),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("220kV深河变电站", "1b7b58ed8fcc2992b95334eaa9010c41",new BigDecimal(119.453054),new BigDecimal(39.940208),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("220kV杜庄变电站", "1b7b58ed8fcc2992b95334eaa9010c41",new BigDecimal(119.540182),new BigDecimal(40.026883),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("220kV平方变电站", "1b7b58ed8fcc2992b95334eaa9010c41",new BigDecimal(119.173903),new BigDecimal(39.730601),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("220kV肖营子变电站", "1b7b58ed8fcc2992b95334eaa9010c41",new BigDecimal(118.866099),new BigDecimal(40.279209),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("220kV丰钢变电站", "1b7b58ed8fcc2992b95334eaa9010c41",new BigDecimal(118.913885),new BigDecimal(39.663569),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("220kV碣石变电站", "1b7b58ed8fcc2992b95334eaa9010c41",new BigDecimal(119.191153),new BigDecimal(39.723464),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("220kV龙家店变电站", "1b7b58ed8fcc2992b95334eaa9010c41",new BigDecimal(119.062243),new BigDecimal(39.719279),"17439407bfee299b7e38f2e54a8f6d28"),
|
||||||
|
// new SubstationExpend("220kV仙螺岛变电站", "1b7b58ed8fcc2992b95334eaa9010c41",new BigDecimal(119.446926),new BigDecimal(39.792502),"17439407bfee299b7e38f2e54a8f6d28")
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// boolean b = substationExpendService.saveBatch(list);
|
||||||
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.njcn.device.pms.controller.ledgerManger;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.device.pms.pojo.po.SubstationExpend;
|
||||||
|
import com.njcn.device.pms.pojo.po.SubstationRelation;
|
||||||
|
import com.njcn.device.pms.service.ISubstationRelationService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 2.电网拓扑图关系表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhuxinyu
|
||||||
|
* @since 2023-05-08
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pms/substationRelation")
|
||||||
|
@Api(tags = "变电站连接关系")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SubstationRelationController extends BaseController {
|
||||||
|
|
||||||
|
private final ISubstationRelationService substationRelationService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/saveSubstationRelation")
|
||||||
|
@ApiOperation("配置变电站拓扑图")
|
||||||
|
@ApiImplicitParam(name = "saveSubstationRelation", value = "配置变电站拓扑图", required = true)
|
||||||
|
public HttpResult<Boolean> saveSubstationRelation(@RequestBody SubstationRelation param) {
|
||||||
|
String methodDescribe = getMethodDescribe("saveSubstationRelation");
|
||||||
|
Boolean result = substationRelationService.saveSubstationRelation(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.njcn.device.pms.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||||
|
import com.njcn.device.pms.pojo.po.SubstationExpend;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhuxinyu
|
||||||
|
* @since 2023-05-08
|
||||||
|
*/
|
||||||
|
public interface SubstationExpendMapper extends BaseMapper<SubstationExpend> {
|
||||||
|
|
||||||
|
List<SubstationExpend> getSubList(@Param("list") List<String> list, @Param("param") StatisticsBizBaseParam param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.device.pms.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.pms.pojo.po.SubstationRelation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 2.电网拓扑图关系表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhuxinyu
|
||||||
|
* @since 2023-05-08
|
||||||
|
*/
|
||||||
|
public interface SubstationRelationMapper extends BaseMapper<SubstationRelation> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.device.pms.mapper.SubstationExpendMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getSubList" resultType="com.njcn.device.pms.pojo.po.SubstationExpend">
|
||||||
|
SELECT pse.*,
|
||||||
|
sdd.Name typeName,
|
||||||
|
psr.Break_site,
|
||||||
|
psr.connect_type
|
||||||
|
FROM pms_substation_expend pse
|
||||||
|
LEFT JOIN sys_dict_data sdd ON pse.Type = sdd.Id
|
||||||
|
LEFT JOIN pms_substation_relation psr ON psr.Start_Station_Id = pse.Id
|
||||||
|
WHERE pse.Dept_Id IN
|
||||||
|
<foreach item="item" collection="list" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
<if test="param.getType!=null and param.getType!=''">
|
||||||
|
AND sdd.Id = #{param.getType}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.device.pms.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||||
|
import com.njcn.device.pms.pojo.po.SubstationExpend;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhuxinyu
|
||||||
|
* @since 2023-05-08
|
||||||
|
*/
|
||||||
|
public interface ISubstationExpendService extends IService<SubstationExpend> {
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, List<SubstationExpend>> getSubstationExpendInfo(StatisticsBizBaseParam param);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.device.pms.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.device.pms.pojo.po.SubstationRelation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 2.电网拓扑图关系表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhuxinyu
|
||||||
|
* @since 2023-05-08
|
||||||
|
*/
|
||||||
|
public interface ISubstationRelationService extends IService<SubstationRelation> {
|
||||||
|
|
||||||
|
Boolean saveSubstationRelation(SubstationRelation param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.njcn.device.pms.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||||
|
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||||
|
import com.njcn.device.pms.mapper.SubstationExpendMapper;
|
||||||
|
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||||
|
import com.njcn.device.pms.pojo.po.SubstationExpend;
|
||||||
|
import com.njcn.device.pms.service.ISubstationExpendService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.pojo.dto.DeptDTO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhuxinyu
|
||||||
|
* @since 2023-05-08
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SubstationExpendServiceImpl extends ServiceImpl<SubstationExpendMapper, SubstationExpend> implements ISubstationExpendService {
|
||||||
|
|
||||||
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
|
||||||
|
private final SubstationExpendMapper substationExpendMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, List<SubstationExpend>> getSubstationExpendInfo(StatisticsBizBaseParam param) {
|
||||||
|
Map<String, List<SubstationExpend>> map = new HashMap<>();
|
||||||
|
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(param.getId(), Stream.of(0, 1).collect(Collectors.toList())).getData();
|
||||||
|
if (CollectionUtil.isNotEmpty(deptInfos)) {
|
||||||
|
List<String> list = deptInfos.stream()
|
||||||
|
.map(DeptDTO::getId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
// 获取部门所属变电站
|
||||||
|
List<SubstationExpend> subList=substationExpendMapper.getSubList(list, param);
|
||||||
|
if (CollUtil.isNotEmpty(subList)) {
|
||||||
|
subList.forEach (
|
||||||
|
t -> {
|
||||||
|
if (t.getBreakSite()!=null) {
|
||||||
|
List<SimpleDTO> simpleDTOS = new ArrayList<>();
|
||||||
|
String[][] arr = JSON.parseObject(t.getBreakSite(), String[][].class);
|
||||||
|
List<String[]> sites = Arrays.asList(arr);
|
||||||
|
for (String[] site : sites) {
|
||||||
|
SimpleDTO simpleDTO = new SimpleDTO();
|
||||||
|
simpleDTO.setName("");
|
||||||
|
simpleDTO.setValue(Arrays.toString(site));
|
||||||
|
simpleDTOS.add(simpleDTO);
|
||||||
|
}
|
||||||
|
t.setSites(simpleDTOS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
map = subList.stream().collect(Collectors.groupingBy(SubstationExpend::getDeptId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.device.pms.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.device.pms.mapper.SubstationRelationMapper;
|
||||||
|
import com.njcn.device.pms.pojo.po.SubstationRelation;
|
||||||
|
import com.njcn.device.pms.service.ISubstationRelationService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 2.电网拓扑图关系表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zhuxinyu
|
||||||
|
* @since 2023-05-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SubstationRelationServiceImpl extends ServiceImpl<SubstationRelationMapper, SubstationRelation> implements ISubstationRelationService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean saveSubstationRelation(SubstationRelation param) {
|
||||||
|
return this.save(param);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -852,28 +852,28 @@
|
|||||||
ROUND(SUM(t.statisValue)/flowMeal,2) flowProportion
|
ROUND(SUM(t.statisValue)/flowMeal,2) flowProportion
|
||||||
from (
|
from (
|
||||||
SELECT
|
SELECT
|
||||||
device.id id,
|
device.id id,
|
||||||
device.Name name,
|
device.Name name,
|
||||||
sub.Name substation,
|
sub.Name substation,
|
||||||
device.Update_Time updateTime,
|
device.Update_Time updateTime,
|
||||||
b.run_flag runFlag,
|
b.run_flag runFlag,
|
||||||
b.com_flag comFlag,
|
b.com_flag comFlag,
|
||||||
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||||
ROUND(ifnull(m.Actual_Value,0)/1024/1024,2) statisValue
|
ROUND(ifnull(m.Actual_Value,0)/1024/1024,2) statisValue
|
||||||
FROM cld_month_flow m
|
FROM cld_month_flow m
|
||||||
INNER JOIN pq_line device ON device.id=m.Dev_Id
|
INNER JOIN pq_line device ON device.id=m.Dev_Id
|
||||||
INNER JOIN pq_device b ON device.id=b.id
|
INNER JOIN pq_device b ON device.id=b.id
|
||||||
INNER JOIN pq_line sub ON device.pid = sub.id
|
INNER JOIN pq_line sub ON device.pid = sub.id
|
||||||
LEFT JOIN cld_dev_meal c ON b.id = c.line_id
|
LEFT JOIN cld_dev_meal c ON device.id = c.line_id
|
||||||
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
||||||
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
||||||
where device.id in
|
WHERE m.Dev_Id IN
|
||||||
<foreach item="item" collection="devs" separator="," open="(" close=")">
|
<foreach collection="devs" item="item" separator="," open="(" close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
and
|
AND
|
||||||
m.Time_Id between #{startTime} and #{endTime}
|
device.Update_Time between #{startTime} and #{endTime}
|
||||||
and
|
AND
|
||||||
b.Run_Flag != 2
|
b.Run_Flag != 2
|
||||||
) t
|
) t
|
||||||
GROUP BY t.id
|
GROUP BY t.id
|
||||||
|
|||||||
Reference in New Issue
Block a user