package com.hdkj.lt.bf.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdkj.lt.base.exception.BusinessException;
import com.hdkj.lt.bf.mapper.FaultPowerCutPvUsersMapper;
import com.hdkj.lt.bf.service.IFaultPowerCutPvUsersService;
import com.hdkj.lt.core.bizms.modle.po.fault.FaultPowerCutPvUsers;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 故障停电光伏用户信息表 服务实现类
 * </p>
 *
 * @author luorui
 * @since 2025-05-29
 */
@Service
public class FaultPowerCutPvUsersServiceImpl extends ServiceImpl<FaultPowerCutPvUsersMapper, FaultPowerCutPvUsers> implements IFaultPowerCutPvUsersService {

    @Override
    public List<FaultPowerCutPvUsers> countByFaultId(List<Long> idList) {
        if (CollUtil.isEmpty(idList)) {
            throw new BusinessException("统计光伏用户数量faultIdList为空");
        }
        return baseMapper.countByPlanId(idList);
    }
}
