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

import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.settlement.mapper.SltProjectMonthDetailMapper;
import com.bonus.material.settlement.domain.SltProjectMonthDetail;
import com.bonus.material.settlement.service.ISltProjectMonthDetailService;

/**
 * 月结算费用详情Service业务层处理
 * 
 * @author xsheng
 * @date 2024-10-16
 */
@Service
public class SltProjectMonthDetailServiceImpl implements ISltProjectMonthDetailService {
    @Autowired
    private SltProjectMonthDetailMapper sltProjectMonthDetailMapper;

    /**
     * 查询月结算费用详情
     * 
     * @param id 月结算费用详情主键
     * @return 月结算费用详情
     */
    @Override
    public SltProjectMonthDetail selectSltProjectMonthDetailById(Long id) {
        return sltProjectMonthDetailMapper.selectSltProjectMonthDetailById(id);
    }

    /**
     * 查询月结算费用详情列表
     * 
     * @param sltProjectMonthDetail 月结算费用详情
     * @return 月结算费用详情
     */
    @Override
    public List<SltProjectMonthDetail> selectSltProjectMonthDetailList(SltProjectMonthDetail sltProjectMonthDetail) {
        return sltProjectMonthDetailMapper.selectSltProjectMonthDetailList(sltProjectMonthDetail);
    }

    /**
     * 新增月结算费用详情
     * 
     * @param sltProjectMonthDetail 月结算费用详情
     * @return 结果
     */
    @Override
    public int insertSltProjectMonthDetail(SltProjectMonthDetail sltProjectMonthDetail) {
        sltProjectMonthDetail.setCreateTime(DateUtils.getNowDate());
        try {
            return sltProjectMonthDetailMapper.insertSltProjectMonthDetail(sltProjectMonthDetail);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 修改月结算费用详情
     * 
     * @param sltProjectMonthDetail 月结算费用详情
     * @return 结果
     */
    @Override
    public int updateSltProjectMonthDetail(SltProjectMonthDetail sltProjectMonthDetail) {
        sltProjectMonthDetail.setUpdateTime(DateUtils.getNowDate());
        try {
            return sltProjectMonthDetailMapper.updateSltProjectMonthDetail(sltProjectMonthDetail);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 批量删除月结算费用详情
     * 
     * @param ids 需要删除的月结算费用详情主键
     * @return 结果
     */
    @Override
    public int deleteSltProjectMonthDetailByIds(Long[] ids) {
        return sltProjectMonthDetailMapper.deleteSltProjectMonthDetailByIds(ids);
    }

    /**
     * 删除月结算费用详情信息
     * 
     * @param id 月结算费用详情主键
     * @return 结果
     */
    @Override
    public int deleteSltProjectMonthDetailById(Long id) {
        return sltProjectMonthDetailMapper.deleteSltProjectMonthDetailById(id);
    }
}
