package com.srs.comprehensive.service.impl;

import java.util.List;

import com.srs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.srs.comprehensive.mapper.CphGoodCancelLogMapper;
import com.srs.comprehensive.domain.CphGoodCancelLog;
import com.srs.comprehensive.service.ICphGoodCancelLogService;

/**
 * 取消申请记录Service业务层处理
 *
 * @author srs
 * @date 2023-11-07
 */
@Service
public class CphGoodCancelLogServiceImpl extends ServiceImpl<CphGoodCancelLogMapper,CphGoodCancelLog> implements ICphGoodCancelLogService {
    @Autowired
    private CphGoodCancelLogMapper cphGoodCancelLogMapper;

    /**
     * 查询取消申请记录
     *
     * @param id 取消申请记录主键
     * @return 取消申请记录
     */
    @Override
    public CphGoodCancelLog selectCphGoodCancelLogById(Long id) {
        return cphGoodCancelLogMapper.selectCphGoodCancelLogById(id);
    }

    /**
     * 查询取消申请记录列表
     *
     * @param cphGoodCancelLog 取消申请记录
     * @return 取消申请记录
     */
    @Override
    public List<CphGoodCancelLog> selectCphGoodCancelLogList(CphGoodCancelLog cphGoodCancelLog) {
        return cphGoodCancelLogMapper.selectCphGoodCancelLogList(cphGoodCancelLog);
    }

    /**
     * 新增取消申请记录
     *
     * @param cphGoodCancelLog 取消申请记录
     * @return 结果
     */
    @Override
    public int insertCphGoodCancelLog(CphGoodCancelLog cphGoodCancelLog) {
                cphGoodCancelLog.setCreateTime(DateUtils.getNowDate());
            return cphGoodCancelLogMapper.insertCphGoodCancelLog(cphGoodCancelLog);
    }

    /**
     * 修改取消申请记录
     *
     * @param cphGoodCancelLog 取消申请记录
     * @return 结果
     */
    @Override
    public int updateCphGoodCancelLog(CphGoodCancelLog cphGoodCancelLog) {
                cphGoodCancelLog.setUpdateTime(DateUtils.getNowDate());
        return cphGoodCancelLogMapper.updateCphGoodCancelLog(cphGoodCancelLog);
    }

    /**
     * 批量删除取消申请记录
     *
     * @param ids 需要删除的取消申请记录主键
     * @return 结果
     */
    @Override
    public int deleteCphGoodCancelLogByIds(Long[] ids) {
        return cphGoodCancelLogMapper.deleteCphGoodCancelLogByIds(ids);
    }

    /**
     * 删除取消申请记录信息
     *
     * @param id 取消申请记录主键
     * @return 结果
     */
    @Override
    public int deleteCphGoodCancelLogById(Long id) {
        return cphGoodCancelLogMapper.deleteCphGoodCancelLogById(id);
    }
}
