package com.ruoyi.ibs.list.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ibs.list.domain.OtherBankRate;
import com.ruoyi.ibs.list.mapper.OtherBankRateMapper;
import com.ruoyi.ibs.list.service.IOtherBankRateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import static com.ruoyi.common.utils.SecurityUtils.getUsername;
import static org.apache.commons.lang3.SystemUtils.getUserName;


/**
 * 个人视图他行征信利率Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-17
 */
@Service
public class OtherBankRateServiceImpl implements IOtherBankRateService
{
    @Autowired
    private OtherBankRateMapper otherBankRateMapper;

    /**
     * 查询个人视图他行征信利率
     * 
     * @param id 个人视图他行征信利率主键
     * @return 个人视图他行征信利率
     */
    @Override
    public OtherBankRate selectOtherBankRateById(Long id)
    {
        return otherBankRateMapper.selectOtherBankRateById(id);
    }

    /**
     * 查询个人视图他行征信利率列表
     * 
     * @param otherBankRate 个人视图他行征信利率
     * @return 个人视图他行征信利率
     */
    @Override
    public List<OtherBankRate> selectOtherBankRateList(OtherBankRate otherBankRate)
    {
        return otherBankRateMapper.selectOtherBankRateList(otherBankRate);
    }

    /**
     * 新增个人视图他行征信利率
     * 
     * @param otherBankRate 个人视图他行征信利率
     * @return 结果
     */
    @Override
    public int insertOtherBankRate(OtherBankRate otherBankRate)
    {
        otherBankRate.setCreateTime(DateUtils.getNowDate());
        otherBankRate.setCreateBy(getUsername());
        return otherBankRateMapper.insertOtherBankRate(otherBankRate);
    }

    /**
     * 修改个人视图他行征信利率
     * 
     * @param otherBankRate 个人视图他行征信利率
     * @return 结果
     */
    @Override
    public int updateOtherBankRate(OtherBankRate otherBankRate)
    {
        otherBankRate.setUpdateTime(DateUtils.getNowDate());
        return otherBankRateMapper.updateOtherBankRate(otherBankRate);
    }

    /**
     * 批量删除个人视图他行征信利率
     * 
     * @param ids 需要删除的个人视图他行征信利率主键
     * @return 结果
     */
    @Override
    public int deleteOtherBankRateByIds(Long[] ids)
    {
        return otherBankRateMapper.deleteOtherBankRateByIds(ids);
    }

    /**
     * 删除个人视图他行征信利率信息
     * 
     * @param id 个人视图他行征信利率主键
     * @return 结果
     */
    @Override
    public int deleteOtherBankRateById(Long id)
    {
        return otherBankRateMapper.deleteOtherBankRateById(id);
    }
}
