/*
 * 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.KhSearch;
import com.tofly.watermeter.custom.entity.quality.QualityHouse;
import com.tofly.watermeter.custom.entity.webserverbean.InstallCustom;
import com.tofly.watermeter.entity.Qfkhjbxx;
import com.tofly.watermeter.entity.Readmetereashis;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * 营销档案客户基本信息表
 *
 * @author wangjieliu
 * @date Fri Mar 19 00:00:00 CST 2021
 */
@Mapper
public interface QfkhjbxxMapper extends BaseMapper<Qfkhjbxx> {

    List<Map> getUserInfo(@Param("userId") Long userId);

    Double getWaterValue(String khbh);

    List<Qfkhjbxx> getZjData(@Param("month") String presentMonth);

    List<Map> getCodeByFids();

    List<Map> getIdByFid(Integer fid);

//    Long getIdByCjCode(String cj);
//
//    Long getIdByLxCode(String lx);
//
//    Long getIdByKjCode(String kj);

    String getCjByCode(String cj);

    String getLxByCode(String lx);

    String getKjByCode(String kj);

    String getCodeById(Long id);

    String ztName(String zt);

    List<Qfkhjbxx> getLisrKh(@Param("input") String inputContent);

    Long getIdByCode(@Param("pcid") Integer pcid, @Param("code") String code);

    boolean deleteAll();

    Qfkhjbxx getKhInfoByJbbh(@Param("yhbh") String yhbh);

    boolean updateBatchCustom(@Param("list") List<InstallCustom> newInstallList);

    IPage<Qfkhjbxx> getKhLike(Page page, @Param("phone") String phone, @Param("yhbh") String yhbh,
                              @Param("yhxm") String yhxm, @Param("inputcontent") String inputcontent,
                              @Param("yhdz")String yhdz,@Param("sbbh")String sbbh,@Param("sfzh") String sfzh);

    void updateKh(@Param("khList") List<Qfkhjbxx> updateKhList);

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

    String getcbbName(String cbb);

    String getcbpqName(String cbpq);

    void updateYhWaterVolumeInfos(List<AmountOrWaterVolumeInfoDto> upts);

    List<QualityHouse> householdsCollect(@Param("cbqyList") List<String> cbqyList, @Param("cbqydList") List<String> cbqydList,
                                         @Param("sbkjList") List<String> sbkjList, @Param("ysxzList") List<String> ysxzList,
                                         @Param("sbcjList") List<String> sbcjList);

    /**
     * 这个是以用户绑定为基础查询的
     *
     * @param page
     * @param cbqyList
     * @param cbqydList
     * @param sbkjList
     * @param ysxzList
     * @param sbcjList
     * @param inputcontent
     * @return
     */
    IPage<Qfkhjbxx> householdsCollectDeatil(Page page, @Param("cbqyList") List<String> cbqyList, @Param("cbqydList") List<String> cbqydList,
                                            @Param("sbkjList") List<String> sbkjList, @Param("ysxzList") List<String> ysxzList,
                                            @Param("sbcjList") List<String> sbcjList, @Param("inputcontent") String inputcontent);

    /**
     * 这个是以客户档案为基础查询的
     *
     * @param page
     * @param khSearch
     * @param cbqyList
     * @param cbqydList
     * @return
     */
    IPage<Qfkhjbxx> commonKh(Page<Qfkhjbxx> page, @Param("ysxzList") List<String> ysxzList, @Param("cbqyList") List<String> cbqyList, @Param("cbqydList") List<String> cbqydList,
                             @Param("khSearch") KhSearch khSearch, @Param("sbcjList") List<String> sbcjList,
                             @Param("yhztList") List<String> yhztList, @Param("cbbList") List<String> cbbList);

    List<Qfkhjbxx> commonKhList(@Param("ysxzList") List<String> ysxzList, @Param("cbqyList") List<String> cbqyList, @Param("cbqydList") List<String> cbqydList,
                                @Param("khSearch") KhSearch khSearch, @Param("sbcjList") List<String> sbcjList,
                                @Param("yhztList") List<String> yhztList, @Param("cbbList") List<String> cbbList);

    List<Readmetereashis> getYhInfoAndCbslInfo(@Param("yhbhList") List<String> yhbhList, @Param("yearMonth") String yearMonth);

    IPage<Qfkhjbxx> allotInfo(Page<Qfkhjbxx> page, @Param("cbqyList") List<String> cbqyList, @Param("cbqydList") List<String> cbqydList,
                              @Param("sbkjList") List<String> sbkjList, @Param("cbbList") List<String> cbbList, @Param("cbpqList") List<String> cbpqList,
                              @Param("ysxzList") List<String> ysxzList, @Param("inputcontent") String inputcontent,
                              @Param("collectionNumber") String collectionNumber, @Param("isWatchType") String isWatchType,
                              @Param("sfncys") String sfncys, @Param("jyz") String jyz);

    List<Map<String, String>> getCodeAndWater();

    List<Map> getOfflineInfoList(@Param("cwyf") String cwyf,
                                 @Param("cbpqList") List<String> cbpq, @Param("cbbList") List<String> cbb,
                                 @Param("cbryList") List<String> cbry, @Param("isDis") String isDis,
                                 @Param("isGeneral") String isGeneral, @Param("state") String state,
                                 @Param("isEstimate") String isEstimate, @Param("issyn") String issyn,
                                 @Param("cbfsList") List<String> cbfsList, @Param("inputContent") String inputContent,
                                 @Param("isUpdate") String isUpdate);

    /**
     * 查询当月是否生成该区段数据，拿到区段编码
     * @param month 月份
     * @return list
     */
    List<String> getCbqdBm(@Param("month") String month,@Param("isGeneral") String isGeneral);


}
