/*
 * Author: wangjian
 * 生成mapper
 */
package com.tofly.watermeter.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.watermeter.custom.dto.AmountOrWaterVolumeInfoDto;
import com.tofly.watermeter.custom.entity.meterRead.InitCbByHb;
import com.tofly.watermeter.custom.entity.meterRead.QydWater;
import com.tofly.watermeter.custom.entity.meterRead.ReadSearch;
import com.tofly.watermeter.custom.entity.meterRead.readstatic.*;
import com.tofly.watermeter.custom.entity.quality.QualityEvent;
import com.tofly.watermeter.custom.entity.quality.QualityEventInfo;
import com.tofly.watermeter.custom.entity.quality.QualityFluctuate;
import com.tofly.watermeter.custom.entity.quality.QualityStatis;
import com.tofly.watermeter.entity.Qfkhjbxx;
import com.tofly.watermeter.entity.Readmetereashis;
import com.tofly.watermeter.entity.Readmeterhis;
import com.tofly.watermeter.entity.Yhbingqy;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 抄表历史数据（有本系统自己管理的）
 *
 * @author wangjieliu
 * @date Wed Nov 10 00:00:00 CST 2021
 */
@Mapper
public interface ReadmeterhisMapper extends BaseMapper<Readmeterhis> {

    List<String> getFileInfoList(@Param("fileId") List<String> fileId);

    String getIssynName(@Param("issyn") String issyn);

    String getYhKh(@Param("yhbh") String yhbh);

    String getCbbzName(@Param("cbbz") String cbbz);

    List<Readmeterhis> getInitCbData(@Param("qydbm") String qydbm, @Param("isGeneral") String isGeneral);

    List<Readmeterhis> getInitCbDataList(@Param("qydbm") List<String> qydbm, @Param("isGeneral") String isGeneral);

    List<Readmeterhis> getInitCbDataCard(@Param("qydbm") String qydbm);

    List<AllocationSta> allocationClloect(@Param("search") ReadSearch search);

    List<Map> getReadPercent(@Param("cwyf") String cwyf, @Param("list") List<String> qybmList , @Param("isGeneral") String isGeneral);

    List<Map> getReadPercentByQy(@Param("cwyf") String cwyf, @Param("qybmList") List<String> qybmList,
                                 @Param("cbbList") List<String> cbbList , @Param("isGeneral") String isGeneral);

    List<Map> getReadPercentByCbry(@Param("cwyf") String cwyf,
                                   @Param("cbryList") List<String> cbryList , @Param("isGeneral") String isGeneral);

    List<Map> getReadPercentDay(@Param("cbryList") List<String> cbryList,
                                @Param("search") ReadSearch search , @Param("isGeneral") String isGeneral);


    List<Map> getReadTimeDeatil(@Param("qybmList") List<String> qybmList,
                                @Param("cbbList") List<String> cbbList,
                                @Param("cwyf") String cwyf , @Param("isGeneral") String isGeneral);

    List<InitCbByHb> initCbDataByHb(@Param("monthPlan") String monthPlan);

    void initCbPlanHb(@Param("list") List<InitCbByHb> hbInfo, @Param("monthPlan") String monthPlan);

    List<Readmeterhis> getInitFrontThreeData(Page page, @Param("monthPlan") String monthPlan);

    int getInitFrontThreeDataCount(@Param("monthPlan") String monthPlan);

    void initFrontThreeData(@Param("list") List<Readmeterhis> readmeterhisList, @Param("monthPlan") String monthPlan);

    void updateCbxh(@Param("list") List<Yhbingqy> resultYhList,
                    @Param("yearMonth") String yearMonth, @Param("qydbm") String qydbm);

    List<Yhbingqy> getNoSortYhList(@Param("yearMonth") String yearMonth,
                                   @Param("list") List<String> sortYhbhList, @Param("qydbm") String qydbm);


    void updateYearCbsl1(@Param("list") List qfcbqfmxl1 , @Param("yearMonth") String yearMonth,@Param("yearOnMonth") String yearOnMonth1);
    void updateYearCbsl2(@Param("list") List qfcbqfmxl2 , @Param("yearMonth") String yearMonth,@Param("yearOnMonth") String yearOnMonth2);
    void updateYearCbsl3(@Param("list") List qfcbqfmxl3 , @Param("yearMonth") String yearMonth,@Param("yearOnMonth") String yearOnMonth3);


    List<QydWater> getWaterByQyd(@Param("currentDay") String currentDay);

    IPage<Readmeterhis> inspectCollectDeatils(Page page, @Param("qualityStatis") QualityStatis qualityStatis ,
                                              @Param("list")List<String> abnormalList ,
                                              @Param("qybmList")List<String> qybmList ,
                                              @Param("cbqdList")List<String> cbqdList);
    List<Readmeterhis> inspectCollectDeatilsList(@Param("qualityStatis") QualityStatis qualityStatis,
                                                 @Param("list")List<String> abnormalList ,
                                                 @Param("qybmList")List<String> qybmList ,
                                                 @Param("cbqdList")List<String> cbqdList);

    List<QualityFluctuate> getFluctuateBySbkjUp(@Param("qybm") String qybm, @Param("isGeneral")String isGeneral ,@Param("yearMonth") String yearMonth,
                                                @Param("queryCount") Integer queryCount, @Param("list")List<String> qydbmList);
    List<QualityFluctuate> getFluctuateBySbkjDown(@Param("qybm") String qybm, @Param("isGeneral")String isGeneral ,@Param("yearMonth") String yearMonth,
                                                @Param("queryCount") Integer queryCount, @Param("list")List<String> qydbmList);

    List<QualityFluctuate> getFluctuateByYsxzUp(@Param("qybm") String qybm, @Param("isGeneral")String isGeneral ,@Param("yearMonth") String yearMonth,
                                                @Param("queryCount") Integer queryCount, @Param("list")List<String> qydbmList);
    List<QualityFluctuate> getFluctuateByYsxzDown(@Param("qybm") String qybm, @Param("isGeneral")String isGeneral ,@Param("yearMonth") String yearMonth,
                                                  @Param("queryCount") Integer queryCount, @Param("list")List<String> qydbmList);
    List<QualityFluctuate> getFluctuateByAbnomalUp(@Param("qybm") String qybm, @Param("isGeneral")String isGeneral ,@Param("yearMonth") String yearMonth,
                                                   @Param("queryCount") Integer queryCount, @Param("list")List<String> qydbmList);
    List<QualityFluctuate> getFluctuateByAbnomalDown(@Param("qybm") String qybm, @Param("isGeneral")String isGeneral ,@Param("yearMonth") String yearMonth,
                                                     @Param("queryCount") Integer queryCount, @Param("list")List<String> qydbmList);

    String getYsxz(@Param("ysxz") String ysxz);


    List<ReadOverTime> getOvertimeCollect(@Param("list") List<String> cbryList,
                                          @Param("yearMonth") String yearMonth, @Param("isGeneral") String isGeneral);

    List<ReadOverTimeDetail> getOvertimeCollectDeatil(@Param("cbry") Long cbry,
                                                      @Param("yearMonth") String yearMonth, @Param("isGeneral") String isGeneral);


    Long getMaxId();

    List<AccuracyCollect> accuracyCollect(@Param("list") List<String> cbryList, @Param("yearMonth") String yearMonth , @Param("isGeneral") String isGeneral);

    List<AccuracyCollect> cardUpdateCollect(@Param("list") List<String> cbryList, @Param("yearMonth") String yearMonth , @Param("isGeneral") String isGeneral);

    void updateAuditCbData(@Param("list") List<Readmeterhis> readmeterhisList);
    void updateAuditYcbData(@Param("list") List<Readmetereashis> readmeterhisList);

    void updateReadmeterhisYhInfo(@Param("list")List<Qfkhjbxx> list,@Param("monthPlan") String monthPlan);

    void updateReadmeterhisYhWaterVolume(@Param("list")List<AmountOrWaterVolumeInfoDto> upts, @Param("monthPlan")String monthPlan);

    IPage<QualityEvent> eventCollect(Page page, @Param("inputcontent") String inputcontent, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<QualityEventInfo> getCbEventInfo(@Param("yhbh")String yhbh, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
    List<QualityEventInfo> getGdEventInfo(@Param("yhbh")String yhbh, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
    List<QualityEventInfo> getZjEventInfo(@Param("yhbh")String yhbh, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    Boolean updateInspectRatio(@Param("ratio") String ratio);

    void updateSoleSign(@Param("list") List<Readmeterhis> readmeterhisArrayList, @Param("yearMonth") String yearMonth);

    List<ReadCollect> getOffline(@Param("yearMonth") String yearMonth, @Param("isGeneral")String isGeneral, @Param("cbryList")List<String> cbryList,
                                 @Param("qybmList")List<String> qybmList, @Param("qydbmList")List<String> qydbmList);

    IPage<Readmeterhis> fluctuateCollectDeatil(Page page, @Param("queryType") String queryType, @Param("type") String type,
                                               @Param("qybm") String qybm, @Param("qydbmList") List<String> qydbmList,
                                               @Param("yearMonth") String yearMonth, @Param("queryCount") Integer queryCount ,
                                               @Param("sbkjList") List<String> sbkjList , @Param("abnormalList") List<String> abnormalList ,
                                               @Param("ysxzList") List<String> ysxzList , @Param("isGeneral")String isGeneral);


    Map cardDataAnalyeCollect(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<ReadOverTime> getTimeAbnormalCollect(@Param("list") List<String> cbryList, @Param("yearMonth")String yearMonth,
                                              @Param("overDiffTime")Integer overDiffTime , @Param("isGeneral")String isGeneral);

    IPage<ReadOverTimeDetail> getTimeAbnormalTwo(Page page, @Param("list") List<String> cbryList, @Param("yearMonth")String yearMonth,
                                                 @Param("overDiffTime")Integer overDiffTime , @Param("isGeneral")String isGeneral);

    boolean updateChildSort(@Param("list")List<Readmeterhis> readmeterhisList);

    boolean updateTaskCbxh(@Param("qydbm") String qydbm,@Param("monthPlan") String monthPlan);

    IPage<Readmeterhis> getClient(Page page, @Param("search") ReadSearch search);

    List<Readmeterhis> getClient(@Param("search") ReadSearch search);

    boolean handleAbnormalUser();

}
