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.FhzgPlanPowerCutPvUsersMapper;
import com.hdkj.lt.bf.service.FhzgPlanPowerCutPvUsersService;
import com.hdkj.lt.core.bizms.modle.po.plan.FhzgPlanPowerCutPvUsers;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 计划停电光伏用户信息表 服务实现类
 * </p>
 *
 * @author luorui
 * @since 2025-05-20
 */
@Service
@Slf4j
public class FhzgPlanPowerCutPvUsersServiceImpl extends ServiceImpl<FhzgPlanPowerCutPvUsersMapper, FhzgPlanPowerCutPvUsers> implements FhzgPlanPowerCutPvUsersService {

    /**
     *
     * @author luorui
     * @date 2025/5/20 16:16
     * @discription 根据计划id统计光伏用户数量
     *
     **/
    @Override
    public List<FhzgPlanPowerCutPvUsers> countByPlanId(List<Long> planIdList) {
        if (CollUtil.isEmpty(planIdList)) {
            throw new BusinessException("统计光伏用户数量planIdList为空");
        }
        return baseMapper.countByPlanId(planIdList);
    }
}
