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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.util.DateUtils;
import cn.iocoder.yudao.module.contract.entity.InspectionContract;
import cn.iocoder.yudao.module.contract.mapper.ContractHistoryMapper;
import cn.iocoder.yudao.module.contract.mapper.InspectionContractMapper;
import cn.iocoder.yudao.module.contract.service.IInspectionContractService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * inspectionContractService业务层处理
 *
 * @author ruoyi
 * @date 2023-08-31
 */
@Service
public class InspectionContractServiceImpl extends ServiceImpl<InspectionContractMapper,InspectionContract> implements IInspectionContractService
{
    @Resource
    private ContractHistoryMapper contractHistoryMapper;

    /**
     * 查询inspectionContract
     *
     * @param id inspectionContract主键
     * @return inspectionContract
     */
    @Override
    public InspectionContract selectInspectionContractById(Long id)
    {
        return baseMapper.selectInspectionContractById(id);
    }

    /**
     * 查询inspectionContract列表
     *
     * @param inspectionContract inspectionContract
     * @return inspectionContract
     */
    @Override
    public IPage<InspectionContract> selectInspectionContractList(Page<InspectionContract> page, InspectionContract inspectionContract)
    {
        return baseMapper.selectInspectionContractList(page,inspectionContract);
    }

    /**
     * 新增inspectionContract
     *
     * @param inspectionContract inspectionContract
     * @return 结果
     */
    @Override
    public int insertInspectionContract(InspectionContract inspectionContract)
    {
        return baseMapper.insertInspectionContract(inspectionContract);
    }

    /**
     * 修改inspectionContract
     *
     * @param inspectionContract inspectionContract
     * @return 结果
     */
    @Override
    public int updateInspectionContract(InspectionContract inspectionContract)
    {
        inspectionContract.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateInspectionContract(inspectionContract);
    }

    /**
     * 批量删除inspectionContract
     *
     * @param ids 需要删除的inspectionContract主键
     * @return 结果
     */
    @Override
    public int deleteInspectionContractByIds(Long[] ids)
    {
        return baseMapper.deleteInspectionContractByIds(ids);
    }

    /**
     * 删除inspectionContract信息
     *
     * @param id inspectionContract主键
     * @return 结果
     */
    @Override
    public int deleteInspectionContractById(Long id)
    {
        return baseMapper.deleteInspectionContractById(id);
    }

    @Override
    public IPage<InspectionContract> partnerGetWtList(Page<InspectionContract> page,InspectionContract inspectionContract) {
        return contractHistoryMapper.partnerGetWtList(page,inspectionContract);
    }



}
