package com.bonus.material.settlement.service.impl;

import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.settlement.mapper.SltAgreementDetailsMapper;
import com.bonus.material.settlement.domain.SltAgreementDetails;
import com.bonus.material.settlement.service.ISltAgreementDetailsService;

/**
 * 结算协议详情Service业务层处理
 * 
 * @author xsheng
 * @date 2024-10-16
 */
@Service
public class SltAgreementDetailsServiceImpl implements ISltAgreementDetailsService {
    @Autowired
    private SltAgreementDetailsMapper sltAgreementDetailsMapper;

    /**
     * 查询结算协议详情
     * 
     * @param id 结算协议详情主键
     * @return 结算协议详情
     */
    @Override
    public SltAgreementDetails selectSltAgreementDetailsById(Long id) {
        return sltAgreementDetailsMapper.selectSltAgreementDetailsById(id);
    }

    /**
     * 查询结算协议详情列表
     * 
     * @param sltAgreementDetails 结算协议详情
     * @return 结算协议详情
     */
    @Override
    public List<SltAgreementDetails> selectSltAgreementDetailsList(SltAgreementDetails sltAgreementDetails) {
        return sltAgreementDetailsMapper.selectSltAgreementDetailsList(sltAgreementDetails);
    }

    /**
     * 新增结算协议详情
     * 
     * @param sltAgreementDetails 结算协议详情
     * @return 结果
     */
    @Override
    public int insertSltAgreementDetails(SltAgreementDetails sltAgreementDetails) {
        try {
            return sltAgreementDetailsMapper.insertSltAgreementDetails(sltAgreementDetails);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 修改结算协议详情
     * 
     * @param sltAgreementDetails 结算协议详情
     * @return 结果
     */
    @Override
    public int updateSltAgreementDetails(SltAgreementDetails sltAgreementDetails) {
        try {
            return sltAgreementDetailsMapper.updateSltAgreementDetails(sltAgreementDetails);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 批量删除结算协议详情
     * 
     * @param ids 需要删除的结算协议详情主键
     * @return 结果
     */
    @Override
    public int deleteSltAgreementDetailsByIds(Long[] ids) {
        return sltAgreementDetailsMapper.deleteSltAgreementDetailsByIds(ids);
    }

    /**
     * 删除结算协议详情信息
     * 
     * @param id 结算协议详情主键
     * @return 结果
     */
    @Override
    public int deleteSltAgreementDetailsById(Long id) {
        return sltAgreementDetailsMapper.deleteSltAgreementDetailsById(id);
    }
}
