sql适配大梦数据库

This commit is contained in:
cdf
2025-12-19 16:15:55 +08:00
parent 670eaf7d38
commit eeb27c519b
8 changed files with 28 additions and 31 deletions

View File

@@ -7,10 +7,10 @@
SELECT DISTINCT SELECT DISTINCT
monitor.Org_Id AS orgId, monitor.Org_Id AS orgId,
monitor.Org_Name AS orgName, monitor.Org_Name AS orgName,
monitor.`Powerr_Id` AS powerId, monitor.Powerr_Id AS powerId,
monitor.`Powerr_Name` AS powerName, monitor.Powerr_Name AS powerName,
monitor.id AS monitorId, monitor.id AS monitorId,
monitor.`Name` AS monitorName, monitor.Name AS monitorName,
monitor.Line_Id, monitor.Line_Id,
monitor.Line_Name, monitor.Line_Name,
pdm.Monitor_Sort AS monitorSort, pdm.Monitor_Sort AS monitorSort,
@@ -29,8 +29,8 @@
( (
SELECT SELECT
pm.id, pm.id,
pm.`Name`, pm.Name,
pm.`Status`, pm.Status,
pm.Org_Id, pm.Org_Id,
pm.Org_Name, pm.Org_Name,
pm.Powerr_Id, pm.Powerr_Id,
@@ -51,8 +51,8 @@
) AS monitor ) AS monitor
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
WHERE WHERE
monitor.`Status` = 1 monitor.Status = 1
AND pdm.`Status` = 1 AND pdm.Status = 1
AND monitor.Org_Id IN AND monitor.Org_Id IN
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=","> <foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
#{orgId} #{orgId}
@@ -85,7 +85,7 @@
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser} AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
</if> </if>
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''"> <if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%') AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
</if> </if>
</select> </select>

View File

@@ -30,12 +30,12 @@
<select id="getAnomalousData" resultType="OnlineMonitorVo"> <select id="getAnomalousData" resultType="OnlineMonitorVo">
SELECT DISTINCT SELECT DISTINCT
t6.`Name` gdName, t6.Name gdName,
t5.`Name` subName, t5.Name subName,
t4.`Name` deviceName, t4.Name deviceName,
t1.Line_Id lineId, t1.Line_Id lineId,
t2.`Name` lineName, t2.Name lineName,
t8.`Name` monitorObjType, t8.Name monitorObjType,
t7.Obj_Name monitorObj, t7.Obj_Name monitorObj,
"异常数据" as target, "异常数据" as target,
count(t1.time_id) lastDay count(t1.time_id) lastDay

View File

@@ -381,7 +381,7 @@
line.LEVEL, line.LEVEL,
line.sort, line.sort,
line.pids, line.pids,
CONCAT(voltage.name, '_', line.name, '(',device.`Name`,')') name, CONCAT(voltage.name, '_', line.name, '(',device.Name,')') name,
comFlag.Com_Flag, comFlag.Com_Flag,
detail.pt_type, detail.pt_type,
detail.obj_id detail.obj_id

View File

@@ -1542,7 +1542,7 @@
<select id="selectByIds" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$Detail"> <select id="selectByIds" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$Detail">
SELECT DISTINCT SELECT DISTINCT
line.id as lineId, line.id as lineId,
dept.`Name` deptName, dept.Name deptName,
area.name as areaId, area.name as areaId,
gd.NAME gdName, gd.NAME gdName,
substation.NAME subName, substation.NAME subName,

View File

@@ -112,12 +112,12 @@
<select id="getNoData" resultType="OnlineMonitorVo"> <select id="getNoData" resultType="OnlineMonitorVo">
SELECT DISTINCT SELECT DISTINCT
t6.`Name` gdName, t6.Name gdName,
t5.`Name` subName, t5.Name subName,
t4.`Name` deviceName, t4.Name deviceName,
t1.line_index lineId, t1.line_index lineId,
t2.`Name` lineName, t2.Name lineName,
t8.`Name` monitorObjType, t8.Name monitorObjType,
t7.Obj_Name monitorObj, t7.Obj_Name monitorObj,
"完整性为0" as target, "完整性为0" as target,
count(t1.time_id) lastDay count(t1.time_id) lastDay

View File

@@ -22,10 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@@ -67,7 +64,7 @@ public class AreaInfoServiceImpl implements AreaInfoService {
if (CollectionUtil.isNotEmpty(lineIds)) { if (CollectionUtil.isNotEmpty(lineIds)) {
List<AreaLineInfoVO> resList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData(); List<AreaLineInfoVO> resList = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
if (1 == deviceInfoParam.getIsPollution()) { if (Objects.equals(1,deviceInfoParam.getIsPollution())) {
OnlineRateParam.Info param = new OnlineRateParam.Info(); OnlineRateParam.Info param = new OnlineRateParam.Info();
param.setIds(resList.stream().map(AreaLineInfoVO::getLineId).distinct().collect(Collectors.toList())); param.setIds(resList.stream().map(AreaLineInfoVO::getLineId).distinct().collect(Collectors.toList()));
param.setDicData(deviceInfoParam.getDicData()); param.setDicData(deviceInfoParam.getDicData());

View File

@@ -7,10 +7,10 @@
p1.id id, p1.id id,
p2.Org_Name dept, p2.Org_Name dept,
p2.Powerr_Name substation, p2.Powerr_Name substation,
p3.`Name` deviceName, p3.Name deviceName,
p2.`Name` lineName, p2.Name lineName,
p1.line_id lineId, p1.line_id lineId,
p4.`Name` businessType, p4.Name businessType,
p2.Monitor_Object_Name objectName, p2.Monitor_Object_Name objectName,
p1.target_type targetType, p1.target_type targetType,
p1.over_limit_day overLimitDay, p1.over_limit_day overLimitDay,

View File

@@ -18,7 +18,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
Id, page_name, thumbnail, remark, container_config, sort, `state`, Create_By, Create_Time, Id, page_name, thumbnail, remark, container_config, sort, "state", Create_By, Create_Time,
Update_By, Update_Time Update_By, Update_Time
</sql> </sql>