package com.ruoyi.zongzhi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zongzhi.mapper.TcDengbaoUnitMapper;
import com.ruoyi.zongzhi.domain.TcDengbaoUnit;
import com.ruoyi.zongzhi.service.ITcDengbaoUnitService;

/**
 * 等保单位Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-10
 */
@Service
public class TcDengbaoUnitServiceImpl implements ITcDengbaoUnitService 
{
    @Autowired
    private TcDengbaoUnitMapper tcDengbaoUnitMapper;

    /**
     * 查询等保单位
     * 
     * @param id 等保单位主键
     * @return 等保单位
     */
    @Override
    public TcDengbaoUnit selectTcDengbaoUnitById(Long id)
    {
        return tcDengbaoUnitMapper.selectTcDengbaoUnitById(id);
    }

    /**
     * 查询等保单位列表
     * 
     * @param tcDengbaoUnit 等保单位
     * @return 等保单位
     */
    @Override
    public List<TcDengbaoUnit> selectTcDengbaoUnitList(TcDengbaoUnit tcDengbaoUnit)
    {
        return tcDengbaoUnitMapper.selectTcDengbaoUnitList(tcDengbaoUnit);
    }

    /**
     * 新增等保单位
     * 
     * @param tcDengbaoUnit 等保单位
     * @return 结果
     */
    @Override
    public int insertTcDengbaoUnit(TcDengbaoUnit tcDengbaoUnit)
    {
        tcDengbaoUnit.setCreateTime(DateUtils.getNowDate());
        return tcDengbaoUnitMapper.insertTcDengbaoUnit(tcDengbaoUnit);
    }

    /**
     * 修改等保单位
     * 
     * @param tcDengbaoUnit 等保单位
     * @return 结果
     */
    @Override
    public int updateTcDengbaoUnit(TcDengbaoUnit tcDengbaoUnit)
    {
        tcDengbaoUnit.setUpdateTime(DateUtils.getNowDate());
        return tcDengbaoUnitMapper.updateTcDengbaoUnit(tcDengbaoUnit);
    }

    /**
     * 批量删除等保单位
     * 
     * @param ids 需要删除的等保单位主键
     * @return 结果
     */
    @Override
    public int deleteTcDengbaoUnitByIds(Long[] ids)
    {
        return tcDengbaoUnitMapper.deleteTcDengbaoUnitByIds(ids);
    }

    /**
     * 删除等保单位信息
     * 
     * @param id 等保单位主键
     * @return 结果
     */
    @Override
    public int deleteTcDengbaoUnitById(Long id)
    {
        return tcDengbaoUnitMapper.deleteTcDengbaoUnitById(id);
    }
}
