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


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nantian.cloud.dbcapp.carbon.domain.carbonDetection.*;
import com.nantian.cloud.dbcapp.carbon.domain.ent.InstrumentCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

/**
 * <p>
 *
 * </p>
 *
 * @author xuels
 * @since 2022/7/21
 */
@Mapper
public interface CarbonEnterpriseMapper extends BaseMapper<EnterpriseDataVo> {

    List<RegionEntGroupVO> entTree();

    /**
     * 查询企业基本信息接口
     *
     * @param enterpriseName
     * @return
     */
    Erprise selectEnterpriseVo(String enterpriseName);

    /**
     * 查询机组基本信息
     *
     * @param enterpriseName
     * @return
     */
    List<Machine> selectMachineVos(String enterpriseName);

    /**
     * 查询计量器具基本信息
     *
     * @param enterpriseName
     * @return
     */
    List<InstrumentInfoVo> getInstrumentInfo(String enterpriseName);

    /**
     * 查询数据统计基本数据信息
     *
     * @param enterpriseDataRequest
     * @return
     */
    List<EnterpriseDataVo> getBaseAccData(EnterpriseDataRequest enterpriseDataRequest);

    List<DayConsumeDetail> getMechInfo(@Param("dates") String dates,
                                       @Param("enterpriseName") String enterpriseName,
                                       @Param("mechNames") String mechNames);

    List<XY> getMechData(@Param("yearMonth") String yearMonth,
                         @Param("enterpriseName") String enterpriseName,
                         @Param("mechNames") String mechNames);

    List<String> machines(@Param("enterpriseName") String enterpriseName);

    List<Map> carbonMonthSource(@Param("enterpriseName") String enterpriseName,
                                @Param("yearMonth") String yearMonth,
                                @Param("mlist") List<String> mlist);

    List<Map> carbonYearSource(@Param("enterpriseName") String enterpriseName,
                               @Param("year") String year,
                               @Param("mlist") List<String> mlist);

    List<Map> distribute(@Param("enterpriseName") String enterpriseName,
                         @Param("year") String year,
                         @Param("mlist") List<String> mlist);

    List<DistrbuteOriginMonth> distributeDetail(@Param("enterpriseName") String enterpriseName,
                               @Param("machineName") String machineName,
                               @Param("year") String year,
                               @Param("month") Integer month);

    List<DistributeMonth> distributeTotal(@Param("enterpriseName") String enterpriseName, @Param("year") String year);
}
