package com.ho.business.mapper;


import com.ho.business.entity.ElecMeterValue;
import com.ho.business.vo.req.bigScreen.CommonBigScreenReq;
import com.ho.business.vo.req.carbin.ElecMeterReq;
import com.ho.business.vo.resp.profit.DayProfitType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author yule
 * @description 针对表【elec_meter_value】的数据库操作Mapper
 * @createDate 2022-11-01 18:38:19
 * @Entity com.ho.business.entity.ElecMeterValue
 */
@Mapper
public interface ElecMeterValueMapper {

    int deleteByPrimaryKey(Long id);

    int insert(ElecMeterValue record);

    int insertSelective(ElecMeterValue record);

    ElecMeterValue selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ElecMeterValue record);

    int updateByPrimaryKey(ElecMeterValue record);

    BigDecimal selectSumByType(@Param("stationId") Integer stationId, @Param("type") Integer type, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("srcId") Integer srcId);

    List<ElecMeterValue> selectListByStationAndSrcId(ElecMeterReq elecMeterReq);

    int deleteByDay(@Param("day") String day, @Param("typeList") List<Integer> typeList);

    int deleteByStationAndDay(@Param("stationId") Integer stationId, @Param("day") String day, @Param("typeList") List<Integer> typeList);

    int insertBatch(List<ElecMeterValue> list);

    // 类型是传入多个
    List<ElecMeterValue> selectList(@Param("stationId") Integer stationId, @Param("typeList") List<Integer> typeList, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    BigDecimal selectSumValue(@Param("stationId") Integer stationId, @Param("type") Integer type, @Param("srcId") Integer srcId);

    List<ElecMeterValue> selectListByStationIds(@Param("stationIds") List<Integer> stationIds, @Param("type") Integer type, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<ElecMeterValue> selectByStationIdsAndTime(@Param("stationIds") List<Integer> stationIds, @Param("beginTime") String beginTime, @Param("endTime") String endTime,@Param("srcId") Integer srcId);

    List<ElecMeterValue> selectGroupByDay(CommonBigScreenReq req);

    List<ElecMeterValue> selectAllList(@Param("stationId") Integer stationId, @Param("typeList") List<Integer> typeList, @Param("beginTime") String beginTime, @Param("endTime") String endTime,
                                       @Param("deviceTypeList") List<Integer> deviceTypeList);

    List<DayProfitType> getElec(@Param("beginTime") String beginTime,@Param("endTime")String endTime,
                                @Param("groupId") Integer groupId, @Param("type")Integer type,List<Integer> stationIds);
}
