package com.ruoyi.system.service.guarantee.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.guarantee.GuaranteeInfo;
import com.ruoyi.system.service.guarantee.IGuaranteeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GuaranteeInfoMapper;

/**
 * 反担保基础信息Service业务层处理
 * 
 * @author boman
 * @date 2024-08-01
 */
@Service
public class GuaranteeInfoServiceImpl implements IGuaranteeInfoService
{
    @Autowired
    private GuaranteeInfoMapper guaranteeInfoMapper;

    /**
     * 查询反担保基础信息
     * 
     * @param guaranteeInfoId 反担保基础信息主键
     * @return 反担保基础信息
     */
    @Override
    public GuaranteeInfo selectGuaranteeInfoByGuaranteeInfoId(Long guaranteeInfoId)
    {
        return guaranteeInfoMapper.selectGuaranteeInfoByGuaranteeInfoId(guaranteeInfoId);
    }

    /**
     * 查询反担保基础信息列表
     * 
     * @param guaranteeInfo 反担保基础信息
     * @return 反担保基础信息
     */
    @Override
    public List<GuaranteeInfo> selectGuaranteeInfoList(GuaranteeInfo guaranteeInfo)
    {
        return guaranteeInfoMapper.selectGuaranteeInfoList(guaranteeInfo);
    }

    /**
     * 新增反担保基础信息
     * 
     * @param guaranteeInfo 反担保基础信息
     * @return 结果
     */
    @Override
    public int insertGuaranteeInfo(GuaranteeInfo guaranteeInfo)
    {
        guaranteeInfo.setCreateTime(DateUtils.getNowDate());
        return guaranteeInfoMapper.insertGuaranteeInfo(guaranteeInfo);
    }

    /**
     * 修改反担保基础信息
     * 
     * @param guaranteeInfo 反担保基础信息
     * @return 结果
     */
    @Override
    public int updateGuaranteeInfo(GuaranteeInfo guaranteeInfo)
    {
        guaranteeInfo.setUpdateTime(DateUtils.getNowDate());
        return guaranteeInfoMapper.updateGuaranteeInfo(guaranteeInfo);
    }

    /**
     * 批量删除反担保基础信息
     * 
     * @param guaranteeInfoIds 需要删除的反担保基础信息主键
     * @return 结果
     */
    @Override
    public int deleteGuaranteeInfoByGuaranteeInfoIds(Long[] guaranteeInfoIds)
    {
        return guaranteeInfoMapper.deleteGuaranteeInfoByGuaranteeInfoIds(guaranteeInfoIds);
    }

    /**
     * 删除反担保基础信息信息
     * 
     * @param guaranteeInfoId 反担保基础信息主键
     * @return 结果
     */
    @Override
    public int deleteGuaranteeInfoByGuaranteeInfoId(Long guaranteeInfoId)
    {
        return guaranteeInfoMapper.deleteGuaranteeInfoByGuaranteeInfoId(guaranteeInfoId);
    }
}
