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

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdkj.lt.base.exception.BusinessException;
import com.hdkj.lt.bf.entity.dto.FhzgLimitTransferSchemeFinalSwitchCurrentDetailDTO;
import com.hdkj.lt.bf.mapper.FhzgLimitTransferSchemeSwitchingFinalSwCurrentDetailMapper;
import com.hdkj.lt.bf.service.voltageLimitViolation.FhzgLimitTransferSchemeSwitchingFinalSwCurrentDetailService;
import com.hdkj.lt.core.bizms.modle.po.voltageLimitViolation.FhzgLimitTransferSchemeSwitchingFinalSwCurrentDetail;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
* @author userlrk
* @description 针对表【fhzg_limit_transfer_scheme_switching_final_sw_current_detail(成片电压越限转供方案开关动作终态检验开关电流明细信息表)】的数据库操作Service实现
* @createDate 2025-09-24 15:24:11
*/
@Service
public class FhzgLimitTransferSchemeSwitchingFinalSwCurrentDetailServiceImpl extends ServiceImpl<FhzgLimitTransferSchemeSwitchingFinalSwCurrentDetailMapper, FhzgLimitTransferSchemeSwitchingFinalSwCurrentDetail>
    implements FhzgLimitTransferSchemeSwitchingFinalSwCurrentDetailService {

    @Override
    public Page<FhzgLimitTransferSchemeFinalSwitchCurrentDetailDTO> getTransferSchemeFinalSwitchCurrentDetailByIdPage(FhzgLimitTransferSchemeSwitchingFinalSwCurrentDetail limitTransferSchemeSwitchingFinalSwCurrentDetail) {
        if (Objects.isNull(limitTransferSchemeSwitchingFinalSwCurrentDetail.getSwitchingId())) {
            throw new BusinessException("switchingId为空");
        }
        if (Objects.isNull(limitTransferSchemeSwitchingFinalSwCurrentDetail.getPageNum())) {
            throw new BusinessException("分页页码为空");
        }
        if (Objects.isNull(limitTransferSchemeSwitchingFinalSwCurrentDetail.getPageSize())) {
            throw new BusinessException("分页长度为空");
        }
        Page page = new Page(limitTransferSchemeSwitchingFinalSwCurrentDetail.getPageNum(), limitTransferSchemeSwitchingFinalSwCurrentDetail.getPageSize());
        return (Page<FhzgLimitTransferSchemeFinalSwitchCurrentDetailDTO>) this.baseMapper.getTransferSchemeFinalSwitchCurrentDetailByIdPage(page,limitTransferSchemeSwitchingFinalSwCurrentDetail.getSwitchingId());
    }
}




