From bf52617a24492f759d8bf5410310823f3571bd37 Mon Sep 17 00:00:00 2001 From: zhuxinyu <1799009482@qq.com> Date: Wed, 10 May 2023 16:06:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=80=E5=8C=97=E5=9C=B0=E5=9B=BE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/pms/pojo/po/SubstationExpend.java | 84 +++++++++++++++++++ .../pms/pojo/po/SubstationRelation.java | 48 +++++++++++ .../SubstationExpendController.java | 84 +++++++++++++++++++ .../SubstationRelationController.java | 55 ++++++++++++ .../pms/mapper/SubstationExpendMapper.java | 22 +++++ .../pms/mapper/SubstationRelationMapper.java | 17 ++++ .../mapper/mapping/SubstationExpendMapper.xml | 22 +++++ .../pms/service/ISubstationExpendService.java | 25 ++++++ .../service/ISubstationRelationService.java | 18 ++++ .../impl/SubstationExpendServiceImpl.java | 74 ++++++++++++++++ .../impl/SubstationRelationServiceImpl.java | 25 ++++++ .../device/pq/mapper/mapping/LineMapper.xml | 28 +++---- 12 files changed, 488 insertions(+), 14 deletions(-) create mode 100644 pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/SubstationExpend.java create mode 100644 pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/SubstationRelation.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/SubstationExpendController.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/SubstationRelationController.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/SubstationExpendMapper.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/SubstationRelationMapper.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/SubstationExpendMapper.xml create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ISubstationExpendService.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ISubstationRelationService.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/impl/SubstationExpendServiceImpl.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/impl/SubstationRelationServiceImpl.java diff --git a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/SubstationExpend.java b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/SubstationExpend.java new file mode 100644 index 000000000..6e173e690 --- /dev/null +++ b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/SubstationExpend.java @@ -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.*; + +/** + *

+ * + *

+ * + * @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 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; +// } +} diff --git a/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/SubstationRelation.java b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/SubstationRelation.java new file mode 100644 index 000000000..968f16b14 --- /dev/null +++ b/pqs-device/pms-device/pms-device-api/src/main/java/com/njcn/device/pms/pojo/po/SubstationRelation.java @@ -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; + +/** + *

+ * 2.电网拓扑图关系表 + *

+ * + * @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; + + +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/SubstationExpendController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/SubstationExpendController.java new file mode 100644 index 000000000..4ef918db9 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/SubstationExpendController.java @@ -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; + +/** + *

+ * 前端控制器 + *

+ * + * @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>> getSubstationExpendInfo(@RequestBody StatisticsBizBaseParam param) { + String methodDescribe = getMethodDescribe("getSubstationExpendInfo"); + Map> 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 insert(@RequestBody StatisticsBizBaseParam param) { +// String methodDescribe = getMethodDescribe("insert"); +// List 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); +// } + +} + diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/SubstationRelationController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/SubstationRelationController.java new file mode 100644 index 000000000..1b6fb704b --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/ledgerManger/SubstationRelationController.java @@ -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; + +/** + *

+ * 2.电网拓扑图关系表 前端控制器 + *

+ * + * @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 saveSubstationRelation(@RequestBody SubstationRelation param) { + String methodDescribe = getMethodDescribe("saveSubstationRelation"); + Boolean result = substationRelationService.saveSubstationRelation(param); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); + } +} + diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/SubstationExpendMapper.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/SubstationExpendMapper.java new file mode 100644 index 000000000..ddadcc45e --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/SubstationExpendMapper.java @@ -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; + +/** + *

+ * Mapper 接口 + *

+ * + * @author zhuxinyu + * @since 2023-05-08 + */ +public interface SubstationExpendMapper extends BaseMapper { + + List getSubList(@Param("list") List list, @Param("param") StatisticsBizBaseParam param); +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/SubstationRelationMapper.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/SubstationRelationMapper.java new file mode 100644 index 000000000..06480097a --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/SubstationRelationMapper.java @@ -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; + +/** + *

+ * 2.电网拓扑图关系表 Mapper 接口 + *

+ * + * @author zhuxinyu + * @since 2023-05-08 + */ +public interface SubstationRelationMapper extends BaseMapper { + +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/SubstationExpendMapper.xml b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/SubstationExpendMapper.xml new file mode 100644 index 000000000..cbb6b3885 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/mapping/SubstationExpendMapper.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ISubstationExpendService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ISubstationExpendService.java new file mode 100644 index 000000000..c6550dc19 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ISubstationExpendService.java @@ -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; + +/** + *

+ * 服务类 + *

+ * + * @author zhuxinyu + * @since 2023-05-08 + */ +public interface ISubstationExpendService extends IService { + + + Map> getSubstationExpendInfo(StatisticsBizBaseParam param); + + +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ISubstationRelationService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ISubstationRelationService.java new file mode 100644 index 000000000..29a03392a --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/ISubstationRelationService.java @@ -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; + +/** + *

+ * 2.电网拓扑图关系表 服务类 + *

+ * + * @author zhuxinyu + * @since 2023-05-08 + */ +public interface ISubstationRelationService extends IService { + + Boolean saveSubstationRelation(SubstationRelation param); +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/impl/SubstationExpendServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/impl/SubstationExpendServiceImpl.java new file mode 100644 index 000000000..cae38a721 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/impl/SubstationExpendServiceImpl.java @@ -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; + +/** + *

+ * 服务实现类 + *

+ * + * @author zhuxinyu + * @since 2023-05-08 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class SubstationExpendServiceImpl extends ServiceImpl implements ISubstationExpendService { + + private final DeptFeignClient deptFeignClient; + + private final SubstationExpendMapper substationExpendMapper; + + @Override + public Map> getSubstationExpendInfo(StatisticsBizBaseParam param) { + Map> map = new HashMap<>(); + List deptInfos = deptFeignClient.getDeptDescendantIndexes(param.getId(), Stream.of(0, 1).collect(Collectors.toList())).getData(); + if (CollectionUtil.isNotEmpty(deptInfos)) { + List list = deptInfos.stream() + .map(DeptDTO::getId) + .collect(Collectors.toList()); + // 获取部门所属变电站 + List subList=substationExpendMapper.getSubList(list, param); + if (CollUtil.isNotEmpty(subList)) { + subList.forEach ( + t -> { + if (t.getBreakSite()!=null) { + List simpleDTOS = new ArrayList<>(); + String[][] arr = JSON.parseObject(t.getBreakSite(), String[][].class); + List 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; + } +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/impl/SubstationRelationServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/impl/SubstationRelationServiceImpl.java new file mode 100644 index 000000000..9f926801d --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/impl/SubstationRelationServiceImpl.java @@ -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; + +/** + *

+ * 2.电网拓扑图关系表 服务实现类 + *

+ * + * @author zhuxinyu + * @since 2023-05-08 + */ +@Service +public class SubstationRelationServiceImpl extends ServiceImpl implements ISubstationRelationService { + + @Override + public Boolean saveSubstationRelation(SubstationRelation param) { + return this.save(param); + } +} diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml index f6bfce23f..6aa582758 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml @@ -852,28 +852,28 @@ ROUND(SUM(t.statisValue)/flowMeal,2) flowProportion from ( SELECT - device.id id, - device.Name name, - sub.Name substation, - device.Update_Time updateTime, - b.run_flag runFlag, - b.com_flag comFlag, - 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 + device.id id, + device.Name name, + sub.Name substation, + device.Update_Time updateTime, + b.run_flag runFlag, + b.com_flag comFlag, + 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 FROM cld_month_flow m INNER JOIN pq_line device ON device.id=m.Dev_Id INNER JOIN pq_device b ON device.id=b.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 d1 ON c.Ream_Meal_Id = d1.id - where device.id in - + WHERE m.Dev_Id IN + #{item} - and - m.Time_Id between #{startTime} and #{endTime} - and + AND + device.Update_Time between #{startTime} and #{endTime} + AND b.Run_Flag != 2 ) t GROUP BY t.id