package com.tofly.feesapi.cbgl.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.feesapi.cbgl.entity.YyCblr;
import com.tofly.feesapi.cbgl.entity.YyCblrLs;
import com.tofly.feesapi.cbgl.entity.dto.CblrSflxFilter;
import com.tofly.feesapi.cbgl.entity.dto.YyCblrFilter;
import com.tofly.feesapi.cbgl.entity.dto.YyCblrtjFilter;
import com.tofly.feesapi.cbgl.entity.dto.ZcbcssltjDto;
import com.tofly.feesapi.cbgl.entity.vo.*;
import com.tofly.feesapi.common.core.dto.PageDto;
import com.tofly.feesapi.mxcx.entity.dto.QftjSeachFilter;
import com.tofly.feesapi.sfgl.entity.dto.YyQfmxStatFilter;
import com.tofly.feesapi.sfgl.entity.vo.YyStat;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

public interface YyCblrMapper extends BaseMapper<YyCblr> {

    PageDto<YyCblrSelect> getPage(PageDto pageDto, @Param("filter") YyCblrFilter filter, @Param("tf") Boolean tf, @Param("cwrq") String cwrq);

    PageDto<YyCblrSelect> lycbglfy(PageDto pageDto, @Param("filter") YyCblrFilter filter, @Param("tf") Boolean tf, @Param("cwrq") String cwrq);

    List<String> getCbkids(@Param("filter") YyCblrFilter filter);

    YyCblrView getViewById(@Param("yhbh") String yhbh, @Param("cbkh") String cbkh);

    List<YyCblrSelect> getList(@Param("filter") YyCblrFilter filter);

    List<CbSltjSelect> cbsltj(@Param("filter") YyCblrtjFilter filter);

    List<CbltjSelect> cbltj(@Param("filter") YyCblrtjFilter filter);

    PageDto<YyCblrSelect> getPage2(PageDto pageDto, @Param("filter") YyCblrFilter filter, @Param("tf") Boolean tf);

    /** 根据用户编号查询抄表记录 */
    List<YyCblrSelect> getCbjlByYhbhs(@Param("filter") QftjSeachFilter filter);

    List<YyCblrSelect> getListCbmx(@Param("filter") YyCblrFilter filter);


    Map getZfCblrMap(@Param("cbkid") String cbkid);

    Map getZmCblrMap(@Param("cbkid") String cbkid);


    YyStat stat(@Param("filter") YyQfmxStatFilter filter);

    @Select({
            "<script>",
            "SELECT count(*) as total",
            "FROM YY_CBLR_LS",
            "WHERE cbfs IN",
            "<foreach item='item' index='index' collection='val' open='(' separator=',' close=')'>",
            "#{item}",
            "</foreach>",
            "</script>"
    })
    int cblrlsCBFS(@Param("val") List<String> val);


    boolean YMJZSFSB();

    boolean yyCblrls();

    boolean updateCbb();

    List<Map> getZbFbs();

    List<YyCblrLs> plcxcblrmx(Page<YyCblrLs> page);

    List<YyCblrLs> cxcblrmx();

    /** 统计总抄表次数总水量 */
    ZcbcssltjDto zcbcszsltj(@Param("filter")QftjSeachFilter filter);

     CblrSflxMxSelect getCblrSl(@Param("filter") CblrSflxFilter filter);

    CblrSflxMxSelect getCblrSlLs(@Param("filter") CblrSflxFilter filter);

    List<CblrSflxMxSelect> retportSlfx(@Param("filter") CblrSflxFilter filter);


    PageDto<CblrSflxSelect> retportSlfxMx(PageDto pageDto, @Param("filter") CblrSflxFilter filter,@Param("lx") String lx,@Param("cwrq1") String cwrq1,@Param("cwrq2") String cwrq2);


    CblrSflxYhbhSelect  retportSlfxMxByYhbh(@Param("filter") CblrSflxFilter filter,@Param("tbName") String tbName);

    CblrCountSelect getCblrCount(@Param("filter")YyCblrFilter filter);
}
