Merge remote-tracking branch 'origin/master'

This commit is contained in:
cdf
2025-08-06 17:12:10 +08:00
2 changed files with 32 additions and 26 deletions

View File

@@ -30,32 +30,32 @@
<select id="getBaseLineInfo" resultType="com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO"> <select id="getBaseLineInfo" resultType="com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO">
select
PQ_GDINFORMATION.name gdName, WITH temp AS(
pq_line.GD_INDEX gdIndex, select PQ_USER_LINE_ASS.LINE_INDEX LINE_INDEX,listagg(PQ_USER_LEDGER.CUSTOMER_NAME,';') within GROUP (order by PQ_USER_LEDGER.CUSTOMER_NAME) objName from PQ_USER_LINE_ASS ,PQ_USER_LEDGER where PQ_USER_LINE_ASS.USER_INDEX=PQ_USER_LEDGER.ID group by PQ_USER_LINE_ASS.LINE_INDEX
pq_line.line_index lineId, )
pq_line.name lineName, select
PQ_LINEDETAIL.objname objName, PQ_GDINFORMATION.name gdName,
PQ_SUBVOLTAGE.SUBV_INDEX busBarId, pq_line.GD_INDEX gdIndex,
PQ_SUBVOLTAGE.name busBarName, pq_line.line_index lineId,
pq_device.dev_index devId, pq_line.name lineName,
pq_device.name devName, PQ_SUBVOLTAGE.SUBV_INDEX busBarId,
pq_device.Status runFlag, PQ_SUBVOLTAGE.name busBarName,
PQ_SUBSTATION.sub_index stationId, pq_device.dev_index devId,
PQ_SUBSTATION.name stationName pq_device.name devName,
from pq_device.Status runFlag,
pq_line, PQ_SUBSTATION.sub_index stationId,
PQ_LINEDETAIL, PQ_SUBSTATION.name stationName,
PQ_SUBVOLTAGE, temp.objName objName
pq_device, from
PQ_SUBSTATION, pq_line LEFT JOIN PQ_SUBVOLTAGE on pq_line.SUBV_INDEX = PQ_SUBVOLTAGE.SUBV_INDEX
PQ_GDINFORMATION LEFT JOIN
where pq_line.line_index = PQ_LINEDETAIL.line_index pq_device on PQ_SUBVOLTAGE.DEV_INDEX = pq_device.DEV_INDEX
and pq_line.SUBV_INDEX = PQ_SUBVOLTAGE.SUBV_INDEX LEFT JOIN PQ_SUBSTATION on pq_device.SUB_INDEX = PQ_SUBSTATION.SUB_INDEX
and PQ_SUBVOLTAGE.DEV_INDEX = pq_device.DEV_INDEX LEFT JOIN PQ_GDINFORMATION on pq_line.GD_INDEX =PQ_GDINFORMATION.GD_INDEX
and pq_device.SUB_INDEX = PQ_SUBSTATION.SUB_INDEX LEFT JOIN temp on temp.LINE_INDEX = pq_line.LINE_INDEX
and pq_line.GD_INDEX =PQ_GDINFORMATION.GD_INDEX where 1=1
and pq_line.line_index in and pq_line.line_index in
<foreach collection="ids" item="item" open="(" close=")" separator=","> <foreach collection="ids" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>

View File

@@ -12,6 +12,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.gather.event.devcie.mapper.PqLineMapper; import com.njcn.gather.event.devcie.mapper.PqLineMapper;
import com.njcn.gather.event.devcie.pojo.po.PqLine; import com.njcn.gather.event.devcie.pojo.po.PqLine;
import com.njcn.gather.event.devcie.service.PqLineService; import com.njcn.gather.event.devcie.service.PqLineService;
import org.springframework.util.CollectionUtils;
/** /**
* *
* Description: * Description:
@@ -27,6 +29,10 @@ public class PqLineServiceImpl extends ServiceImpl<PqLineMapper, PqLine> impleme
@Override @Override
public List<LedgerBaseInfoDTO> getBaseLineInfo(List<Integer> ids){ public List<LedgerBaseInfoDTO> getBaseLineInfo(List<Integer> ids){
List<LedgerBaseInfoDTO> ledgerBaseInfoDTOS = new ArrayList<>(); List<LedgerBaseInfoDTO> ledgerBaseInfoDTOS = new ArrayList<>();
if(CollectionUtils.isEmpty(ids)){
return ledgerBaseInfoDTOS;
}
if(ids.size()>1000){ if(ids.size()>1000){
List<List<Integer>> listIds = CollUtil.split(ids,1000); List<List<Integer>> listIds = CollUtil.split(ids,1000);
for(List<Integer> itemIds : listIds){ for(List<Integer> itemIds : listIds){