package com.njcn.prepare.harmonic.service.mysql.Impl.line;

import com.njcn.harmonic.pojo.po.*;
import com.njcn.harmonic.pojo.po.day.*;
import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.prepare.harmonic.constant.InfluxdbPOConverter;
import com.njcn.prepare.harmonic.pojo.influxdb.po.*;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpFlickerReportDPO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpHarmonicPReportDPO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpInharmonicIMagReportDPO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpPltReportDPO;
import com.njcn.prepare.harmonic.service.mysql.day.*;
import com.njcn.prepare.harmonic.service.mysql.line.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.influxdb.InfluxDB;
import org.influxdb.dto.BatchPoints;
import org.influxdb.dto.Point;
import org.influxdb.dto.QueryResult;
import org.influxdb.impl.InfluxDBResultMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

/**
 * Description:
 * 接口文档访问地址：http://serverIP:port/swagger-ui.html
 * Date: 2022/10/24  9:46【需求编号】
 *
 * @author clam
 * @version V1.0.0
 */

@Slf4j
@Component
@RequiredArgsConstructor
public class DayDataServiceImpl implements DayDataService {

    private final RMpHarmonicVRateReportDPOService rMpHarmonicVRateReportDPOService;
    private final RMpHarmonicIMagReportDPOService rMpHarmonicIMagReportDPOService;
    private final RMpFlickerReportDPOService rMpFlickerReportDPOService;
    private final RMpPltReportDPOService rMpPltReportDPOService;
    private final RMpHarmonicIRateReportDPOService rMpHarmonicIRateReportDPOService;
    private final RMpInharmonicIRateReportDPOService rMpInharmonicIRateReportDPOService;
    private final  RMpInharmonicIMagReportDPOService rMpInharmonicIMagReportDPOService;
    private final  RMpInharmonicVRateReportDPOService rMpInharmonicVRateReportDPOService;
    private final RMpHarmonicPReportDPOService rMpHarmonicPReportDPOService;
    private final RMpMeasurePhaseReportDPOService rMpMeasurePhaseReportDPOService;
    private final RMpMeasureReportDPOService rMpMeasureReportDPOService;

    //MySQL
    private final IRStatDataFlickerDService statDataFlickerDService;
    private final IRStatDataVDService statDataVDService;
    private final IRStatDataIDService statDataIDService;
    private final IRStatDataFlucDService statDataFlucDService;
    private final IRStatDataHarmphasicIDService statDataHarmphasicIDService;
    private final IRStatDataHarmphasicVDService statDataHarmphasicVDService;
    private final IRStatDataHarmpowerPDService statDataHarmpowerPDService;
    private final IRStatDataHarmpowerQDService statDataHarmpowerQDService;
    private final IRStatDataHarmpowerSDService statDataHarmpowerSDService;
    private final IRStatDataHarmRateIDService statDataHarmRateIDService;
    private final IRStatDataHarmRateVDService statDataHarmRateVDService;
    private final IRStatDataInharmIDService statDataInharmIDService;
    private final IRStatDataInharmVDService statDataInharmVDService;
    private final IRStatDataPltDService statDataPltDService;

    private final InfluxDbUtils influxDbUtils;

    /**
     * @param indexLists
     * @param startTime
     * @param endTime
     * @Description: 生成day表相关数据
     * @Param: [indexLists, startTime, endTime]
     * @return: void
     * @Author: clam
     * @Date: 2022/10/24
     */
    @Override
    @Transactional(
            rollbackFor = {Exception.class}
    )
    @Async("asyncExecutor")
    public void dayDataJobHandler(List<String> indexLists, String startTime, String endTime) {


        Instant instant = null;
//        influxDbUtils.setDbName ("pqsbase");
        try {
            instant = new SimpleDateFormat ("yyyy-MM-dd").parse (startTime).toInstant ( );
        } catch (ParseException e) {
            e.printStackTrace ( );
        }
        Long time= instant.toEpochMilli();

        List<DataVPO> dataVPOList = new ArrayList<> ();
        List<DataIPO> dataIPOList = new ArrayList<> ();
        List<DataFlickerPO> dataFlickerPOList = new ArrayList<> ();
        List<DataFlucPO> dataFlucPOList = new ArrayList<> ();
        List<DataHarmPhasicIPO> dataHarmPhasicIPOList = new ArrayList<> ();
        List<DataHarmPhasicVPO> dataHarmPhasicVPOList = new ArrayList<> ();
        List<DataHarmPowerPPO> dataHarmPowerPPOList = new ArrayList<> ();
        List<DataHarmPowerQPO> dataHarmPowerQPOList = new ArrayList<> ();
        List<DataHarmPowerSPO> dataHarmPowerSPOList = new ArrayList<> ();
        List<DataHarmRateIPO> dataHarmRateIPOList = new ArrayList<> ();
        List<DataHarmRateVPO> dataHarmRateVPOList = new ArrayList<> ();
        List<DataInHarmIPO> dataInHarmIPOList  = new ArrayList<> ();
        List<DataInHarmVPO> dataInHarmVPOList = new ArrayList<> ();
        List<DataInHarmRateIPO> dataInHarmRateIPOList = new ArrayList<> ();
        List<DataInHarmRateVPO> dataInHarmRateVPOList = new ArrayList<> ();
        List<DataPltPO> dataPltPOList = new ArrayList<> ();

        List<RMpHarmonicVRateReportD> rMpHarmonicVRateReportDPOList = new ArrayList<> ();
        List<RMpHarmonicIMagReportD> rMpHarmonicIMagReportDPOList = new ArrayList<> ();
        List<RMpFlickerReportDPO> rMpFlickerReportDPOList = new ArrayList<> ();
        List<RMpPltReportDPO> rMpPltReportDPOList = new ArrayList<> ();
        List<RMpHarmonicIRateReportD> rMpHarmonicIRateReportDPOList = new ArrayList<> ();
        List<RMpInharmonicIRateReportD> rMpInharmonicIRateReportDPOList = new ArrayList<> ();
        List<RMpInharmonicIMagReportDPO> rMpInharmonicIMagReportDPOList = new ArrayList<> ();
        List<RMpInharmonicVRateReportD> rMpInharmonicVRateReportDPOList = new ArrayList<> ();
        List<RMpHarmonicPReportDPO>  rMpHarmonicPReportDPOList = new ArrayList<> ();
        List<RMpMeasurePhaseReportD>  rMpMeasurePhaseReportDPOArrayList = new ArrayList<> ();
        List<RMpMeasureReportD>  rMpMeasureReportDPOArrayList = new ArrayList<> ();








        for (int i = 0; i <indexLists.size () ; i++) {

            String lineIndex =indexLists.get (i);
            /*生成dayV表*/
            List<DataVPO> dataV = getDataV(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataV)){
                dataVPOList.addAll (dataV);
            }
            /*生成dayI表*/
            List<DataIPO> dataI = getDataI(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataI)){
                dataIPOList.addAll (dataI);
            }
            List<DataFlickerPO> dataFlickerPO = getDataFlicker(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataFlickerPO)){
                dataFlickerPOList.addAll (dataFlickerPO);
            }
            /*生成dayFluc表*/
            List<DataFlucPO> dataFlucPO = getDataFluc(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataFlucPO)){
                dataFlucPOList.addAll (dataFlucPO);
            }

            /*生成dayHarmphasicI表*/
            List<DataHarmPhasicIPO> dataHarmphasicIPO = getDataHarmphasicI(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataHarmphasicIPO)){
                dataHarmPhasicIPOList.addAll (dataHarmphasicIPO);
            }

            /*生成dayHarmphasicV表*/
            List<DataHarmPhasicVPO> dataHarmphasicVPO = getDataHarmphasicV(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataHarmphasicVPO)){
                dataHarmPhasicVPOList.addAll (dataHarmphasicVPO);
            }

            /*生成dayHarmPowerP表*/
            List<DataHarmPowerPPO> dataHarmPowerPPO = getDataHarmPowerP(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataHarmPowerPPO)){
                dataHarmPowerPPOList.addAll (dataHarmPowerPPO);
            }
            /*生成dayHarmPowerQ表*/
            List<DataHarmPowerQPO> dataHarmPowerQPO = getDataHarmPowerQ(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataHarmPowerQPO)){
                dataHarmPowerQPOList.addAll (dataHarmPowerQPO);
            }

            /*生成dayHarmPowerS表*/
            List<DataHarmPowerSPO> dataHarmPowers = getDataHarmPowerS(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataHarmPowers)){
                dataHarmPowerSPOList.addAll (dataHarmPowers);
            }

            /*生成dayHarmRateI*/
            List<DataHarmRateIPO> dataHarmRateI = getDataHarmRateI(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataHarmRateI)){
                dataHarmRateIPOList.addAll (dataHarmRateI);

            }

            /*生成dayHarmRateV*/
            List<DataHarmRateVPO> dataHarmRateVPO = getDataHarmRateV(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataHarmRateVPO)){
                dataHarmRateVPOList.addAll (dataHarmRateVPO);
            }

            /*生成dayInHarmI*/
            List<DataInHarmIPO> dataInHarmIPO = getDataInHarmI(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataInHarmIPO)){
                dataInHarmIPOList.addAll (dataInHarmIPO);
            }

            /*生成dayInHarmV*/
            List<DataInHarmVPO> dataInHarmVPO = getDataInHarmV(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataInHarmVPO)){
                dataInHarmVPOList.addAll (dataInHarmVPO);
            }

            /*生成dayInHarmRateI*/
            List<DataInHarmRateIPO> dataInHarmRateIPO = getDataInHarmRateI(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataInHarmRateIPO)){
                dataInHarmRateIPOList.addAll (dataInHarmRateIPO);
            }

            /*生成dayInHarmRateV*/
            List<DataInHarmRateVPO> dataInHarmRateVPO = getDataInHarmRateV(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataInHarmRateVPO)){
                dataInHarmRateVPOList.addAll (dataInHarmRateVPO);
            }

            /*生成dayPlt*/
            List<DataPltPO> dataPlt = getDataPlt(lineIndex,startTime,endTime);
            if(!CollectionUtils.isEmpty (dataPlt)){
                dataPltPOList.addAll (dataPlt);
            }

            /*mysql数据转化 */
            /*RMpHarmonicVRateReportDPO*/
//            if(!CollectionUtils.isEmpty (dataV)&&!CollectionUtils.isEmpty (dataHarmRateVPO)){
//                /*转成mysql对应po*/
//                /*dataVPO.getPhaseType ()="A"数据*/
//                RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOA = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO,"A",instant);
//                Optional.ofNullable (rMpHarmonicVRateReportDPOA).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
//                /*dataVPO.getPhaseType ()="B"数据*/
//                RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOB = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO,"B",instant);
//                Optional.ofNullable (rMpHarmonicVRateReportDPOB).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
//
//                /*dataVPO.getPhaseType ()="C"数据*/
//                RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOC = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO, "C",instant);
//                Optional.ofNullable (rMpHarmonicVRateReportDPOC).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
//
//                /*dataVPO.getPhaseType ()="T"数据*/
//                RMpHarmonicVRateReportD rMpHarmonicVRateReportDPOT = packageRMpHarmonicVRateReportDPO (dataV, dataHarmRateVPO,"T",instant);
//                Optional.ofNullable (rMpHarmonicVRateReportDPOT).ifPresent (temp ->rMpHarmonicVRateReportDPOList.add (temp));
//
//
//            }
//            /*RMpHarmonicIMagReportDPO*/
//            if(!CollectionUtils.isEmpty (dataI)){
//
//                /*转成mysql对应po*/
//                /*dataI.getPhaseType ()="A"数据*/
//                RMpHarmonicIMagReportD a = packageRMpHarmonicIMagReportDPO (dataI, "A",instant);
//                Optional.ofNullable (a).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
//                /*dataI.getPhaseType ()="B"数据*/
//                RMpHarmonicIMagReportD b = packageRMpHarmonicIMagReportDPO(dataI,"B",instant);
//                Optional.ofNullable (b).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
//                /*dataI.getPhaseType ()="C"数据*/
//                RMpHarmonicIMagReportD c = packageRMpHarmonicIMagReportDPO(dataI,"C",instant);
//                Optional.ofNullable (c).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
//                /*dataI.getPhaseType ()="T"数据*/
//                RMpHarmonicIMagReportD t = packageRMpHarmonicIMagReportDPO(dataI,"T",instant);
//                Optional.ofNullable (t).ifPresent (temp ->rMpHarmonicIMagReportDPOList.add (temp));
//
//
//            }
//            /*生成dayFlicker表*/
//            if(!CollectionUtils.isEmpty (dataFlickerPO)){
//                /*生成dayFlicker表*/
//                /*dataFlickerPO.getPhaseType ()="A"数据*/
//                RMpFlickerReportDPO a = packageRMpFlickerReportDPOPO (dataFlickerPO, "A",instant);
//                Optional.ofNullable (a).ifPresent (temp ->rMpFlickerReportDPOList.add (temp));
//
//                /*dataFlickerPO.getPhaseType ()="B"数据*/
//                RMpFlickerReportDPO b = packageRMpFlickerReportDPOPO(dataFlickerPO,"B",instant);
//                Optional.ofNullable (b).ifPresent (temp ->rMpFlickerReportDPOList.add (temp));
//
//                /*dataFlickerPO.getPhaseType ()="C"数据*/
//                RMpFlickerReportDPO c = packageRMpFlickerReportDPOPO(dataFlickerPO,"C",instant);
//                Optional.ofNullable (c).ifPresent (temp ->rMpFlickerReportDPOList.add (temp));
//                /*无T项数据*/
////                /*dataFlickerPO.getPhaseType ()="T"数据*/
////                RMpFlickerReportDPO t = packageRMpFlickerReportDPOPO(dataFlickerPO,"T");
//
//
//            }
//            if(!CollectionUtils.isEmpty (dataPlt)){
//                /*转成mysql对应po*/
//                /*DataPltPO.getPhaseType ()="A"数据*/
//                RMpPltReportDPO a = packageRMpPltReportDPO (dataPlt, "A",instant);
//                Optional.ofNullable (a).ifPresent (temp ->rMpPltReportDPOList.add (temp));
//                /*DataPltPO.getPhaseType ()="B"数据*/
//                RMpPltReportDPO b = packageRMpPltReportDPO(dataPlt,"B",instant);
//                Optional.ofNullable (b).ifPresent (temp ->rMpPltReportDPOList.add (temp));
//                /*DataPltPO.getPhaseType ()="C"数据*/
//                RMpPltReportDPO c = packageRMpPltReportDPO(dataPlt,"C",instant);
//                Optional.ofNullable (c).ifPresent (temp ->rMpPltReportDPOList.add (temp));
////                /*DataPltPO.getPhaseType ()="T"数据*/
////                RMpPltReportDPO t = packageRMpPltReportDPO(dataPlt,"T");
//            }
//            if(!CollectionUtils.isEmpty (dataHarmRateI)) {
//                /*转成mysql对应po*/
//                /*DataHarmRateIPO.getPhaseType ()="A"数据*/
//                RMpHarmonicIRateReportD a = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "A",instant);
//                Optional.ofNullable (a).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
//
//                /*DataHarmRateIPO.getPhaseType ()="B"数据*/
//                RMpHarmonicIRateReportD b = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "B",instant);
//                Optional.ofNullable (b).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
//
//                /*DataHarmRateIPO.getPhaseType ()="C"数据*/
//                RMpHarmonicIRateReportD c = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "C",instant);
//                Optional.ofNullable (c).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
//
//                /*DataInHarmRateIPO.getPhaseType ()="T"数据*/
//                RMpHarmonicIRateReportD t = packageRMpHarmonicIRateReportDPO (dataHarmRateI, "T",instant);
//                Optional.ofNullable (t).ifPresent (temp -> rMpHarmonicIRateReportDPOList.add (temp));
//            }
//
//            if(!CollectionUtils.isEmpty (dataInHarmRateIPO)){
//                /*转成mysql对应po*/
//                /*DataInHarmRateIPO.getPhaseType ()="A"数据*/
//                RMpInharmonicIRateReportD a = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO, "A",instant);
//                Optional.ofNullable (a).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
//
//                /*DataInHarmRateIPO.getPhaseType ()="B"数据*/
//                RMpInharmonicIRateReportD b = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"B",instant);
//                Optional.ofNullable (b).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
//
//                /*DataInHarmRateIPO.getPhaseType ()="C"数据*/
//                RMpInharmonicIRateReportD c = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"C",instant);
//                Optional.ofNullable (c).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
//
//                /*DataInHarmRateIPO.getPhaseType ()="T"数据*/
//                RMpInharmonicIRateReportD t = packageRMpInharmonicIRateReportDPO(dataInHarmRateIPO,"T",instant);
//                Optional.ofNullable (t).ifPresent (temp ->rMpInharmonicIRateReportDPOList.add (temp));
//
//
//            }
//
//            if(!CollectionUtils.isEmpty (dataInHarmIPO)){
//                /*转成mysql对应po*/
//                /*dataInHarmIPO.getPhaseType ()="A"数据*/
//                RMpInharmonicIMagReportDPO a = packageRMpInharmonicIMagReportDPO(dataInHarmIPO, "A",instant);
//                Optional.ofNullable (a).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
//                /*dataInHarmIPO.getPhaseType ()="B"数据*/
//                RMpInharmonicIMagReportDPO b = packageRMpInharmonicIMagReportDPO(dataInHarmIPO,"B",instant);
//                Optional.ofNullable (b).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
//                /*dataInHarmIPO.getPhaseType ()="C"数据*/
//                RMpInharmonicIMagReportDPO c = packageRMpInharmonicIMagReportDPO(dataInHarmIPO,"C",instant);
//                Optional.ofNullable (c).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
//                /*dataInHarmIPO.getPhaseType ()="T"数据*/
//                RMpInharmonicIMagReportDPO t = packageRMpInharmonicIMagReportDPO(dataInHarmIPO,"T",instant);
//                Optional.ofNullable (t).ifPresent (temp ->rMpInharmonicIMagReportDPOList.add (temp));
//
//            }
//            if(!CollectionUtils.isEmpty (dataInHarmRateVPO)){
//                /*转成mysql对应po*/
//                /*dataInHarmRateVPO.getPhaseType ()="A"数据*/
//                RMpInharmonicVRateReportD a = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO, "A",instant);
//                Optional.ofNullable (a).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
//                /*dataInHarmRateVPO.getPhaseType ()="B"数据*/
//                RMpInharmonicVRateReportD b = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO,"B",instant);
//                Optional.ofNullable (b).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
//                /*dataInHarmRateVPO.getPhaseType ()="C"数据*/
//                RMpInharmonicVRateReportD c = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO,"C",instant);
//                Optional.ofNullable (c).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
//                /*dataInHarmRateVPO.getPhaseType ()="T"数据*/
//                RMpInharmonicVRateReportD t = packageRMpInharmonicVRateReportDPO(dataInHarmRateVPO,"T",instant);
//                Optional.ofNullable (t).ifPresent (temp ->rMpInharmonicVRateReportDPOList.add (temp));
//
//            }
//
//            if(!CollectionUtils.isEmpty (dataHarmPowerPPO)&&!CollectionUtils.isEmpty (dataHarmPowerQPO)){
//                /*转成mysql对应po*/
//                /*dataInHarmRateVPO.getPhaseType ()="A"数据*/
//                RMpHarmonicPReportDPO a = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO, "A",instant);
//                Optional.ofNullable (a).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
//                /*dataInHarmRateVPO.getPhaseType ()="B"数据*/
//                RMpHarmonicPReportDPO b = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO,"B",instant);
//                Optional.ofNullable (b).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
//                /*dataInHarmRateVPO.getPhaseType ()="C"数据*/
//                RMpHarmonicPReportDPO c = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO,"C",instant);
//                Optional.ofNullable (c).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
//                /*dataInHarmRateVPO.getPhaseType ()="T"数据*/
//                RMpHarmonicPReportDPO t = packageRMpHarmonicPReportDPO(dataHarmPowerPPO,dataHarmPowerQPO,"T",instant);
//                Optional.ofNullable (t).ifPresent (temp ->rMpHarmonicPReportDPOList.add (temp));
//
//            }
//
//
//            if (!CollectionUtils.isEmpty (dataV) &&
//                    !CollectionUtils.isEmpty (dataI) &&
//                    !CollectionUtils.isEmpty (dataHarmPowerPPO) &&
//                    !CollectionUtils.isEmpty (dataHarmPowers) &&
//                    !CollectionUtils.isEmpty (dataHarmPowerQPO)) {
//                /*转成mysql对应po*/
//                /*dataInHarmRateVPO.getPhaseType ()="A"数据*/
//                RMpMeasurePhaseReportD a = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"A",instant);
//                Optional.ofNullable (a).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
//                /*dataInHarmRateVPO.getPhaseType ()="B"数据*/
//                RMpMeasurePhaseReportD b = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"B",instant);
//                Optional.ofNullable (b).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
//                /*dataInHarmRateVPO.getPhaseType ()="C"数据*/
//                RMpMeasurePhaseReportD c = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"C",instant);
//                Optional.ofNullable (c).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
//                /*dataInHarmRateVPO.getPhaseType ()="T"数据*/
//                RMpMeasurePhaseReportD t = packageRMpMeasurePhaseReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"T",instant);
//                Optional.ofNullable (t).ifPresent (temp ->rMpMeasurePhaseReportDPOArrayList.add (temp));
//
//            }
//            /* todo
//             *   r_mp_measure_report_d
//             * */
//            if (!CollectionUtils.isEmpty (dataV) &&
//                    !CollectionUtils.isEmpty (dataI) &&
//                    !CollectionUtils.isEmpty (dataHarmPowerPPO) &&
//                    !CollectionUtils.isEmpty (dataHarmPowers) &&
//                    !CollectionUtils.isEmpty (dataHarmPowerQPO)) {
//                /*转成mysql对应po*/
//                /*稳态监测点非谐波不带相位指标即是T项指标*/
//                RMpMeasureReportD t = packageRMpMeasureReportDPO(dataV,dataI,dataHarmPowerPPO,dataHarmPowers,dataHarmPowerQPO,"T",instant);
//                Optional.ofNullable (t).ifPresent (temp ->rMpMeasureReportDPOArrayList.add (temp));
//
//            }

        }


        /*插入mysql*/
//        if (!CollectionUtils.isEmpty(rMpHarmonicVRateReportDPOList)){
//            rMpHarmonicVRateReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicVRateReportDPOList, 50);
//        }
//
//        if (!CollectionUtils.isEmpty(rMpHarmonicIMagReportDPOList)){
//            rMpHarmonicIMagReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicIMagReportDPOList, 50);
//        }
//
//        if (!CollectionUtils.isEmpty(rMpFlickerReportDPOList)){
//            rMpFlickerReportDPOService.saveOrUpdateBatchByMultiId (rMpFlickerReportDPOList, 50);
//        }
//
//        if (!CollectionUtils.isEmpty(rMpPltReportDPOList)){
//            rMpPltReportDPOService.saveOrUpdateBatchByMultiId (rMpPltReportDPOList, 50);
//        }
//
//        if (!CollectionUtils.isEmpty(rMpHarmonicIRateReportDPOList)){
//            rMpHarmonicIRateReportDPOService.saveOrUpdateBatchByMultiId (rMpHarmonicIRateReportDPOList, 50);
//        }
//
//        if (!CollectionUtils.isEmpty(rMpInharmonicIRateReportDPOList)){
//            rMpInharmonicIRateReportDPOService.saveOrUpdateBatchByMultiId (rMpInharmonicIRateReportDPOList, 50);
//        }
//
//        if (!CollectionUtils.isEmpty(rMpInharmonicIMagReportDPOList)){
//            rMpInharmonicIMagReportDPOService.saveOrUpdateBatchByMultiId (rMpInharmonicIMagReportDPOList, 50);
//        }
//
//        if (!CollectionUtils.isEmpty(rMpInharmonicVRateReportDPOList)){
//            rMpInharmonicVRateReportDPOService.saveOrUpdateBatchByMultiId (rMpInharmonicVRateReportDPOList, 50);
//        }
//
//        if (!CollectionUtils.isEmpty(rMpMeasurePhaseReportDPOArrayList)){
//            rMpMeasurePhaseReportDPOService.saveOrUpdateBatchByMultiId (rMpMeasurePhaseReportDPOArrayList, 50);
//        }
//        if (!CollectionUtils.isEmpty(rMpMeasureReportDPOArrayList)){
//            rMpMeasureReportDPOService.saveOrUpdateBatchByMultiId (rMpMeasureReportDPOArrayList, 50);
//        }



        if (!CollectionUtils.isEmpty(dataVPOList)){
            insertDayV(dataVPOList,time);
        }

        if (!CollectionUtils.isEmpty(dataIPOList)){
            insertDayI(dataIPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataFlickerPOList)){
            insertDayFlicker(dataFlickerPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataFlucPOList)){
            insertDayFluc(dataFlucPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataHarmPhasicIPOList)){
            insertDayHarmphasicI(dataHarmPhasicIPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataHarmPhasicVPOList)){
            insertDayHarmphasicV(dataHarmPhasicVPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataHarmPowerPPOList)){
            insertDayHarmPowerP(dataHarmPowerPPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataHarmPowerQPOList)){
            insertDayHarmPowerQ(dataHarmPowerQPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataHarmPowerSPOList)){
            insertDayHarmPowerS(dataHarmPowerSPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataHarmRateIPOList)){
            insertDayHarmRateI(dataHarmRateIPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataHarmRateVPOList)){
            insertDayHarmRateV(dataHarmRateVPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataInHarmIPOList)){
            insertDayInHarmI(dataInHarmIPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataInHarmVPOList)){
            insertDayInHarmV(dataInHarmVPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataInHarmRateIPOList)){
            insertDayInHarmRateI(dataInHarmRateIPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataInHarmRateVPOList)){
            insertDayInHarmRateV(dataInHarmRateVPOList,time);
        }
        if (!CollectionUtils.isEmpty(dataPltPOList)){
            insertDayPlt(dataPltPOList,time);
        }


        log.info(LocalDateTime.now()+"dayDataJobHandler执行完成!");
    }

    @Override
    @Transactional(rollbackFor = {Exception.class})
    @Async("asyncExecutor")
    public void dataToDayHandler(List<String> indexLists, String startTime, String endTime) {
        log.info(LocalDateTime.now()+"data表转day开始=====》");
        Date time = null;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            time = simpleDateFormat.parse(startTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        List<RStatDataFlickerDPO> dataFlickerPOList = new ArrayList<> ();
        List<RStatDataVDPO> dataVPOList = new ArrayList<> ();
        List<RStatDataIDPO> dataIPOList = new ArrayList<> ();
        List<RStatDataFlucDPO> dataFlucPOList = new ArrayList<> ();
        List<RStatDataHarmphasicIDPO> dataHarmPhasicIPOList = new ArrayList<> ();
        List<RStatDataHarmphasicVDPO> dataHarmPhasicVPOList = new ArrayList<> ();
        List<RStatDataHarmpowerPDPO> dataHarmPowerPPOList = new ArrayList<> ();
        List<RStatDataHarmpowerQDPO> dataHarmPowerQPOList = new ArrayList<> ();
        List<RStatDataHarmpowerSDPO> dataHarmPowerSPOList = new ArrayList<> ();
        List<RStatDataHarmrateIDPO> dataHarmRateIPOList = new ArrayList<> ();
        List<RStatDataHarmrateVDPO> dataHarmRateVPOList = new ArrayList<> ();
        List<RStatDataInharmIDPO> dataInHarmIPOList  = new ArrayList<> ();
        List<RStatDataInharmVDPO> dataInHarmVPOList = new ArrayList<> ();
        List<RStatDataPltDPO> dataPltPOList = new ArrayList<> ();

        for (String lineIndex : indexLists) {
            /*生成dayV表*/
            List<DataVPO> dataV = getDataV(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataV)) {
                for (DataVPO item : dataV) {
                    RStatDataVDPO po1 = new RStatDataVDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataVPOList.add(po1);
                }
            }
            /*生成dayI表*/
            List<DataIPO> dataI = getDataI(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataI)) {
                for (DataIPO item : dataI) {
                    RStatDataIDPO po1 = new RStatDataIDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataIPOList.add(po1);
                }
            }
            /*生成dayFlicker表*/
            List<DataFlickerPO> dataFlickerPO = getDataFlicker(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataFlickerPO)) {
                for (DataFlickerPO item : dataFlickerPO) {
                    RStatDataFlickerDPO po1 = new RStatDataFlickerDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataFlickerPOList.add(po1);
                }
            }
            /*生成dayFluc表*/
            List<DataFlucPO> dataFlucPO = getDataFluc(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataFlucPO)) {
                for (DataFlucPO item : dataFlucPO) {
                    RStatDataFlucDPO po1 = new RStatDataFlucDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataFlucPOList.add(po1);
                }
            }
            /*生成dayHarmphasicI表*/
            List<DataHarmPhasicIPO> dataHarmphasicIPO = getDataHarmphasicI(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataHarmphasicIPO)) {
                for (DataHarmPhasicIPO item : dataHarmphasicIPO) {
                    RStatDataHarmphasicIDPO po1 = new RStatDataHarmphasicIDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataHarmPhasicIPOList.add(po1);
                }
            }
            /*生成dayHarmphasicV表*/
            List<DataHarmPhasicVPO> dataHarmphasicVPO = getDataHarmphasicV(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataHarmphasicVPO)) {
                for (DataHarmPhasicVPO item : dataHarmphasicVPO) {
                    RStatDataHarmphasicVDPO po1 = new RStatDataHarmphasicVDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataHarmPhasicVPOList.add(po1);
                }
            }
            /*生成dayHarmPowerP表*/
            List<DataHarmPowerPPO> dataHarmPowerPPO = getDataHarmPowerP(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataHarmPowerPPO)) {
                for (DataHarmPowerPPO item : dataHarmPowerPPO) {
                    RStatDataHarmpowerPDPO po1 = new RStatDataHarmpowerPDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataHarmPowerPPOList.add(po1);
                }
            }
            /*生成dayHarmPowerQ表*/
            List<DataHarmPowerQPO> dataHarmPowerQPO = getDataHarmPowerQ(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataHarmPowerQPO)) {
                for (DataHarmPowerQPO item : dataHarmPowerQPO) {
                    RStatDataHarmpowerQDPO po1 = new RStatDataHarmpowerQDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataHarmPowerQPOList.add(po1);
                }
            }
            /*生成dayHarmPowerS表*/
            List<DataHarmPowerSPO> dataHarmPowers = getDataHarmPowerS(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataHarmPowers)) {
                for (DataHarmPowerSPO item : dataHarmPowers) {
                    RStatDataHarmpowerSDPO po1 = new RStatDataHarmpowerSDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataHarmPowerSPOList.add(po1);
                }
            }
            /*生成dayHarmRateI*/
            List<DataHarmRateIPO> dataHarmRateI = getDataHarmRateI(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataHarmRateI)) {
                for (DataHarmRateIPO item : dataHarmRateI) {
                    RStatDataHarmrateIDPO po1 = new RStatDataHarmrateIDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataHarmRateIPOList.add(po1);
                }
            }
            /*生成dayHarmRateV*/
            List<DataHarmRateVPO> dataHarmRateVPO = getDataHarmRateV(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataHarmRateVPO)) {
                for (DataHarmRateVPO item : dataHarmRateVPO) {
                    RStatDataHarmrateVDPO po1 = new RStatDataHarmrateVDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataHarmRateVPOList.add(po1);
                }
            }
            /*生成dayInHarmI*/
            List<DataInHarmIPO> dataInHarmIPO = getDataInHarmI(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataInHarmIPO)) {
                for (DataInHarmIPO item : dataInHarmIPO) {
                    RStatDataInharmIDPO po1 = new RStatDataInharmIDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataInHarmIPOList.add(po1);
                }
            }
            /*生成dayInHarmV*/
            List<DataInHarmVPO> dataInHarmVPO = getDataInHarmV(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataInHarmVPO)) {
                for (DataInHarmVPO item : dataInHarmVPO) {
                    RStatDataInharmVDPO po1 = new RStatDataInharmVDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataInHarmVPOList.add(po1);
                }
            }
            /*生成dayPlt*/
            List<DataPltPO> dataPlt = getDataPlt(lineIndex, startTime, endTime);
            if (!CollectionUtils.isEmpty(dataPlt)) {
                for (DataPltPO item : dataPlt) {
                    RStatDataPltDPO po1 = new RStatDataPltDPO();
                    BeanUtils.copyProperties(item,po1);
                    po1.setTime(time);
                    po1.setQualityFlag(Integer.parseInt(item.getQualityFlag()));
                    dataPltPOList.add(po1);
                }
            }
        }

        if (!CollectionUtils.isEmpty(dataVPOList)){
            statDataVDService.insert(dataVPOList);
        }
        if (!CollectionUtils.isEmpty(dataIPOList)){
            statDataIDService.insert(dataIPOList);
        }
        if (!CollectionUtils.isEmpty(dataFlickerPOList)){
            statDataFlickerDService.insert(dataFlickerPOList);
        }
        if (!CollectionUtils.isEmpty(dataFlucPOList)){
            statDataFlucDService.insert(dataFlucPOList);
        }
        if (!CollectionUtils.isEmpty(dataHarmPhasicIPOList)){
            statDataHarmphasicIDService.insert(dataHarmPhasicIPOList);
        }
        if (!CollectionUtils.isEmpty(dataHarmPhasicVPOList)){
            statDataHarmphasicVDService.insert(dataHarmPhasicVPOList);
        }
        if (!CollectionUtils.isEmpty(dataHarmPowerPPOList)){
            statDataHarmpowerPDService.insert(dataHarmPowerPPOList);
        }
        if (!CollectionUtils.isEmpty(dataHarmPowerQPOList)){
            statDataHarmpowerQDService.insert(dataHarmPowerQPOList);
        }
        if (!CollectionUtils.isEmpty(dataHarmPowerSPOList)){
            statDataHarmpowerSDService.insert(dataHarmPowerSPOList);
        }
        if (!CollectionUtils.isEmpty(dataHarmRateIPOList)){
            statDataHarmRateIDService.insert(dataHarmRateIPOList);
        }
        if (!CollectionUtils.isEmpty(dataHarmRateVPOList)){
            statDataHarmRateVDService.insert(dataHarmRateVPOList);
        }
        if (!CollectionUtils.isEmpty(dataInHarmIPOList)){
            statDataInharmIDService.insert(dataInHarmIPOList);
        }
        if (!CollectionUtils.isEmpty(dataInHarmVPOList)){
            statDataInharmVDService.insert(dataInHarmVPOList);
        }
        if (!CollectionUtils.isEmpty(dataPltPOList)){
            statDataPltDService.insert(dataPltPOList);
        }


        log.info(LocalDateTime.now()+"data表转day结束=====》");
    }


    /**
     * 功能描述:获取dataV数据
     * @author xy
     * @param lineIndex   监测点集ID
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataV>
     */
    public List<DataVPO> getDataV(String lineIndex, String startTime, String endTime){
        List<DataVPO> result = new ArrayList<> ();
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        stringBuilder1.append("min(freq) AS freq,min(freq_dev) AS freq_dev,min(rms) AS rms,min(rms_lvr) AS rms_lvr,min(v_neg) AS v_neg,min(v_pos) AS v_pos,min(v_thd) AS v_thd,min(v_unbalance) AS v_unbalance,min(v_zero) AS v_zero,min(vl_dev) AS vl_dev,min(vu_dev) AS vu_dev,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder1.append("min(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder2.append ("line_id='").append (lineIndex).append ("' and ").append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_V+" where "+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataVPO> list1 = resultMapper1.toPOJO(sqlResult1, DataVPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        stringBuilder3.append("max(freq) AS freq,max(freq_dev) AS freq_dev,max(rms) AS rms,max(rms_lvr) AS rms_lvr,max(v_neg) AS v_neg,max(v_pos) AS v_pos,max(v_thd) AS v_thd,max(v_unbalance) AS v_unbalance,max(v_zero) AS v_zero,max(vl_dev) AS vl_dev,max(vu_dev) AS vu_dev,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder3.append("max(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder4.append ("line_id='").append (lineIndex).append ("' and ").append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_V+" where "+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataVPO> list2 = resultMapper2.toPOJO(sqlResult2, DataVPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        stringBuilder5.append("mean(freq) AS freq,mean(freq_dev) AS freq_dev,mean(rms) AS rms,mean(rms_lvr) AS rms_lvr,mean(v_neg) AS v_neg,mean(v_pos) AS v_pos,mean(v_thd) AS v_thd,mean(v_unbalance) AS v_unbalance,mean(v_zero) AS v_zero,mean(vl_dev) AS vl_dev,mean(vu_dev) AS vu_dev,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder5.append("mean(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder6.append ("line_id='").append (lineIndex).append ("' and ").append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_V+" where "+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataVPO> list3 = resultMapper3.toPOJO(sqlResult3, DataVPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        stringBuilder7.append("percentile(freq,95) AS freq,percentile(freq_dev,95) AS freq_dev,percentile(rms,95) AS rms,percentile(rms_lvr,95) AS rms_lvr,percentile(v_neg,95) AS v_neg,percentile(v_pos,95) AS v_pos,percentile(v_thd,95) AS v_thd,percentile(v_unbalance,95) AS v_unbalance,percentile(v_zero,95) AS v_zero,percentile(vl_dev,95) AS vl_dev,percentile(vu_dev,95) AS vu_dev,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(v_").append(i).append(",95) AS v_").append(i);
            } else {
                stringBuilder7.append("percentile(v_").append(i).append(",95) AS v_").append(i).append(",");
            }
        }
        stringBuilder8.append ("line_id='").append (lineIndex).append ("' and ").append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_V+" where "+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataVPO> list4 = resultMapper4.toPOJO(sqlResult4, DataVPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }


    /**
     * 功能描述:获取dataI数据
     * @author xy
     * @param lineIndex    监测点ID
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataIPO>
     */
    public List<DataIPO> getDataI(String lineIndex, String startTime, String endTime){
        List<DataIPO> result = new ArrayList<>();
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        stringBuilder1.append("min(rms) AS rms,min(i_neg) AS i_neg,min(i_pos) AS i_pos,min(i_thd) AS i_thd,min(i_unbalance) AS i_unbalance,min(i_zero) AS i_zero,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder1.append("min(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder2.append ("line_id='").append (lineIndex).append ("' and ").append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_I+" where "+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataIPO> list1 = resultMapper1.toPOJO(sqlResult1, DataIPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        stringBuilder3.append("max(rms) AS rms,max(i_neg) AS i_neg,max(i_pos) AS i_pos,max(i_thd) AS i_thd,max(i_unbalance) AS i_unbalance,max(i_zero) AS i_zero,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder3.append("max(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder4.append ("line_id='").append (lineIndex).append ("' and ").append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_I+" where "+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataIPO> list2 = resultMapper2.toPOJO(sqlResult2, DataIPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        stringBuilder5.append("mean(rms) AS rms,mean(i_neg) AS i_neg,mean(i_pos) AS i_pos,mean(i_thd) AS i_thd,mean(i_unbalance) AS i_unbalance,mean(i_zero) AS i_zero,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder5.append("mean(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder6.append ("line_id='").append (lineIndex).append ("' and ").append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_I+" where "+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataIPO> list3 = resultMapper3.toPOJO(sqlResult3, DataIPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        stringBuilder7.append("percentile(rms,95) AS rms,percentile(i_neg,95) AS i_neg,percentile(i_pos,95) AS i_pos,percentile(i_thd,95) AS i_thd,percentile(i_unbalance,95) AS i_unbalance,percentile(i_zero,95) AS i_zero,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(i_").append(i).append(",95) AS i_").append(i);
            } else {
                stringBuilder7.append("percentile(i_").append(i).append(",95) AS i_").append(i).append(",");
            }
        }
        stringBuilder8.append ("line_id='").append (lineIndex).append ("' and ").append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_I+" where "+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataIPO> list4 = resultMapper4.toPOJO(sqlResult4, DataIPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }

    /**
     * 功能描述:获取dataFlicker数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataFlickerPO>
     */
    public List<DataFlickerPO> getDataFlicker(String lineIndex, String startTime, String endTime){
        List<DataFlickerPO> result = new ArrayList<>();
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        String sql1 = "select min(fluc) AS fluc,min(plt) AS plt,min(pst) AS pst from "+ InfluxDBPublicParam.DATA_FLICKER+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataFlickerPO> list1 = resultMapper1.toPOJO(sqlResult1, DataFlickerPO.class);
        list1.forEach(item->{
            item.setValueType("MIN");
        });
        //最大值
        String sql2 = "select max(fluc) AS fluc,max(plt) AS plt,max(pst) AS pst from "+ InfluxDBPublicParam.DATA_FLICKER+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataFlickerPO> list2 = resultMapper2.toPOJO(sqlResult2, DataFlickerPO.class);
        list2.forEach(item->{
            item.setValueType("MAX");
        });
        //平均值
        String sql3 = "select mean(fluc) AS fluc,mean(plt) AS plt,mean(pst) AS pst from "+ InfluxDBPublicParam.DATA_FLICKER+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3= new InfluxDBResultMapper();
        List<DataFlickerPO> list3 = resultMapper3.toPOJO(sqlResult3, DataFlickerPO.class);
        list3.forEach(item->{
            item.setValueType("AVG");
        });
        //CP95值
        String sql4 = "select percentile(fluc,95) AS fluc,percentile(plt,95) AS plt,percentile(pst,95) AS pst from "+ InfluxDBPublicParam.DATA_FLICKER+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4= new InfluxDBResultMapper();
        List<DataFlickerPO> list4 = resultMapper4.toPOJO(sqlResult4, DataFlickerPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }


    /**
     * 功能描述:获取dataFluc数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataFlucPO>
     */
    public List<DataFlucPO> getDataFluc(String lineIndex, String startTime, String endTime){
        List<DataFlucPO> result = new ArrayList<>();
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        String sql1 = "select min(fluc) AS fluc,min(fluccf) AS fluccf from "+ InfluxDBPublicParam.DATA_FLUC+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataFlucPO> list1 = resultMapper1.toPOJO(sqlResult1, DataFlucPO.class);
        list1.forEach(item->{
            item.setValueType("MIN");
        });
        //最大值
        String sql2 = "select max(fluc) AS fluc,max(fluccf) AS fluccf from "+ InfluxDBPublicParam.DATA_FLUC+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataFlucPO> list2 = resultMapper2.toPOJO(sqlResult2, DataFlucPO.class);
        list2.forEach(item->{
            item.setValueType("MAX");
        });
        //平均值
        String sql3 = "select mean(fluc) AS fluc,mean(fluccf) AS fluccf from "+ InfluxDBPublicParam.DATA_FLUC+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3= new InfluxDBResultMapper();
        List<DataFlucPO> list3 = resultMapper3.toPOJO(sqlResult3, DataFlucPO.class);
        list3.forEach(item->{
            item.setValueType("AVG");
        });
        //CP95值
        String sql4 = "select percentile(fluc,95) AS fluc,percentile(fluccf,95) AS fluccf from "+ InfluxDBPublicParam.DATA_FLUC+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4= new InfluxDBResultMapper();
        List<DataFlucPO> list4 = resultMapper4.toPOJO(sqlResult4, DataFlucPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }

    /**
     * 功能描述:获取data_harmphasic_i数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataHarmPhasicIPO>
     */
    public List<DataHarmPhasicIPO> getDataHarmphasicI(String lineIndex, String startTime, String endTime){
        List<DataHarmPhasicIPO> result = new ArrayList<>();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");

        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder1.append("min(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_HARM_PHASIC_I+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataHarmPhasicIPO> list1 = resultMapper1.toPOJO(sqlResult1, DataHarmPhasicIPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder3.append("max(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_HARM_PHASIC_I+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataHarmPhasicIPO> list2 = resultMapper2.toPOJO(sqlResult2, DataHarmPhasicIPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder5.append("mean(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_HARM_PHASIC_I+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataHarmPhasicIPO> list3 = resultMapper3.toPOJO(sqlResult3, DataHarmPhasicIPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(i_").append(i).append(",95) AS i_").append(i);
            } else {
                stringBuilder7.append("percentile(i_").append(i).append(",95) AS i_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_HARM_PHASIC_I+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataHarmPhasicIPO> list4 = resultMapper4.toPOJO(sqlResult4, DataHarmPhasicIPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }


    /**
     * 功能描述:获取data_harmphasic_v数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataHarmPhasicVPO>
     */
    public List<DataHarmPhasicVPO> getDataHarmphasicV(String lineIndex, String startTime, String endTime){
        List<DataHarmPhasicVPO> result = new ArrayList<>();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder1.append("min(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_HARM_PHASIC_V+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataHarmPhasicVPO> list1 = resultMapper1.toPOJO(sqlResult1, DataHarmPhasicVPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder3.append("max(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_HARM_PHASIC_V+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataHarmPhasicVPO> list2 = resultMapper2.toPOJO(sqlResult2, DataHarmPhasicVPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder5.append("mean(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_HARM_PHASIC_V+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataHarmPhasicVPO> list3 = resultMapper3.toPOJO(sqlResult3, DataHarmPhasicVPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(v_").append(i).append(",95) AS v_").append(i);
            } else {
                stringBuilder7.append("percentile(v_").append(i).append(",95) AS v_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_HARM_PHASIC_V+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataHarmPhasicVPO> list4 = resultMapper4.toPOJO(sqlResult4, DataHarmPhasicVPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }


    /**
     * 功能描述:获取data_harmpower_p数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataHarmPowerPPO>
     */
    public List<DataHarmPowerPPO> getDataHarmPowerP(String lineIndex, String startTime, String endTime){
        List<DataHarmPowerPPO> result = new ArrayList<>();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        stringBuilder1.append("min(p) AS p,min(df) AS df,min(pf) AS pf,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(p_").append(i).append(") AS p_").append(i);
            } else {
                stringBuilder1.append("min(p_").append(i).append(") AS p_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_P+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataHarmPowerPPO> list1 = resultMapper1.toPOJO(sqlResult1, DataHarmPowerPPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        stringBuilder3.append("max(p) AS p,max(df) AS df,max(pf) AS pf,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(p_").append(i).append(") AS p_").append(i);
            } else {
                stringBuilder3.append("max(p_").append(i).append(") AS p_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_P+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataHarmPowerPPO> list2 = resultMapper2.toPOJO(sqlResult2, DataHarmPowerPPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        stringBuilder5.append("mean(p) AS p,mean(df) AS df,mean(pf) AS pf,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(p_").append(i).append(") AS p_").append(i);
            } else {
                stringBuilder5.append("mean(p_").append(i).append(") AS p_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_P+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataHarmPowerPPO> list3 = resultMapper3.toPOJO(sqlResult3, DataHarmPowerPPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        stringBuilder7.append("percentile(p,95) AS p,percentile(df,95) AS df,percentile(pf,95) AS pf,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(p_").append(i).append(",95) AS p_").append(i);
            } else {
                stringBuilder7.append("percentile(p_").append(i).append(",95) AS p_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_P+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataHarmPowerPPO> list4 = resultMapper4.toPOJO(sqlResult4, DataHarmPowerPPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }

    /**
     * 功能描述:获取data_harmpower_q数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataHarmPowerQPO>
     */
    public List<DataHarmPowerQPO> getDataHarmPowerQ(String lineIndex, String startTime, String endTime){
        List<DataHarmPowerQPO> result = new ArrayList<>();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        stringBuilder1.append("min(q) AS q,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(q_").append(i).append(") AS q_").append(i);
            } else {
                stringBuilder1.append("min(q_").append(i).append(") AS q_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_Q+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataHarmPowerQPO> list1 = resultMapper1.toPOJO(sqlResult1, DataHarmPowerQPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        stringBuilder3.append("max(q) AS q,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(q_").append(i).append(") AS q_").append(i);
            } else {
                stringBuilder3.append("max(q_").append(i).append(") AS q_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_Q+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataHarmPowerQPO> list2 = resultMapper2.toPOJO(sqlResult2, DataHarmPowerQPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        stringBuilder5.append("mean(q) AS q,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(q_").append(i).append(") AS q_").append(i);
            } else {
                stringBuilder5.append("mean(q_").append(i).append(") AS q_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_Q+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataHarmPowerQPO> list3 = resultMapper3.toPOJO(sqlResult3, DataHarmPowerQPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        stringBuilder7.append("percentile(q,95) AS q,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(q_").append(i).append(",95) AS q_").append(i);
            } else {
                stringBuilder7.append("percentile(q_").append(i).append(",95) AS q_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_Q+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataHarmPowerQPO> list4 = resultMapper4.toPOJO(sqlResult4, DataHarmPowerQPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }

    /**
     * 功能描述:获取data_harmpower_s数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataHarmPowerSPO>
     */
    public List<DataHarmPowerSPO> getDataHarmPowerS(String lineIndex, String startTime, String endTime){
        List<DataHarmPowerSPO> result = new ArrayList<>();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        stringBuilder1.append("min(s) AS s,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(s_").append(i).append(") AS s_").append(i);
            } else {
                stringBuilder1.append("min(s_").append(i).append(") AS s_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_S+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataHarmPowerSPO> list1 = resultMapper1.toPOJO(sqlResult1, DataHarmPowerSPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        stringBuilder3.append("max(s) AS s,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(s_").append(i).append(") AS s_").append(i);
            } else {
                stringBuilder3.append("max(s_").append(i).append(") AS s_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_S+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataHarmPowerSPO> list2 = resultMapper2.toPOJO(sqlResult2, DataHarmPowerSPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        stringBuilder5.append("mean(s) AS s,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(s_").append(i).append(") AS s_").append(i);
            } else {
                stringBuilder5.append("mean(s_").append(i).append(") AS s_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_S+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataHarmPowerSPO> list3 = resultMapper3.toPOJO(sqlResult3, DataHarmPowerSPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        stringBuilder7.append("percentile(s,95) AS s,");
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(s_").append(i).append(",95) AS s_").append(i);
            } else {
                stringBuilder7.append("percentile(s_").append(i).append(",95) AS s_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_HARM_POWER_S+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataHarmPowerSPO> list4 = resultMapper4.toPOJO(sqlResult4, DataHarmPowerSPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }


    /**
     * 功能描述:获取data_harmrate_i数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataHarmRateIPO>
     */
    public List<DataHarmRateIPO> getDataHarmRateI(String lineIndex, String startTime, String endTime){
        List<DataHarmRateIPO> result = new ArrayList<>();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder1.append("min(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_HARM_RATE_I+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataHarmRateIPO> list1 = resultMapper1.toPOJO(sqlResult1, DataHarmRateIPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder3.append("max(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_HARM_RATE_I+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataHarmRateIPO> list2 = resultMapper2.toPOJO(sqlResult2, DataHarmRateIPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder5.append("mean(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_HARM_RATE_I+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataHarmRateIPO> list3 = resultMapper3.toPOJO(sqlResult3, DataHarmRateIPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(i_").append(i).append(",95) AS i_").append(i);
            } else {
                stringBuilder7.append("percentile(i_").append(i).append(",95) AS i_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_HARM_RATE_I+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataHarmRateIPO> list4 = resultMapper4.toPOJO(sqlResult4, DataHarmRateIPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }

    /**
     * 功能描述:获取data_harmrate_v数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataHarmRateVPO>
     */
    public List<DataHarmRateVPO> getDataHarmRateV(String lineIndex, String startTime, String endTime){
        List<DataHarmRateVPO> result = new ArrayList<>();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder1.append("min(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_HARM_RATE_V+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataHarmRateVPO> list1 = resultMapper1.toPOJO(sqlResult1, DataHarmRateVPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder3.append("max(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_HARM_RATE_V+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataHarmRateVPO> list2 = resultMapper2.toPOJO(sqlResult2, DataHarmRateVPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder5.append("mean(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_HARM_RATE_V+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataHarmRateVPO> list3 = resultMapper3.toPOJO(sqlResult3, DataHarmRateVPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(v_").append(i).append(",95) AS v_").append(i);
            } else {
                stringBuilder7.append("percentile(v_").append(i).append(",95) AS v_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_HARM_RATE_V+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataHarmRateVPO> list4 = resultMapper4.toPOJO(sqlResult4, DataHarmRateVPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }

    /**
     * 功能描述:获取data_inharm_i数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataInHarmIPO>
     */
    public List<DataInHarmIPO> getDataInHarmI(String lineIndex, String startTime, String endTime){
        List<DataInHarmIPO> result = new ArrayList<>();


        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder1.append("min(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_IN_HARM_I+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataInHarmIPO> list1 = resultMapper1.toPOJO(sqlResult1, DataInHarmIPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder3.append("max(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_IN_HARM_I+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataInHarmIPO> list2 = resultMapper2.toPOJO(sqlResult2, DataInHarmIPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder5.append("mean(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_IN_HARM_I+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataInHarmIPO> list3 = resultMapper3.toPOJO(sqlResult3, DataInHarmIPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(i_").append(i).append(",95) AS i_").append(i);
            } else {
                stringBuilder7.append("percentile(i_").append(i).append(",95) AS i_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_IN_HARM_I+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataInHarmIPO> list4 = resultMapper4.toPOJO(sqlResult4, DataInHarmIPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }


    /**
     * 功能描述:获取data_inharm_v数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataInHarmVPO>
     */
    public List<DataInHarmVPO> getDataInHarmV(String lineIndex, String startTime, String endTime){
        List<DataInHarmVPO> result = new ArrayList<>();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder1.append("min(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_IN_HARM_V+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataInHarmVPO> list1 = resultMapper1.toPOJO(sqlResult1, DataInHarmVPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder3.append("max(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_IN_HARM_V+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataInHarmVPO> list2 = resultMapper2.toPOJO(sqlResult2, DataInHarmVPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder5.append("mean(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_IN_HARM_V+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataInHarmVPO> list3 = resultMapper3.toPOJO(sqlResult3, DataInHarmVPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(v_").append(i).append(",95) AS v_").append(i);
            } else {
                stringBuilder7.append("percentile(v_").append(i).append(",95) AS v_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_IN_HARM_V+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataInHarmVPO> list4 = resultMapper4.toPOJO(sqlResult4, DataInHarmVPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }

    /**
     * 功能描述:获取data_inharmrate_i数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataInHarmRateIPO>
     */
    public List<DataInHarmRateIPO> getDataInHarmRateI(String lineIndex, String startTime, String endTime){
        List<DataInHarmRateIPO> result = new ArrayList<>();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder1.append("min(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_IN_HARM_I+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataInHarmRateIPO> list1 = resultMapper1.toPOJO(sqlResult1, DataInHarmRateIPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder3.append("max(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_IN_HARM_I+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataInHarmRateIPO> list2 = resultMapper2.toPOJO(sqlResult2, DataInHarmRateIPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(i_").append(i).append(") AS i_").append(i);
            } else {
                stringBuilder5.append("mean(i_").append(i).append(") AS i_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_IN_HARM_I+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataInHarmRateIPO> list3 = resultMapper3.toPOJO(sqlResult3, DataInHarmRateIPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(i_").append(i).append(",95) AS i_").append(i);
            } else {
                stringBuilder7.append("percentile(i_").append(i).append(",95) AS i_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_IN_HARM_I+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataInHarmRateIPO> list4 = resultMapper4.toPOJO(sqlResult4, DataInHarmRateIPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }

    /**
     * 功能描述:获取data_inharmrate_v数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataInHarmRateVPO>
     */
    public List<DataInHarmRateVPO> getDataInHarmRateV(String lineIndex, String startTime, String endTime){
        List<DataInHarmRateVPO> result = new ArrayList<>();

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder1.append("min(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder1.append("min(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder2.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MIN' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql1 = "select "+stringBuilder1+" from "+ InfluxDBPublicParam.DATA_IN_HARM_V+" where "+stringBuilder+stringBuilder2;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataInHarmRateVPO> list1 = resultMapper1.toPOJO(sqlResult1, DataInHarmRateVPO.class);
        //最大值
        StringBuilder stringBuilder3 = new StringBuilder();
        StringBuilder stringBuilder4 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder3.append("max(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder3.append("max(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder4.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'MAX' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql2 = "select "+stringBuilder3+" from "+ InfluxDBPublicParam.DATA_IN_HARM_V+" where "+stringBuilder+stringBuilder4;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataInHarmRateVPO> list2 = resultMapper2.toPOJO(sqlResult2, DataInHarmRateVPO.class);
        //平均值
        StringBuilder stringBuilder5 = new StringBuilder();
        StringBuilder stringBuilder6 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder5.append("mean(v_").append(i).append(") AS v_").append(i);
            } else {
                stringBuilder5.append("mean(v_").append(i).append(") AS v_").append(i).append(",");
            }
        }
        stringBuilder6.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql3 = "select "+stringBuilder5+" from "+ InfluxDBPublicParam.DATA_IN_HARM_V+" where "+stringBuilder+stringBuilder6;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3 = new InfluxDBResultMapper();
        List<DataInHarmRateVPO> list3 = resultMapper3.toPOJO(sqlResult3, DataInHarmRateVPO.class);
        //CP95值
        StringBuilder stringBuilder7 = new StringBuilder();
        StringBuilder stringBuilder8 = new StringBuilder();
        for (int i = 1; i <=50 ; i++) {
            if (i==50){
                stringBuilder7.append("percentile(v_").append(i).append(",95) AS v_").append(i);
            } else {
                stringBuilder7.append("percentile(v_").append(i).append(",95) AS v_").append(i).append(",");
            }
        }
        stringBuilder8.append(InfluxDBPublicParam.TIME + " >= '").append(startTime).append("' and ").append(InfluxDBPublicParam.TIME).append(" <= '").append(endTime).append("' and value_type = 'AVG' group by line_id,phasic_type,value_type,quality_flag ").append(InfluxDBPublicParam.TIME_ZONE);
        String sql4 = "select "+stringBuilder7+" from "+ InfluxDBPublicParam.DATA_IN_HARM_V+" where "+stringBuilder+stringBuilder8;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4 = new InfluxDBResultMapper();
        List<DataInHarmRateVPO> list4 = resultMapper4.toPOJO(sqlResult4, DataInHarmRateVPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }

    /**
     * 功能描述:获取data_plt数据
     * @author xy
     * @param startTime   起始时间
     * @param endTime     结束时间
     * @date 2022/5/10 14:56
     * @return List<DataPltPO>
     */
    public List<DataPltPO> getDataPlt(String lineIndex, String startTime, String endTime){
        List<DataPltPO> result = new ArrayList<>();
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append ("line_id='").append (lineIndex).append ("' and ");
        //最小值
        String sql1 = "select min(plt) AS plt from "+ InfluxDBPublicParam.DATA_PLT+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult1 = influxDbUtils.query(sql1);
        InfluxDBResultMapper resultMapper1 = new InfluxDBResultMapper();
        List<DataPltPO> list1 = resultMapper1.toPOJO(sqlResult1, DataPltPO.class);
        list1.forEach(item->{
            item.setValueType("MIN");
        });
        //最大值
        String sql2 = "select max(plt) AS plt from "+ InfluxDBPublicParam.DATA_PLT+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult2 = influxDbUtils.query(sql2);
        InfluxDBResultMapper resultMapper2 = new InfluxDBResultMapper();
        List<DataPltPO> list2 = resultMapper2.toPOJO(sqlResult2, DataPltPO.class);
        list2.forEach(item->{
            item.setValueType("MAX");
        });
        //平均值
        String sql3 = "select mean(plt) AS plt from "+ InfluxDBPublicParam.DATA_PLT+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult3 = influxDbUtils.query(sql3);
        InfluxDBResultMapper resultMapper3= new InfluxDBResultMapper();
        List<DataPltPO> list3 = resultMapper3.toPOJO(sqlResult3, DataPltPO.class);
        list3.forEach(item->{
            item.setValueType("AVG");
        });
        //CP95值
        String sql4 = "select percentile(plt,95) AS plt from "+ InfluxDBPublicParam.DATA_PLT+" where "+stringBuilder+" time >= '" + startTime + "' and time <= '" + endTime + "' group by line_id,phasic_type,quality_flag "+ InfluxDBPublicParam.TIME_ZONE;
        QueryResult sqlResult4 = influxDbUtils.query(sql4);
        InfluxDBResultMapper resultMapper4= new InfluxDBResultMapper();
        List<DataPltPO> list4 = resultMapper4.toPOJO(sqlResult4, DataPltPO.class);
        list4.forEach(item->{
            item.setValueType("CP95");
        });
        result.addAll(list1);
        result.addAll(list2);
        result.addAll(list3);
        result.addAll(list4);
        return result;
    }

    /**
     * 功能描述:插入dayV表数据
     * @author xy
     * @param list dataV集合
     * @param time 时间戳
     * @date 2022/5/11 14:55
     */
    private void insertDayV(List<DataVPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap ();
            Map<String, Object> fields = new HashMap();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("freq",item.getFreq());
            fields.put("freq_dev",item.getFreqDev());
            fields.put("rms",item.getRms());
            fields.put("rms_lvr",item.getRmsLvr());
            fields.put("v_neg",item.getVNeg());
            fields.put("v_pos",item.getVPos());
            fields.put("v_thd",item.getVThd());
            fields.put("v_unbalance",item.getVUnbalance());
            fields.put("v_zero",item.getVZero());
            fields.put("vl_dev",item.getVlDev());
            fields.put("vu_dev",item.getVuDev());
            fields.put("v_1",item.getV1());
            fields.put("v_2",item.getV2());
            fields.put("v_3",item.getV3());
            fields.put("v_4",item.getV4());
            fields.put("v_5",item.getV5());
            fields.put("v_6",item.getV6());
            fields.put("v_7",item.getV7());
            fields.put("v_8",item.getV8());
            fields.put("v_9",item.getV9());
            fields.put("v_10",item.getV10());
            fields.put("v_11",item.getV11());
            fields.put("v_12",item.getV12());
            fields.put("v_13",item.getV13());
            fields.put("v_14",item.getV14());
            fields.put("v_15",item.getV15());
            fields.put("v_16",item.getV16());
            fields.put("v_17",item.getV17());
            fields.put("v_18",item.getV18());
            fields.put("v_19",item.getV19());
            fields.put("v_20",item.getV20());
            fields.put("v_21",item.getV21());
            fields.put("v_22",item.getV22());
            fields.put("v_23",item.getV23());
            fields.put("v_24",item.getV24());
            fields.put("v_25",item.getV25());
            fields.put("v_26",item.getV26());
            fields.put("v_27",item.getV27());
            fields.put("v_28",item.getV28());
            fields.put("v_29",item.getV29());
            fields.put("v_30",item.getV30());
            fields.put("v_31",item.getV31());
            fields.put("v_32",item.getV32());
            fields.put("v_33",item.getV33());
            fields.put("v_34",item.getV34());
            fields.put("v_35",item.getV35());
            fields.put("v_36",item.getV36());
            fields.put("v_37",item.getV37());
            fields.put("v_38",item.getV38());
            fields.put("v_39",item.getV39());
            fields.put("v_40",item.getV40());
            fields.put("v_41",item.getV41());
            fields.put("v_42",item.getV42());
            fields.put("v_43",item.getV43());
            fields.put("v_44",item.getV44());
            fields.put("v_45",item.getV45());
            fields.put("v_46",item.getV46());
            fields.put("v_47",item.getV47());
            fields.put("v_48",item.getV48());
            fields.put("v_49",item.getV49());
            fields.put("v_50",item.getV50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_V, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }
    /**
     * 功能描述:插入dayI表数据
     * @author xy
     * @param list dataI集合
     * @param time 时间戳
     * @date 2022/5/11 14:55
     */
    private void insertDayI(List<DataIPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("rms",item.getRms());
            fields.put("i_neg",item.getINeg());
            fields.put("i_pos",item.getIPos());
            fields.put("i_thd",item.getIThd());
            fields.put("i_unbalance",item.getIUnbalance());
            fields.put("i_zero",item.getIZero());
            fields.put("i_1",item.getI1());
            fields.put("i_2",item.getI2());
            fields.put("i_3",item.getI3());
            fields.put("i_4",item.getI4());
            fields.put("i_5",item.getI5());
            fields.put("i_6",item.getI6());
            fields.put("i_7",item.getI7());
            fields.put("i_8",item.getI8());
            fields.put("i_9",item.getI9());
            fields.put("i_10",item.getI10());
            fields.put("i_11",item.getI11());
            fields.put("i_12",item.getI12());
            fields.put("i_13",item.getI13());
            fields.put("i_14",item.getI14());
            fields.put("i_15",item.getI15());
            fields.put("i_16",item.getI16());
            fields.put("i_17",item.getI17());
            fields.put("i_18",item.getI18());
            fields.put("i_19",item.getI19());
            fields.put("i_20",item.getI20());
            fields.put("i_21",item.getI21());
            fields.put("i_22",item.getI22());
            fields.put("i_23",item.getI23());
            fields.put("i_24",item.getI24());
            fields.put("i_25",item.getI25());
            fields.put("i_26",item.getI26());
            fields.put("i_27",item.getI27());
            fields.put("i_28",item.getI28());
            fields.put("i_29",item.getI29());
            fields.put("i_30",item.getI30());
            fields.put("i_31",item.getI31());
            fields.put("i_32",item.getI32());
            fields.put("i_33",item.getI33());
            fields.put("i_34",item.getI34());
            fields.put("i_35",item.getI35());
            fields.put("i_36",item.getI36());
            fields.put("i_37",item.getI37());
            fields.put("i_38",item.getI38());
            fields.put("i_39",item.getI39());
            fields.put("i_40",item.getI40());
            fields.put("i_41",item.getI41());
            fields.put("i_42",item.getI42());
            fields.put("i_43",item.getI43());
            fields.put("i_44",item.getI44());
            fields.put("i_45",item.getI45());
            fields.put("i_46",item.getI46());
            fields.put("i_47",item.getI47());
            fields.put("i_48",item.getI48());
            fields.put("i_49",item.getI49());
            fields.put("i_50",item.getI50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_I, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入dayFlicker表数据
     * @author xy
     * @param list dataFlicker集合
     * @param time 时间戳
     * @date 2022/5/11 14:55
     */
    private void insertDayFlicker(List<DataFlickerPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("fluc",item.getFluc());
            fields.put("plt",item.getPlt());
            fields.put("pst",item.getPst());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_FLICKER, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }


    /**
     * 功能描述:插入dayFluc表数据
     * @author xy
     * @param list dataFluc集合
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayFluc(List<DataFlucPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("fluc",item.getFluc());
            fields.put("fluccf",item.getFluccf());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_FLUC, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入day_harmphasic_i表数据
     * @author xy
     * @param list data_harmphasic_i表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayHarmphasicI(List<DataHarmPhasicIPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("i_1",item.getI1());
            fields.put("i_2",item.getI2());
            fields.put("i_3",item.getI3());
            fields.put("i_4",item.getI4());
            fields.put("i_5",item.getI5());
            fields.put("i_6",item.getI6());
            fields.put("i_7",item.getI7());
            fields.put("i_8",item.getI8());
            fields.put("i_9",item.getI9());
            fields.put("i_10",item.getI10());
            fields.put("i_11",item.getI11());
            fields.put("i_12",item.getI12());
            fields.put("i_13",item.getI13());
            fields.put("i_14",item.getI14());
            fields.put("i_15",item.getI15());
            fields.put("i_16",item.getI16());
            fields.put("i_17",item.getI17());
            fields.put("i_18",item.getI18());
            fields.put("i_19",item.getI19());
            fields.put("i_20",item.getI20());
            fields.put("i_21",item.getI21());
            fields.put("i_22",item.getI22());
            fields.put("i_23",item.getI23());
            fields.put("i_24",item.getI24());
            fields.put("i_25",item.getI25());
            fields.put("i_26",item.getI26());
            fields.put("i_27",item.getI27());
            fields.put("i_28",item.getI28());
            fields.put("i_29",item.getI29());
            fields.put("i_30",item.getI30());
            fields.put("i_31",item.getI31());
            fields.put("i_32",item.getI32());
            fields.put("i_33",item.getI33());
            fields.put("i_34",item.getI34());
            fields.put("i_35",item.getI35());
            fields.put("i_36",item.getI36());
            fields.put("i_37",item.getI37());
            fields.put("i_38",item.getI38());
            fields.put("i_39",item.getI39());
            fields.put("i_40",item.getI40());
            fields.put("i_41",item.getI41());
            fields.put("i_42",item.getI42());
            fields.put("i_43",item.getI43());
            fields.put("i_44",item.getI44());
            fields.put("i_45",item.getI45());
            fields.put("i_46",item.getI46());
            fields.put("i_47",item.getI47());
            fields.put("i_48",item.getI48());
            fields.put("i_49",item.getI49());
            fields.put("i_50",item.getI50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_HARM_PHASIC_I, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入day_harmphasic_V表数据
     * @author xy
     * @param list data_harmphasic_V表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayHarmphasicV(List<DataHarmPhasicVPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("v_1",item.getV1());
            fields.put("v_2",item.getV2());
            fields.put("v_3",item.getV3());
            fields.put("v_4",item.getV4());
            fields.put("v_5",item.getV5());
            fields.put("v_6",item.getV6());
            fields.put("v_7",item.getV7());
            fields.put("v_8",item.getV8());
            fields.put("v_9",item.getV9());
            fields.put("v_10",item.getV10());
            fields.put("v_11",item.getV11());
            fields.put("v_12",item.getV12());
            fields.put("v_13",item.getV13());
            fields.put("v_14",item.getV14());
            fields.put("v_15",item.getV15());
            fields.put("v_16",item.getV16());
            fields.put("v_17",item.getV17());
            fields.put("v_18",item.getV18());
            fields.put("v_19",item.getV19());
            fields.put("v_20",item.getV20());
            fields.put("v_21",item.getV21());
            fields.put("v_22",item.getV22());
            fields.put("v_23",item.getV23());
            fields.put("v_24",item.getV24());
            fields.put("v_25",item.getV25());
            fields.put("v_26",item.getV26());
            fields.put("v_27",item.getV27());
            fields.put("v_28",item.getV28());
            fields.put("v_29",item.getV29());
            fields.put("v_30",item.getV30());
            fields.put("v_31",item.getV31());
            fields.put("v_32",item.getV32());
            fields.put("v_33",item.getV33());
            fields.put("v_34",item.getV34());
            fields.put("v_35",item.getV35());
            fields.put("v_36",item.getV36());
            fields.put("v_37",item.getV37());
            fields.put("v_38",item.getV38());
            fields.put("v_39",item.getV39());
            fields.put("v_40",item.getV40());
            fields.put("v_41",item.getV41());
            fields.put("v_42",item.getV42());
            fields.put("v_43",item.getV43());
            fields.put("v_44",item.getV44());
            fields.put("v_45",item.getV45());
            fields.put("v_46",item.getV46());
            fields.put("v_47",item.getV47());
            fields.put("v_48",item.getV48());
            fields.put("v_49",item.getV49());
            fields.put("v_50",item.getV50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_HARM_PHASIC_V, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }


    /**
     * 功能描述:插入day_harmpower_p表数据
     * @author xy
     * @param list data_harmpower_p表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayHarmPowerP(List<DataHarmPowerPPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("df",item.getDf());
            fields.put("pf",item.getPf());
            fields.put("p",item.getP());
            fields.put("p_1",item.getP1());
            fields.put("p_2",item.getP2());
            fields.put("p_3",item.getP3());
            fields.put("p_4",item.getP4());
            fields.put("p_5",item.getP5());
            fields.put("p_6",item.getP6());
            fields.put("p_7",item.getP7());
            fields.put("p_8",item.getP8());
            fields.put("p_9",item.getP9());
            fields.put("p_10",item.getP10());
            fields.put("p_11",item.getP11());
            fields.put("p_12",item.getP12());
            fields.put("p_13",item.getP13());
            fields.put("p_14",item.getP14());
            fields.put("p_15",item.getP15());
            fields.put("p_16",item.getP16());
            fields.put("p_17",item.getP17());
            fields.put("p_18",item.getP18());
            fields.put("p_19",item.getP19());
            fields.put("p_20",item.getP20());
            fields.put("p_21",item.getP21());
            fields.put("p_22",item.getP22());
            fields.put("p_23",item.getP23());
            fields.put("p_24",item.getP24());
            fields.put("p_25",item.getP25());
            fields.put("p_26",item.getP26());
            fields.put("p_27",item.getP27());
            fields.put("p_28",item.getP28());
            fields.put("p_29",item.getP29());
            fields.put("p_30",item.getP30());
            fields.put("p_31",item.getP31());
            fields.put("p_32",item.getP32());
            fields.put("p_33",item.getP33());
            fields.put("p_34",item.getP34());
            fields.put("p_35",item.getP35());
            fields.put("p_36",item.getP36());
            fields.put("p_37",item.getP37());
            fields.put("p_38",item.getP38());
            fields.put("p_39",item.getP39());
            fields.put("p_40",item.getP40());
            fields.put("p_41",item.getP41());
            fields.put("p_42",item.getP42());
            fields.put("p_43",item.getP43());
            fields.put("p_44",item.getP44());
            fields.put("p_45",item.getP45());
            fields.put("p_46",item.getP46());
            fields.put("p_47",item.getP47());
            fields.put("p_48",item.getP48());
            fields.put("p_49",item.getP49());
            fields.put("p_50",item.getP50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_HARM_POWER_P, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入day_harmpower_q表数据
     * @author xy
     * @param list data_harmpower_q表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayHarmPowerQ(List<DataHarmPowerQPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("q",item.getQ());
            fields.put("q_1",item.getQ1());
            fields.put("q_2",item.getQ2());
            fields.put("q_3",item.getQ3());
            fields.put("q_4",item.getQ4());
            fields.put("q_5",item.getQ5());
            fields.put("q_6",item.getQ6());
            fields.put("q_7",item.getQ7());
            fields.put("q_8",item.getQ8());
            fields.put("q_9",item.getQ9());
            fields.put("q_10",item.getQ10());
            fields.put("q_11",item.getQ11());
            fields.put("q_12",item.getQ12());
            fields.put("q_13",item.getQ13());
            fields.put("q_14",item.getQ14());
            fields.put("q_15",item.getQ15());
            fields.put("q_16",item.getQ16());
            fields.put("q_17",item.getQ17());
            fields.put("q_18",item.getQ18());
            fields.put("q_19",item.getQ19());
            fields.put("q_20",item.getQ20());
            fields.put("q_21",item.getQ21());
            fields.put("q_22",item.getQ22());
            fields.put("q_23",item.getQ23());
            fields.put("q_24",item.getQ24());
            fields.put("q_25",item.getQ25());
            fields.put("q_26",item.getQ26());
            fields.put("q_27",item.getQ27());
            fields.put("q_28",item.getQ28());
            fields.put("q_29",item.getQ29());
            fields.put("q_30",item.getQ30());
            fields.put("q_31",item.getQ31());
            fields.put("q_32",item.getQ32());
            fields.put("q_33",item.getQ33());
            fields.put("q_34",item.getQ34());
            fields.put("q_35",item.getQ35());
            fields.put("q_36",item.getQ36());
            fields.put("q_37",item.getQ37());
            fields.put("q_38",item.getQ38());
            fields.put("q_39",item.getQ39());
            fields.put("q_40",item.getQ40());
            fields.put("q_41",item.getQ41());
            fields.put("q_42",item.getQ42());
            fields.put("q_43",item.getQ43());
            fields.put("q_44",item.getQ44());
            fields.put("q_45",item.getQ45());
            fields.put("q_46",item.getQ46());
            fields.put("q_47",item.getQ47());
            fields.put("q_48",item.getQ48());
            fields.put("q_49",item.getQ49());
            fields.put("q_50",item.getQ50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_HARM_POWER_Q, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入day_harmpower_q表数据
     * @author xy
     * @param list data_harmpower_q表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayHarmPowerS(List<DataHarmPowerSPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("s",item.getS());
            fields.put("s_1",item.getS1());
            fields.put("s_2",item.getS2());
            fields.put("s_3",item.getS3());
            fields.put("s_4",item.getS4());
            fields.put("s_5",item.getS5());
            fields.put("s_6",item.getS6());
            fields.put("s_7",item.getS7());
            fields.put("s_8",item.getS8());
            fields.put("s_9",item.getS9());
            fields.put("s_10",item.getS10());
            fields.put("s_11",item.getS11());
            fields.put("s_12",item.getS12());
            fields.put("s_13",item.getS13());
            fields.put("s_14",item.getS14());
            fields.put("s_15",item.getS15());
            fields.put("s_16",item.getS16());
            fields.put("s_17",item.getS17());
            fields.put("s_18",item.getS18());
            fields.put("s_19",item.getS19());
            fields.put("s_20",item.getS20());
            fields.put("s_21",item.getS21());
            fields.put("s_22",item.getS22());
            fields.put("s_23",item.getS23());
            fields.put("s_24",item.getS24());
            fields.put("s_25",item.getS25());
            fields.put("s_26",item.getS26());
            fields.put("s_27",item.getS27());
            fields.put("s_28",item.getS28());
            fields.put("s_29",item.getS29());
            fields.put("s_30",item.getS30());
            fields.put("s_31",item.getS31());
            fields.put("s_32",item.getS32());
            fields.put("s_33",item.getS33());
            fields.put("s_34",item.getS34());
            fields.put("s_35",item.getS35());
            fields.put("s_36",item.getS36());
            fields.put("s_37",item.getS37());
            fields.put("s_38",item.getS38());
            fields.put("s_39",item.getS39());
            fields.put("s_40",item.getS40());
            fields.put("s_41",item.getS41());
            fields.put("s_42",item.getS42());
            fields.put("s_43",item.getS43());
            fields.put("s_44",item.getS44());
            fields.put("s_45",item.getS45());
            fields.put("s_46",item.getS46());
            fields.put("s_47",item.getS47());
            fields.put("s_48",item.getS48());
            fields.put("s_49",item.getS49());
            fields.put("s_50",item.getS50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_HARM_POWER_S, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入day_harmrate_i表数据
     * @author xy
     * @param list data_harmrate_i表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayHarmRateI(List<DataHarmRateIPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("i_1",item.getI1());
            fields.put("i_2",item.getI2());
            fields.put("i_3",item.getI3());
            fields.put("i_4",item.getI4());
            fields.put("i_5",item.getI5());
            fields.put("i_6",item.getI6());
            fields.put("i_7",item.getI7());
            fields.put("i_8",item.getI8());
            fields.put("i_9",item.getI9());
            fields.put("i_10",item.getI10());
            fields.put("i_11",item.getI11());
            fields.put("i_12",item.getI12());
            fields.put("i_13",item.getI13());
            fields.put("i_14",item.getI14());
            fields.put("i_15",item.getI15());
            fields.put("i_16",item.getI16());
            fields.put("i_17",item.getI17());
            fields.put("i_18",item.getI18());
            fields.put("i_19",item.getI19());
            fields.put("i_20",item.getI20());
            fields.put("i_21",item.getI21());
            fields.put("i_22",item.getI22());
            fields.put("i_23",item.getI23());
            fields.put("i_24",item.getI24());
            fields.put("i_25",item.getI25());
            fields.put("i_26",item.getI26());
            fields.put("i_27",item.getI27());
            fields.put("i_28",item.getI28());
            fields.put("i_29",item.getI29());
            fields.put("i_30",item.getI30());
            fields.put("i_31",item.getI31());
            fields.put("i_32",item.getI32());
            fields.put("i_33",item.getI33());
            fields.put("i_34",item.getI34());
            fields.put("i_35",item.getI35());
            fields.put("i_36",item.getI36());
            fields.put("i_37",item.getI37());
            fields.put("i_38",item.getI38());
            fields.put("i_39",item.getI39());
            fields.put("i_40",item.getI40());
            fields.put("i_41",item.getI41());
            fields.put("i_42",item.getI42());
            fields.put("i_43",item.getI43());
            fields.put("i_44",item.getI44());
            fields.put("i_45",item.getI45());
            fields.put("i_46",item.getI46());
            fields.put("i_47",item.getI47());
            fields.put("i_48",item.getI48());
            fields.put("i_49",item.getI49());
            fields.put("i_50",item.getI50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_HARM_RATE_I, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag (InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入day_harmrate_v表数据
     * @author xy
     * @param list data_harmrate_v表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayHarmRateV(List<DataHarmRateVPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("v_1",item.getV1());
            fields.put("v_2",item.getV2());
            fields.put("v_3",item.getV3());
            fields.put("v_4",item.getV4());
            fields.put("v_5",item.getV5());
            fields.put("v_6",item.getV6());
            fields.put("v_7",item.getV7());
            fields.put("v_8",item.getV8());
            fields.put("v_9",item.getV9());
            fields.put("v_10",item.getV10());
            fields.put("v_11",item.getV11());
            fields.put("v_12",item.getV12());
            fields.put("v_13",item.getV13());
            fields.put("v_14",item.getV14());
            fields.put("v_15",item.getV15());
            fields.put("v_16",item.getV16());
            fields.put("v_17",item.getV17());
            fields.put("v_18",item.getV18());
            fields.put("v_19",item.getV19());
            fields.put("v_20",item.getV20());
            fields.put("v_21",item.getV21());
            fields.put("v_22",item.getV22());
            fields.put("v_23",item.getV23());
            fields.put("v_24",item.getV24());
            fields.put("v_25",item.getV25());
            fields.put("v_26",item.getV26());
            fields.put("v_27",item.getV27());
            fields.put("v_28",item.getV28());
            fields.put("v_29",item.getV29());
            fields.put("v_30",item.getV30());
            fields.put("v_31",item.getV31());
            fields.put("v_32",item.getV32());
            fields.put("v_33",item.getV33());
            fields.put("v_34",item.getV34());
            fields.put("v_35",item.getV35());
            fields.put("v_36",item.getV36());
            fields.put("v_37",item.getV37());
            fields.put("v_38",item.getV38());
            fields.put("v_39",item.getV39());
            fields.put("v_40",item.getV40());
            fields.put("v_41",item.getV41());
            fields.put("v_42",item.getV42());
            fields.put("v_43",item.getV43());
            fields.put("v_44",item.getV44());
            fields.put("v_45",item.getV45());
            fields.put("v_46",item.getV46());
            fields.put("v_47",item.getV47());
            fields.put("v_48",item.getV48());
            fields.put("v_49",item.getV49());
            fields.put("v_50",item.getV50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_HARM_RATE_V, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入day_inharm_i表数据
     * @author xy
     * @param list data_inharm_i表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayInHarmI(List<DataInHarmIPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("i_1",item.getI1());
            fields.put("i_2",item.getI2());
            fields.put("i_3",item.getI3());
            fields.put("i_4",item.getI4());
            fields.put("i_5",item.getI5());
            fields.put("i_6",item.getI6());
            fields.put("i_7",item.getI7());
            fields.put("i_8",item.getI8());
            fields.put("i_9",item.getI9());
            fields.put("i_10",item.getI10());
            fields.put("i_11",item.getI11());
            fields.put("i_12",item.getI12());
            fields.put("i_13",item.getI13());
            fields.put("i_14",item.getI14());
            fields.put("i_15",item.getI15());
            fields.put("i_16",item.getI16());
            fields.put("i_17",item.getI17());
            fields.put("i_18",item.getI18());
            fields.put("i_19",item.getI19());
            fields.put("i_20",item.getI20());
            fields.put("i_21",item.getI21());
            fields.put("i_22",item.getI22());
            fields.put("i_23",item.getI23());
            fields.put("i_24",item.getI24());
            fields.put("i_25",item.getI25());
            fields.put("i_26",item.getI26());
            fields.put("i_27",item.getI27());
            fields.put("i_28",item.getI28());
            fields.put("i_29",item.getI29());
            fields.put("i_30",item.getI30());
            fields.put("i_31",item.getI31());
            fields.put("i_32",item.getI32());
            fields.put("i_33",item.getI33());
            fields.put("i_34",item.getI34());
            fields.put("i_35",item.getI35());
            fields.put("i_36",item.getI36());
            fields.put("i_37",item.getI37());
            fields.put("i_38",item.getI38());
            fields.put("i_39",item.getI39());
            fields.put("i_40",item.getI40());
            fields.put("i_41",item.getI41());
            fields.put("i_42",item.getI42());
            fields.put("i_43",item.getI43());
            fields.put("i_44",item.getI44());
            fields.put("i_45",item.getI45());
            fields.put("i_46",item.getI46());
            fields.put("i_47",item.getI47());
            fields.put("i_48",item.getI48());
            fields.put("i_49",item.getI49());
            fields.put("i_50",item.getI50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_IN_HARM_I, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入day_inharm_v表数据
     * @author xy
     * @param list data_inharm_v表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayInHarmV(List<DataInHarmVPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("v_1",item.getV1());
            fields.put("v_2",item.getV2());
            fields.put("v_3",item.getV3());
            fields.put("v_4",item.getV4());
            fields.put("v_5",item.getV5());
            fields.put("v_6",item.getV6());
            fields.put("v_7",item.getV7());
            fields.put("v_8",item.getV8());
            fields.put("v_9",item.getV9());
            fields.put("v_10",item.getV10());
            fields.put("v_11",item.getV11());
            fields.put("v_12",item.getV12());
            fields.put("v_13",item.getV13());
            fields.put("v_14",item.getV14());
            fields.put("v_15",item.getV15());
            fields.put("v_16",item.getV16());
            fields.put("v_17",item.getV17());
            fields.put("v_18",item.getV18());
            fields.put("v_19",item.getV19());
            fields.put("v_20",item.getV20());
            fields.put("v_21",item.getV21());
            fields.put("v_22",item.getV22());
            fields.put("v_23",item.getV23());
            fields.put("v_24",item.getV24());
            fields.put("v_25",item.getV25());
            fields.put("v_26",item.getV26());
            fields.put("v_27",item.getV27());
            fields.put("v_28",item.getV28());
            fields.put("v_29",item.getV29());
            fields.put("v_30",item.getV30());
            fields.put("v_31",item.getV31());
            fields.put("v_32",item.getV32());
            fields.put("v_33",item.getV33());
            fields.put("v_34",item.getV34());
            fields.put("v_35",item.getV35());
            fields.put("v_36",item.getV36());
            fields.put("v_37",item.getV37());
            fields.put("v_38",item.getV38());
            fields.put("v_39",item.getV39());
            fields.put("v_40",item.getV40());
            fields.put("v_41",item.getV41());
            fields.put("v_42",item.getV42());
            fields.put("v_43",item.getV43());
            fields.put("v_44",item.getV44());
            fields.put("v_45",item.getV45());
            fields.put("v_46",item.getV46());
            fields.put("v_47",item.getV47());
            fields.put("v_48",item.getV48());
            fields.put("v_49",item.getV49());
            fields.put("v_50",item.getV50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_IN_HARM_V, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入day_inharmrate_i表数据
     * @author xy
     * @param list data_inharmrate_i表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayInHarmRateI(List<DataInHarmRateIPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("i_1",item.getI1());
            fields.put("i_2",item.getI2());
            fields.put("i_3",item.getI3());
            fields.put("i_4",item.getI4());
            fields.put("i_5",item.getI5());
            fields.put("i_6",item.getI6());
            fields.put("i_7",item.getI7());
            fields.put("i_8",item.getI8());
            fields.put("i_9",item.getI9());
            fields.put("i_10",item.getI10());
            fields.put("i_11",item.getI11());
            fields.put("i_12",item.getI12());
            fields.put("i_13",item.getI13());
            fields.put("i_14",item.getI14());
            fields.put("i_15",item.getI15());
            fields.put("i_16",item.getI16());
            fields.put("i_17",item.getI17());
            fields.put("i_18",item.getI18());
            fields.put("i_19",item.getI19());
            fields.put("i_20",item.getI20());
            fields.put("i_21",item.getI21());
            fields.put("i_22",item.getI22());
            fields.put("i_23",item.getI23());
            fields.put("i_24",item.getI24());
            fields.put("i_25",item.getI25());
            fields.put("i_26",item.getI26());
            fields.put("i_27",item.getI27());
            fields.put("i_28",item.getI28());
            fields.put("i_29",item.getI29());
            fields.put("i_30",item.getI30());
            fields.put("i_31",item.getI31());
            fields.put("i_32",item.getI32());
            fields.put("i_33",item.getI33());
            fields.put("i_34",item.getI34());
            fields.put("i_35",item.getI35());
            fields.put("i_36",item.getI36());
            fields.put("i_37",item.getI37());
            fields.put("i_38",item.getI38());
            fields.put("i_39",item.getI39());
            fields.put("i_40",item.getI40());
            fields.put("i_41",item.getI41());
            fields.put("i_42",item.getI42());
            fields.put("i_43",item.getI43());
            fields.put("i_44",item.getI44());
            fields.put("i_45",item.getI45());
            fields.put("i_46",item.getI46());
            fields.put("i_47",item.getI47());
            fields.put("i_48",item.getI48());
            fields.put("i_49",item.getI49());
            fields.put("i_50",item.getI50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_IN_HARM_I, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * 功能描述:插入day_inharmrate_v表数据
     * @author xy
     * @param list data_inharmrate_v表数据
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayInHarmRateV(List<DataInHarmRateVPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("v_1",item.getV1());
            fields.put("v_2",item.getV2());
            fields.put("v_3",item.getV3());
            fields.put("v_4",item.getV4());
            fields.put("v_5",item.getV5());
            fields.put("v_6",item.getV6());
            fields.put("v_7",item.getV7());
            fields.put("v_8",item.getV8());
            fields.put("v_9",item.getV9());
            fields.put("v_10",item.getV10());
            fields.put("v_11",item.getV11());
            fields.put("v_12",item.getV12());
            fields.put("v_13",item.getV13());
            fields.put("v_14",item.getV14());
            fields.put("v_15",item.getV15());
            fields.put("v_16",item.getV16());
            fields.put("v_17",item.getV17());
            fields.put("v_18",item.getV18());
            fields.put("v_19",item.getV19());
            fields.put("v_20",item.getV20());
            fields.put("v_21",item.getV21());
            fields.put("v_22",item.getV22());
            fields.put("v_23",item.getV23());
            fields.put("v_24",item.getV24());
            fields.put("v_25",item.getV25());
            fields.put("v_26",item.getV26());
            fields.put("v_27",item.getV27());
            fields.put("v_28",item.getV28());
            fields.put("v_29",item.getV29());
            fields.put("v_30",item.getV30());
            fields.put("v_31",item.getV31());
            fields.put("v_32",item.getV32());
            fields.put("v_33",item.getV33());
            fields.put("v_34",item.getV34());
            fields.put("v_35",item.getV35());
            fields.put("v_36",item.getV36());
            fields.put("v_37",item.getV37());
            fields.put("v_38",item.getV38());
            fields.put("v_39",item.getV39());
            fields.put("v_40",item.getV40());
            fields.put("v_41",item.getV41());
            fields.put("v_42",item.getV42());
            fields.put("v_43",item.getV43());
            fields.put("v_44",item.getV44());
            fields.put("v_45",item.getV45());
            fields.put("v_46",item.getV46());
            fields.put("v_47",item.getV47());
            fields.put("v_48",item.getV48());
            fields.put("v_49",item.getV49());
            fields.put("v_50",item.getV50());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DATA_IN_HARM_V, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }


    /**
     * 功能描述:插入day_plt表数据
     * @author xy
     * @param list data_plt集合
     * @param time 时间戳
     * @date 2022/5/12 8:55
     */
    private void insertDayPlt(List<DataPltPO> list, long time){
        List<String> records = new ArrayList<>();
        list.forEach(item->{
            Map<String, String> tags = new HashMap<>();
            Map<String, Object> fields = new HashMap<>();
            tags.put("line_id",item.getLineId());
            tags.put("phasic_type",item.getPhaseType());
            tags.put("quality_flag",item.getQualityFlag());
            tags.put("value_type",item.getValueType());
            fields.put("plt",item.getPlt());
            Point point = influxDbUtils.pointBuilder(InfluxDBPublicParam.DAY_PLT, time, TimeUnit.MILLISECONDS, tags, fields);
            BatchPoints batchPoints = BatchPoints.database(influxDbUtils.getDbName ()).tag(InfluxDBPublicParam.LINE_ID, item.getLineId()).tag(InfluxDBPublicParam.PHASIC_TYPE,item.getPhaseType()).tag(InfluxDBPublicParam.QUALITY_FLAG,item.getQualityFlag()).tag(InfluxDBPublicParam.VALUE_TYPE,item.getValueType()).retentionPolicy("").consistency(InfluxDB.ConsistencyLevel.ALL).build();
            batchPoints.point(point);
            records.add(batchPoints.lineProtocol());
        });
        influxDbUtils.batchInsert(influxDbUtils.getDbName (),"", InfluxDB.ConsistencyLevel.ALL, records);
    }

    /**
     * @Description: 组装 RMpHarmonicVRateReportDPO
     * @Param: [dataV, dataHarmRateVPO,PhaseType] dataV：16条datav数据
     * @return: com.njcn.prepare.harmonic.pojo.po.line.RMpHarmonicVRateReportDPO
     * @Author: clam
     * @Date: 2022/10/25
     */
    private RMpHarmonicVRateReportD  packageRMpHarmonicVRateReportDPO(List<DataVPO> dataV,List<DataHarmRateVPO> dataHarmRateVPOList,String PhaseType,Instant instant){

        RMpHarmonicVRateReportD result = null;

        List<DataVPO> a = dataV.stream ( ).
                filter (dataVPO -> Objects.equals (dataVPO.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        List<DataHarmRateVPO> b = dataHarmRateVPOList.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpHarmonicVRateReportD rMpHarmonicVRateReportDPO = new RMpHarmonicVRateReportD();
        if(!CollectionUtils.isEmpty (a)&&!CollectionUtils.isEmpty (b)){
            result = new RMpHarmonicVRateReportD();
            result.setPhase (PhaseType);
            result.setMeasurementPointId (dataV.get (0).getLineId ());
            result.setDataDate (Date.from (instant));

            for (int i = 0; i <a.size () ; i++) {
                DataVPO dataVPO = a.get (i);
                if(Objects.equals (dataVPO.getValueType (), "MIN")){
                    result.setVoltageHarmonicThdMin (dataVPO.getVThd ());
                }
                if(Objects.equals (dataVPO.getValueType (), "MAX")){
                    result.setVoltageHarmonicThdMax (dataVPO.getVThd ());
                }
                if(Objects.equals (dataVPO.getValueType (), "AVG")){
                    result.setVoltageHarmonicThdAvg (dataVPO.getVThd ());

                }
                if(Objects.equals (dataVPO.getValueType (), "CP95")){
                    result.setVoltageHarmonicThd95 (dataVPO.getVThd ());
                }

            }

            for (int j = 0; j < b.size (); j++) {
                DataHarmRateVPO dataHarmRateVPO = b.get (j);
                if(Objects.equals (dataHarmRateVPO.getValueType (), "MIN")){
                    rMpHarmonicVRateReportDPO =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.dataVPOTORMpHarmonicPReportDPOMin (dataHarmRateVPO);
                    BeanUtils.copyProperties (rMpHarmonicVRateReportDPO, result,getNullPropertyNames(rMpHarmonicVRateReportDPO));
                }
                if(Objects.equals (dataHarmRateVPO.getValueType (), "MAX")){
                    rMpHarmonicVRateReportDPO =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.dataVPOTORMpHarmonicPReportDPOMax (dataHarmRateVPO);
                    BeanUtils.copyProperties (rMpHarmonicVRateReportDPO, result,getNullPropertyNames(rMpHarmonicVRateReportDPO));
                }
                if(Objects.equals (dataHarmRateVPO.getValueType (), "AVG")){
                    rMpHarmonicVRateReportDPO =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.dataVPOTORMpHarmonicPReportDPOAvg (dataHarmRateVPO);
                    BeanUtils.copyProperties (rMpHarmonicVRateReportDPO, result,getNullPropertyNames(rMpHarmonicVRateReportDPO));
                }
                if(Objects.equals (dataHarmRateVPO.getValueType (), "CP95")){
                    rMpHarmonicVRateReportDPO =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.dataVPOTORMpHarmonicPReportDPO95 (dataHarmRateVPO);
                    BeanUtils.copyProperties (rMpHarmonicVRateReportDPO, result,getNullPropertyNames(rMpHarmonicVRateReportDPO));
                }
            }
        }




        return  result ;
    }


    /**
     * @Description: 组装 RMpHarmonicIMagReportDPO
     * @Param: [dataI, PhaseType] dataI：16条dataI数据
     * @return: com.njcn.prepare.harmonic.pojo.po.line.RMpHarmonicVRateReportDPO
     * @Author: clam
     * @Date: 2022/10/25
     */
    private RMpHarmonicIMagReportD packageRMpHarmonicIMagReportDPO(List<DataIPO> dataI, String PhaseType,Instant instant){

        RMpHarmonicIMagReportD result = null;

        List<DataIPO> a = dataI.stream ( ).
                filter (dataIPO -> Objects.equals (dataIPO.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpHarmonicIMagReportD rMpHarmonicIMagReportDPO = new RMpHarmonicIMagReportD();

        if(!CollectionUtils.isEmpty (a)){
            result = new RMpHarmonicIMagReportD();
            result.setPhase (PhaseType);
            result.setMeasurementPointId (dataI.get (0).getLineId ());
            result.setDataDate (Date.from (instant));
        }
        for (int j = 0; j < a.size (); j++) {
            DataIPO dataIPO = a.get (j);
            if(Objects.equals (dataIPO.getValueType (), "MIN")){
                rMpHarmonicIMagReportDPO =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.dataIPOTORMpHarmonicIMagReportDPOMin (dataIPO);
                BeanUtils.copyProperties (rMpHarmonicIMagReportDPO, result,getNullPropertyNames(rMpHarmonicIMagReportDPO));
            }
            if(Objects.equals (dataIPO.getValueType (), "MAX")){
                rMpHarmonicIMagReportDPO =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.dataIPOTORMpHarmonicIMagReportDPOMax (dataIPO);
                BeanUtils.copyProperties (rMpHarmonicIMagReportDPO, result,getNullPropertyNames(rMpHarmonicIMagReportDPO));
            }
            if(Objects.equals (dataIPO.getValueType (), "AVG")){
                rMpHarmonicIMagReportDPO =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.dataIPOTORMpHarmonicIMagReportDPOAvg (dataIPO);
                BeanUtils.copyProperties (rMpHarmonicIMagReportDPO, result,getNullPropertyNames(rMpHarmonicIMagReportDPO));
            }
            if(Objects.equals (dataIPO.getValueType (), "CP95")){
                rMpHarmonicIMagReportDPO =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.dataIPOTORMpHarmonicIMagReportDPO95 (dataIPO);
                BeanUtils.copyProperties (rMpHarmonicIMagReportDPO, result,getNullPropertyNames(rMpHarmonicIMagReportDPO));
            }
        }


        return  result ;
    }
    /**
     * @Description: packageRMpFlickerReportDPOPO
     * @Param: [dataFlickerPO, PhaseType]
     * @return: com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpFlickerReportDPO
     * @Author: clam
     * @Date: 2022/10/26
     */
    private RMpFlickerReportDPO packageRMpFlickerReportDPOPO(List<DataFlickerPO> dataFlickerPO, String PhaseType,Instant instant) {

        RMpFlickerReportDPO result = null;

        List<DataFlickerPO> a = dataFlickerPO.stream ( ).
                filter (dataFlicker -> Objects.equals (dataFlicker.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpFlickerReportDPO covertBean = new RMpFlickerReportDPO();

        if(!CollectionUtils.isEmpty (a)){
            result = new RMpFlickerReportDPO();
            result.setPhase (PhaseType);
            result.setMeasurementPointId (dataFlickerPO.get (0).getLineId ());
            result.setDataDate (Date.from (instant));
        }

        for (int j = 0; j < a.size (); j++) {
            DataFlickerPO temp = a.get (j);
            if(Objects.equals (temp.getValueType (), "MIN")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.rMpFlickerReportDPOConverterMin (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "MAX")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.rMpFlickerReportDPOConverterMax (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "AVG")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.rMpFlickerReportDPOConverterAvg (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "CP95")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.rMpFlickerReportDPOConverter95 (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
        }


        return  result ;
    }
    /**
     * @Description: packageRMpPltReportDPO
     * @Param: [dataFlickerPO, PhaseType]
     * @return: com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpFlickerReportDPO
     * @Author: clam
     * @Date: 2022/10/26
     */
    private RMpPltReportDPO packageRMpPltReportDPO(List<DataPltPO> dataPlt, String PhaseType,Instant instant) {

        RMpPltReportDPO result = null;

        List<DataPltPO> a = dataPlt.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpPltReportDPO covertBean = new RMpPltReportDPO();

        if(!CollectionUtils.isEmpty (a)){
            result = new RMpPltReportDPO();
            result.setPhase (PhaseType);
            result.setMeasurementPointId (dataPlt.get (0).getLineId ());
            result.setDataDate (Date.from (instant));
        }

        for (int j = 0; j < a.size (); j++) {
            DataPltPO temp = a.get (j);
            if(Objects.equals (temp.getValueType (), "MIN")){
                result.setLongTimeFlashingMin (temp.getPlt ());
            }
            if(Objects.equals (temp.getValueType (), "MAX")){
                result.setLongTimeFlashingMax (temp.getPlt ());

            }
            if(Objects.equals (temp.getValueType (), "AVG")){
                result.setLongTimeFlashingAvg (temp.getPlt ());

            }
            if(Objects.equals (temp.getValueType (), "CP95")){
                result.setLongTimeFlashing95 (temp.getPlt ());

            }
        }


        return  result ;
    }
    /**
     * @Description: packageRMpHarmonicIRateReportDPO
     * @Param: [dataInHarmRateIPO, PhaseType]
     * @return: com.njcn.prepare.harmonic.pojo.po.line.RMpHarmonicIRateReportDPO
     * @Author: clam
     * @Date: 2022/10/26
     */
    private RMpHarmonicIRateReportD packageRMpHarmonicIRateReportDPO(List<DataHarmRateIPO> dataHarmRateIPOList, String PhaseType,Instant instant) {

        RMpHarmonicIRateReportD result =null;

        List<DataHarmRateIPO> a = dataHarmRateIPOList.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpHarmonicIRateReportD covertBean = new RMpHarmonicIRateReportD();

        if(!CollectionUtils.isEmpty (a)){
            result = new RMpHarmonicIRateReportD();
            result.setPhase (PhaseType);
            result.setMeasurementPointId (dataHarmRateIPOList.get (0).getLineId ());
            result.setDataDate (Date.from (instant));
        }

        for (int j = 0; j < a.size (); j++) {
            DataHarmRateIPO temp = a.get (j);
            if(Objects.equals (temp.getValueType (), "MIN")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpHarmonicIRateReportDPOConverterMin (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "MAX")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpHarmonicIRateReportDPOConverterMax (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "AVG")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpHarmonicIRateReportDPOConverterAvg (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "CP95")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpHarmonicIRateReportDPOConverter95 (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
        }


        return  result ;
    }
    /**
     * @Description: packageRMpInharmonicIRateReportDPO
     * @Param: [dataInHarmRateIPO, PhaseType]
     * @return: com.njcn.prepare.harmonic.pojo.po.line.RMpInharmonicIRateReportDPO
     * @Author: clam
     * @Date: 2022/10/26
     */
    private RMpInharmonicIRateReportD packageRMpInharmonicIRateReportDPO(List<DataInHarmRateIPO> dataInHarmRateIPO, String PhaseType,Instant instant) {
        RMpInharmonicIRateReportD result = null;

        List<DataInHarmRateIPO> a = dataInHarmRateIPO.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpInharmonicIRateReportD covertBean = new RMpInharmonicIRateReportD();

        if(!CollectionUtils.isEmpty (a)){
            result = new RMpInharmonicIRateReportD();
            result.setPhase (PhaseType);
            result.setMeasurementPointId (dataInHarmRateIPO.get (0).getLineId ());
            result.setDataDate (Date.from (instant));
        }
        for (int j = 0; j < a.size ( ); j++) {
            DataInHarmRateIPO temp = a.get (j);
            if (Objects.equals (temp.getValueType ( ), "MIN")) {
                covertBean = InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicIRateReportDPOConverterMin (temp);
                BeanUtils.copyProperties (covertBean, result, getNullPropertyNames (covertBean));
            }
            if (Objects.equals (temp.getValueType ( ), "MAX")) {
                covertBean = InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicIRateReportDPOConverterMax (temp);
                BeanUtils.copyProperties (covertBean, result, getNullPropertyNames (covertBean));
            }
            if (Objects.equals (temp.getValueType ( ), "AVG")) {
                covertBean = InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicIRateReportDPOConverterAvg (temp);
                BeanUtils.copyProperties (covertBean, result, getNullPropertyNames (covertBean));
            }
            if (Objects.equals (temp.getValueType ( ), "CP95")) {
                covertBean = InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicIRateReportDPOConverter95 (temp);
                BeanUtils.copyProperties (covertBean, result, getNullPropertyNames (covertBean));
            }
        }


        return result;

    }

    /**
     * @Description: packageRMpInharmonicIMagReportDPO
     * @Param: [dataInHarmIPO, PhaseType]
     * @return: com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpInharmonicIMagReportDPO
     * @Author: clam
     * @Date: 2022/10/27
     */
    private RMpInharmonicIMagReportDPO packageRMpInharmonicIMagReportDPO(List<DataInHarmIPO> dataInHarmIPO, String PhaseType,Instant instant) {

        RMpInharmonicIMagReportDPO result = null;

        List<DataInHarmIPO> a = dataInHarmIPO.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpInharmonicIMagReportDPO covertBean = new RMpInharmonicIMagReportDPO();

        if(!CollectionUtils.isEmpty (a)) {
            result = new RMpInharmonicIMagReportDPO ( );
            result.setPhase (PhaseType);
            result.setMeasurementPointId (dataInHarmIPO.get (0).getLineId ( ));
            result.setDataDate (Date.from (instant));
        }
        for (int j = 0; j < a.size (); j++) {
            DataInHarmIPO temp = a.get (j);
            if(Objects.equals (temp.getValueType (), "MIN")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicIMagReportDPOConverterMin (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "MAX")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicIMagReportDPOConverterMax (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "AVG")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicIMagReportDPOConverterAvg (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "CP95")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicIMagReportDPOConverter95 (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
        }


        return  result ;

    }

    /**
     * @Description: packageRMpInharmonicVRateReportDPO
     * @Param: [dataInHarmRateVPO, PhaseType]
     * @return: com.njcn.prepare.harmonic.pojo.po.line.RMpInharmonicVRateReportDPO
     * @Author: clam
     * @Date: 2022/10/27
     */
    private RMpInharmonicVRateReportD packageRMpInharmonicVRateReportDPO(List<DataInHarmRateVPO> dataInHarmRateVPO, String PhaseType,Instant instant) {

        RMpInharmonicVRateReportD result = null ;

        List<DataInHarmRateVPO> a = dataInHarmRateVPO.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpInharmonicVRateReportD covertBean = new RMpInharmonicVRateReportD();

        if(!CollectionUtils.isEmpty (a)){
            result = new RMpInharmonicVRateReportD();
            result.setPhase (PhaseType);
            result.setMeasurementPointId (dataInHarmRateVPO.get (0).getLineId ());
            result.setDataDate (Date.from (instant));
        }

        for (int j = 0; j < a.size (); j++) {
            DataInHarmRateVPO temp = a.get (j);
            if(Objects.equals (temp.getValueType (), "MIN")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicVRateReportDPOConverterMin (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "MAX")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicVRateReportDPOConverterMax (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "AVG")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicVRateReportDPOConverterAvg (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "CP95")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpInharmonicVRateReportDPOConverter95 (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
        }


        return  result ;

    }
    /**
     * @Description: packageRMpHarmonicPReportDPO
     * @Param: [dataHarmPowerPPO, dataHarmPowerQPO, PhaseType]
     * @return: com.njcn.prepare.harmonic.pojo.mysql.po.line.RMpHarmonicPReportDPO
     * @Author: clam
     * @Date: 2022/10/28
     */
    private RMpHarmonicPReportDPO packageRMpHarmonicPReportDPO(List<DataHarmPowerPPO> dataHarmPowerPPO, List<DataHarmPowerQPO> dataHarmPowerQPO, String PhaseType,Instant instant) {

        RMpHarmonicPReportDPO result = null ;

        List<DataHarmPowerPPO> a = dataHarmPowerPPO.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));

        List<DataHarmPowerQPO> b = dataHarmPowerQPO.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpInharmonicVRateReportD covertBean = new RMpInharmonicVRateReportD();

        if(!CollectionUtils.isEmpty (a)&&!CollectionUtils.isEmpty (b)){
            result = new RMpHarmonicPReportDPO();
            result.setPhase (PhaseType);
            result.setMeasurementPointId (dataHarmPowerPPO.get (0).getLineId ());
            result.setDataDate (Date.from (instant));
        }

        for (int j = 0; j < b.size (); j++) {
            DataHarmPowerQPO temp = b.get (j);
            if(Objects.equals (temp.getValueType (), "MIN")){
                result.setFundamentalRateofworkMin (temp.getQ1 ());
            }
            if(Objects.equals (temp.getValueType (), "MAX")){
                result.setFundamentalRateofworkMax (temp.getQ1 ());

            }
            if(Objects.equals (temp.getValueType (), "AVG")){
                result.setFundamentalRateofworkAvg (temp.getQ1 ());

            }
            if(Objects.equals (temp.getValueType (), "CP95")){
                result.setFundamentalRateofwork95 (temp.getQ1 ());

            }
        }


        for (int j = 0; j < a.size (); j++) {
            DataHarmPowerPPO temp = a.get (j);
            if(Objects.equals (temp.getValueType (), "MIN")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpHarmonicPReportDPOConverterMin (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "MAX")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpHarmonicPReportDPOConverterMax (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "AVG")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpHarmonicPReportDPOConverterAvg (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
            if(Objects.equals (temp.getValueType (), "CP95")){
                covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpHarmonicPReportDPOConverter95 (temp);
                BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
            }
        }


        return  result ;
    }



    private RMpMeasurePhaseReportD packageRMpMeasurePhaseReportDPO(List<DataVPO> dataV, List<DataIPO> dataI, List<DataHarmPowerPPO> dataHarmPowerPPO, List<DataHarmPowerSPO> dataHarmPowers, List<DataHarmPowerQPO> dataHarmPowerQPO, String PhaseType,Instant instant) {
        RMpMeasurePhaseReportD result = null ;

        List<DataVPO> a = dataV.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));

        List<DataIPO> b = dataI.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));

        List<DataHarmPowerPPO> c = dataHarmPowerPPO.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));

        List<DataHarmPowerSPO> d = dataHarmPowers.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));

        List<DataHarmPowerQPO> e = dataHarmPowerQPO.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpMeasurePhaseReportD covertBean = new RMpMeasurePhaseReportD();

        if(!CollectionUtils.isEmpty (a)&&!CollectionUtils.isEmpty (b)){
            result = new RMpMeasurePhaseReportD();
            result.setPhase (PhaseType);
            result.setMeasurementPointId (dataHarmPowerPPO.get (0).getLineId ());
            result.setDataDate (Date.from (instant));
        }
        //todo 非空判断
        /*max*/
        List<DataVPO> maxList = a.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MAX")).
                collect (Collectors.toList ( ));
        List<DataIPO> max1List = b.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MAX")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerPPO> max2List = c.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MAX")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerSPO> max3List = d.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MAX")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerQPO> max4List = e.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MAX")).
                collect (Collectors.toList ( ));
        if(!CollectionUtils.isEmpty (maxList)
                &&!CollectionUtils.isEmpty (max1List)
                &&!CollectionUtils.isEmpty (max2List)
                &&!CollectionUtils.isEmpty (max3List)
                &&!CollectionUtils.isEmpty (max4List)){
            DataVPO max = maxList.get (0);
            DataIPO max1 = max1List.get (0);
            DataHarmPowerPPO max2 = max2List.get (0);
            DataHarmPowerSPO max3 = max3List.get (0);
            DataHarmPowerQPO max4 = max4List.get (0);
            covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpMeasurePhaseReportDPOConverterMax (max,max1,max2,max3,max4);
            BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
        }


        /*min*/
        List<DataVPO> minList = a.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MIN")).
                collect (Collectors.toList ( ));
        List<DataIPO> min1List = b.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MIN")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerPPO> min2List = c.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MIN")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerSPO> min3List = d.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MIN")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerQPO> min4List = e.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MIN")).
                collect (Collectors.toList ( ));
        if(!CollectionUtils.isEmpty (minList)
                &&!CollectionUtils.isEmpty (min1List)
                &&!CollectionUtils.isEmpty (min2List)
                &&!CollectionUtils.isEmpty (min3List)
                &&!CollectionUtils.isEmpty (min4List)){
            DataVPO min = minList.get (0);
            DataIPO min1 = min1List.get (0);
            DataHarmPowerPPO min2 = min2List.get (0);
            DataHarmPowerSPO min3 = min3List.get (0);
            DataHarmPowerQPO min4 = min4List.get (0);
            covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpMeasurePhaseReportDPOConverterMin (min,min1,min2,min3,min4);
            BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
        }


        /*avg*/
        List<DataVPO> avgList = a.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "AVG")).
                collect (Collectors.toList ( ));
        List<DataIPO> avg1List = b.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "AVG")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerPPO> avg2List = c.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "AVG")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerSPO> avg3List = d.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "AVG")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerQPO> avg4List = e.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "AVG")).
                collect (Collectors.toList ( ));

        if(!CollectionUtils.isEmpty (avgList)
                &&!CollectionUtils.isEmpty (avg1List)
                &&!CollectionUtils.isEmpty (avg2List)
                &&!CollectionUtils.isEmpty (avg3List)
                &&!CollectionUtils.isEmpty (avg4List)){
            DataVPO avg = avgList.get (0);
            DataIPO avg1 = avg1List.get (0);
            DataHarmPowerPPO avg2 = avg2List.get (0);
            DataHarmPowerSPO avg3 = avg3List.get (0);
            DataHarmPowerQPO avg4 = avg4List.get (0);
            covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpMeasurePhaseReportDPOConverterAVg (avg,avg1,avg2,avg3,avg4);
            BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
        }


        /*cp95*/
        List<DataVPO>  cp95List = a.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "CP95")).
                collect (Collectors.toList ( ));
        List<DataIPO>  cp951List = b.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "CP95")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerPPO> cp952List = c.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "CP95")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerSPO>  cp953List = d.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "CP95")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerQPO>  cp954List = e.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "CP95")).
                collect (Collectors.toList ( ));
        if(!CollectionUtils.isEmpty (cp95List)
                &&!CollectionUtils.isEmpty (cp951List)
                &&!CollectionUtils.isEmpty (cp952List)
                &&!CollectionUtils.isEmpty (cp953List)
                &&!CollectionUtils.isEmpty (cp954List)){
            DataVPO cp95 = cp95List.get (0);
            DataIPO cp951 = cp951List.get (0);
            DataHarmPowerPPO cp952 = cp952List.get (0);
            DataHarmPowerSPO cp953 = cp953List.get (0);
            DataHarmPowerQPO cp954 = cp954List.get (0);
            covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpMeasurePhaseReportDPOConverterCp95 (cp95,cp951,cp952,cp953,cp954);
            BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
        }


        return result;

    }
    private RMpMeasureReportD packageRMpMeasureReportDPO(List<DataVPO> dataV, List<DataIPO> dataI, List<DataHarmPowerPPO> dataHarmPowerPPO, List<DataHarmPowerSPO> dataHarmPowers, List<DataHarmPowerQPO> dataHarmPowerQPO, String PhaseType,Instant instant) {
        RMpMeasureReportD result = null ;

        List<DataVPO> a = dataV.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));

        List<DataIPO> b = dataI.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));

        List<DataHarmPowerPPO> c = dataHarmPowerPPO.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));

        List<DataHarmPowerSPO> d = dataHarmPowers.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));

        List<DataHarmPowerQPO> e = dataHarmPowerQPO.stream ( ).
                filter (temp -> Objects.equals (temp.getPhaseType ( ), PhaseType)).
                collect (Collectors.toList ( ));
        RMpMeasureReportD covertBean = new RMpMeasureReportD();

        if(!CollectionUtils.isEmpty (a)&&!CollectionUtils.isEmpty (b)){
            result = new RMpMeasureReportD();
            result.setMeasurementPointId (dataHarmPowerPPO.get (0).getLineId ());
            result.setDataDate (Date.from (instant));
        }
        //todo 非空判断
        /*max*/
        List<DataVPO> maxList = a.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MAX")).
                collect (Collectors.toList ( ));
        List<DataIPO> max1List = b.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MAX")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerPPO> max2List = c.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MAX")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerSPO> max3List = d.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MAX")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerQPO> max4List = e.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MAX")).
                collect (Collectors.toList ( ));
        if(!CollectionUtils.isEmpty (maxList)
                &&!CollectionUtils.isEmpty (max1List)
                &&!CollectionUtils.isEmpty (max2List)
                &&!CollectionUtils.isEmpty (max3List)
                &&!CollectionUtils.isEmpty (max4List)){
            DataVPO max = maxList.get (0);
            DataIPO max1 = max1List.get (0);
            DataHarmPowerPPO max2 = max2List.get (0);
            DataHarmPowerSPO max3 = max3List.get (0);
            DataHarmPowerQPO max4 = max4List.get (0);
            covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpMeasureReportDPOConverterMax (max,max1,max2,max3,max4);
            BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
        }


        /*min*/
        List<DataVPO> minList = a.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MIN")).
                collect (Collectors.toList ( ));
        List<DataIPO> min1List = b.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MIN")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerPPO> min2List = c.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MIN")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerSPO> min3List = d.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MIN")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerQPO> min4List = e.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "MIN")).
                collect (Collectors.toList ( ));
        if(!CollectionUtils.isEmpty (minList)
                &&!CollectionUtils.isEmpty (min1List)
                &&!CollectionUtils.isEmpty (min2List)
                &&!CollectionUtils.isEmpty (min3List)
                &&!CollectionUtils.isEmpty (min4List)){
            DataVPO min = minList.get (0);
            DataIPO min1 = min1List.get (0);
            DataHarmPowerPPO min2 = min2List.get (0);
            DataHarmPowerSPO min3 = min3List.get (0);
            DataHarmPowerQPO min4 = min4List.get (0);
            covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpMeasureReportDPOConverterMin (min,min1,min2,min3,min4);
            BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
        }


        /*avg*/
        List<DataVPO> avgList = a.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "AVG")).
                collect (Collectors.toList ( ));
        List<DataIPO> avg1List = b.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "AVG")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerPPO> avg2List = c.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "AVG")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerSPO> avg3List = d.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "AVG")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerQPO> avg4List = e.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "AVG")).
                collect (Collectors.toList ( ));

        if(!CollectionUtils.isEmpty (avgList)
                &&!CollectionUtils.isEmpty (avg1List)
                &&!CollectionUtils.isEmpty (avg2List)
                &&!CollectionUtils.isEmpty (avg3List)
                &&!CollectionUtils.isEmpty (avg4List)){
            DataVPO avg = avgList.get (0);
            DataIPO avg1 = avg1List.get (0);
            DataHarmPowerPPO avg2 = avg2List.get (0);
            DataHarmPowerSPO avg3 = avg3List.get (0);
            DataHarmPowerQPO avg4 = avg4List.get (0);
            covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpMeasureReportDPOConverterAVg (avg,avg1,avg2,avg3,avg4);
            BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
        }


        /*cp95*/
        List<DataVPO>  cp95List = a.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "CP95")).
                collect (Collectors.toList ( ));
        List<DataIPO>  cp951List = b.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "CP95")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerPPO> cp952List = c.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "CP95")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerSPO>  cp953List = d.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "CP95")).
                collect (Collectors.toList ( ));
        List<DataHarmPowerQPO>  cp954List = e.stream ( ).filter (temp -> Objects.equals (temp.getValueType ( ), "CP95")).
                collect (Collectors.toList ( ));
        if(!CollectionUtils.isEmpty (cp95List)
                &&!CollectionUtils.isEmpty (cp951List)
                &&!CollectionUtils.isEmpty (cp952List)
                &&!CollectionUtils.isEmpty (cp953List)
                &&!CollectionUtils.isEmpty (cp954List)){
            DataVPO cp95 = cp95List.get (0);
            DataIPO cp951 = cp951List.get (0);
            DataHarmPowerPPO cp952 = cp952List.get (0);
            DataHarmPowerSPO cp953 = cp953List.get (0);
            DataHarmPowerQPO cp954 = cp954List.get (0);
            covertBean =  InfluxdbPOConverter.INFLUXDB_PO_CONVERTER.RMpMeasureReportDPOConverterCp95 (cp95,cp951,cp952,cp953,cp954);
            BeanUtils.copyProperties (covertBean, result,getNullPropertyNames(covertBean));
        }

        return result;

    }

    /**
     * 获取所有字段为null的属性名
     * @param source
     * @return
     */
    public  String[] getNullPropertyNames (Object source) {
        final BeanWrapper src = new BeanWrapperImpl (source);
        java.beans.PropertyDescriptor[] pds = src.getPropertyDescriptors ( );

        Set<String> emptyNames = new HashSet<String> ( );
        for (java.beans.PropertyDescriptor pd : pds) {
            Object srcValue = src.getPropertyValue (pd.getName ( ));
            if (srcValue == null){
                emptyNames.add (pd.getName ( ));
            }
        }
        String[] result = new String[emptyNames.size ( )];
        return emptyNames.toArray (result);

    }

}
