package com.bonus.sgzb.material.service.impl;

import java.util.List;

import com.bonus.sgzb.material.domain.PlanBorrowInfo;
import com.bonus.sgzb.material.mapper.PlanBorrowInfoMapper;
import com.bonus.sgzb.material.service.IPlanBorrowInfoService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 年度借调plan_borrow_infoService业务层处理
 * 
 * @author bonus
 * @date 2023-12-10
 */
@Service
public class PlanBorrowInfoServiceImpl implements IPlanBorrowInfoService
{
    @Autowired
    private PlanBorrowInfoMapper planBorrowInfoMapper;

    /**
     * 查询年度借调plan_borrow_info
     * 
     * @param borrowId 年度借调plan_borrow_info主键
     * @return 年度借调plan_borrow_info
     */
    @Override
    public PlanBorrowInfo selectPlanBorrowInfoByBorrowId(Long borrowId)
    {
        return planBorrowInfoMapper.selectPlanBorrowInfoByBorrowId(borrowId);
    }

    /**
     * 查询年度借调plan_borrow_info列表
     * 
     * @param planBorrowInfo 年度借调plan_borrow_info
     * @return 年度借调plan_borrow_info
     */
    @Override
    public List<PlanBorrowInfo> selectPlanBorrowInfoList(PlanBorrowInfo planBorrowInfo)
    {
        return planBorrowInfoMapper.selectPlanBorrowInfoList(planBorrowInfo);
    }

    /**
     * 新增年度借调plan_borrow_info
     * 
     * @param planBorrowInfo 年度借调plan_borrow_info
     * @return 结果
     */
    @Override
    public int insertPlanBorrowInfo(PlanBorrowInfo planBorrowInfo)
    {
        planBorrowInfo.setCreateTime(DateUtils.getNowDate());
        return planBorrowInfoMapper.insertPlanBorrowInfo(planBorrowInfo);
    }

    /**
     * 修改年度借调plan_borrow_info
     * 
     * @param planBorrowInfo 年度借调plan_borrow_info
     * @return 结果
     */
    @Override
    public int updatePlanBorrowInfo(PlanBorrowInfo planBorrowInfo)
    {
        planBorrowInfo.setUpdateTime(DateUtils.getNowDate());
        return planBorrowInfoMapper.updatePlanBorrowInfo(planBorrowInfo);
    }

    /**
     * 批量删除年度借调plan_borrow_info
     * 
     * @param borrowIds 需要删除的年度借调plan_borrow_info主键
     * @return 结果
     */
    @Override
    public int deletePlanBorrowInfoByBorrowIds(Long[] borrowIds)
    {
        return planBorrowInfoMapper.deletePlanBorrowInfoByBorrowIds(borrowIds);
    }

    /**
     * 删除年度借调plan_borrow_info信息
     * 
     * @param borrowId 年度借调plan_borrow_info主键
     * @return 结果
     */
    @Override
    public int deletePlanBorrowInfoByBorrowId(Long borrowId)
    {
        return planBorrowInfoMapper.deletePlanBorrowInfoByBorrowId(borrowId);
    }
}
