package cn.iocoder.yudao.module.contract.service.impl;

import cn.iocoder.yudao.util.DateUtils;
import cn.iocoder.yudao.module.contract.entity.ContractManagement;
import cn.iocoder.yudao.module.contract.mapper.ContractManagementMapper;
import cn.iocoder.yudao.module.contract.service.IContractManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 合同管理Service业务层处理
 *
 * @author ruoyi
 * @date 2023-07-19
 */
@Service
public class ContractManagementServiceImpl implements IContractManagementService
{
    @Autowired
    private ContractManagementMapper contractManagementMapper;

    /**
     * 查询合同管理
     *
     * @param id 合同管理主键
     * @return 合同管理
     */
    @Override
    public ContractManagement selectContractManagementById(Long id)
    {
        return contractManagementMapper.selectContractManagementById(id);
    }

    /**
     * 查询合同管理列表
     *
     * @param contractManagement 合同管理
     * @return 合同管理
     */
    @Override
    public List<ContractManagement> selectContractManagementList(ContractManagement contractManagement)
    {
        return contractManagementMapper.selectContractManagementList(contractManagement);
    }

    /**
     * 新增合同管理
     *
     * @param contractManagement 合同管理
     * @return 结果
     */
    @Override
    public int insertContractManagement(ContractManagement contractManagement)
    {
        return contractManagementMapper.insertContractManagement(contractManagement);
    }

    /**
     * 修改合同管理
     *
     * @param contractManagement 合同管理
     * @return 结果
     */
    @Override
    public int updateContractManagement(ContractManagement contractManagement)
    {
        contractManagement.setUpdateTime(DateUtils.getNowDate());
        return contractManagementMapper.updateContractManagement(contractManagement);
    }

    /**
     * 批量删除合同管理
     *
     * @param ids 需要删除的合同管理主键
     * @return 结果
     */
    @Override
    public int deleteContractManagementByIds(Long[] ids)
    {
        return contractManagementMapper.deleteContractManagementByIds(ids);
    }

    /**
     * 删除合同管理信息
     *
     * @param id 合同管理主键
     * @return 结果
     */
    @Override
    public int deleteContractManagementById(Long id)
    {
        return contractManagementMapper.deleteContractManagementById(id);
    }
}
