package com.ruoyi.cs.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cs.mapper.CsResourceChargingMapper;
import com.ruoyi.cs.domain.CsResourceCharging;
import com.ruoyi.cs.service.ICsResourceChargingService;

import javax.annotation.Resource;

/**
 * 资源计费说明Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-07
 */
@Service
public class CsResourceChargingServiceImpl implements ICsResourceChargingService
{
    @Resource
    private CsResourceChargingMapper csResourceChargingMapper;

    /**
     * 查询资源计费说明
     *
     * @param resourceChargingId 资源计费说明主键
     * @return 资源计费说明
     */
    @Override
    public CsResourceCharging selectCsResourceChargingByResourceChargingId(String resourceChargingId)
    {
        return csResourceChargingMapper.selectCsResourceChargingByResourceChargingId(resourceChargingId);
    }

    /**
     * 查询资源计费说明列表
     *
     * @param csResourceCharging 资源计费说明
     * @return 资源计费说明
     */
    @Override
    public List<CsResourceCharging> selectCsResourceChargingList(CsResourceCharging csResourceCharging)
    {
        return csResourceChargingMapper.selectCsResourceChargingList(csResourceCharging);
    }

    /**
     * 新增资源计费说明
     *
     * @param csResourceCharging 资源计费说明
     * @return 结果
     */
    @Override
    public int insertCsResourceCharging(CsResourceCharging csResourceCharging)
    {
        csResourceCharging.setCreateAt(DateUtils.getNowDate());
        csResourceCharging.setDelFlag("0");
        return csResourceChargingMapper.insertCsResourceCharging(csResourceCharging);
    }

    /**
     * 修改资源计费说明
     *
     * @param csResourceCharging 资源计费说明
     * @return 结果
     */
    @Override
    public int updateCsResourceCharging(CsResourceCharging csResourceCharging)
    {
        csResourceCharging.setUpdateAt(DateUtils.getNowDate());
        return csResourceChargingMapper.updateCsResourceCharging(csResourceCharging);
    }

    /**
     * 批量删除资源计费说明
     *
     * @param resourceChargingIds 需要删除的资源计费说明主键
     * @return 结果
     */
    @Override
    public int deleteCsResourceChargingByResourceChargingIds(String[] resourceChargingIds)
    {
        return csResourceChargingMapper.deleteCsResourceChargingByResourceChargingIds(resourceChargingIds);
    }

    /**
     * 删除资源计费说明信息
     *
     * @param resourceChargingId 资源计费说明主键
     * @return 结果
     */
    @Override
    public int deleteCsResourceChargingByResourceChargingId(String resourceChargingId)
    {
        return csResourceChargingMapper.deleteCsResourceChargingByResourceChargingId(resourceChargingId);
    }
}
