package com.nantian.cloud.dbcapp.mapper.jly;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nantian.cloud.dbcapp.entity.ConfigureDataCollect;
import com.nantian.cloud.dbcapp.entity.ConfigureGaugeRelevance;
import com.nantian.cloud.dbcapp.vo.ConfigureGaugeVo;
import com.nantian.cloud.dbcapp.vo.MapVo;
import com.nantian.cloud.dbcapp.vo.RelevanceStateVo;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper
public interface ConfigureGaugeRelevanceMapper extends BaseMapper<ConfigureGaugeRelevance> {

    IPage<ConfigureGaugeVo> listState(Page page, @Param("epc") String epc, @Param("dataCode") String dataCode, @Param("type") String type);

    IPage<ConfigureGaugeRelevance> getList(Page page, @Param("epc") String epc, @Param("dataCode") String dataCode, @Param("auditStatus") String auditStatus);

    IPage<ConfigureGaugeVo> getGaugeByRelevance(Page page, @Param("epc") String epc, @Param("dataCode") String dataCode);

    IPage<ConfigureDataCollect> getConfigByRelevance(Page page, @Param("gaugeId") Long gaugeId);

    boolean updateDelete(@Param("ids") List<Long> ids);

    List<RelevanceStateVo> relevanceState(@Param("epc") String epc);

    void updateDeleteByEpcAndDataCode(@Param("epc") String epc, @Param("dataCode") String dataCode);

    IPage<ConfigureGaugeRelevance> listGroupByEpcAndDataCode(Page page, @Param("epc") String epc, @Param("dataCode") String dataCode, @Param("auditStatus") String auditStatus);

    boolean auditGroup(@Param("epc")String epc, @Param("dataCode") String dataCode, @Param("auditStatus") String auditStatus, @Param("auditRemark") String auditRemark, @Param("username") String username);

    int autoMatchRelevance();

    List<Long> getGaugeIds(@Param("epc") String enterpriseCode, @Param("dataCode") String dataCode);

    boolean updateMeterLevel(@Param("gaugeIds") List<Long> gaugeIds, @Param("dataCode") String dataCode, @Param("meterLevel") String meterLevel);

    void recoverGauges(@Param("enterpriseCode") String enterpriseCode, @Param("dataCode") String dataCode);

    List<MapVo> getIdAndNewDataCodeMap(@Param("enterpriseCode") String enterpriseCode, @Param("dataCode") String dataCode);

    void recoverGaugesLevel(@Param("list") List<MapVo> mapVos);
}
