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

import java.util.List;

import com.bonus.sgzb.material.domain.PlanNeedInfo;
import com.bonus.sgzb.material.mapper.PlanNeedInfoMapper;
import com.bonus.sgzb.material.service.IPlanNeedInfoService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 年度计划plan_need_infoService业务层处理
 * 
 * @author bonus
 * @date 2023-12-10
 */
@Service
public class PlanNeedInfoServiceImpl implements IPlanNeedInfoService
{
    @Autowired
    private PlanNeedInfoMapper planNeedInfoMapper;

    /**
     * 查询年度计划plan_need_info
     * 
     * @param planId 年度计划plan_need_info主键
     * @return 年度计划plan_need_info
     */
    @Override
    public PlanNeedInfo selectPlanNeedInfoByPlanId(Long planId)
    {
        return planNeedInfoMapper.selectPlanNeedInfoByPlanId(planId);
    }

    /**
     * 查询年度计划plan_need_info列表
     * 
     * @param planNeedInfo 年度计划plan_need_info
     * @return 年度计划plan_need_info
     */
    @Override
    public List<PlanNeedInfo> selectPlanNeedInfoList(PlanNeedInfo planNeedInfo)
    {
        return planNeedInfoMapper.selectPlanNeedInfoList(planNeedInfo);
    }

    /**
     * 新增年度计划plan_need_info
     * 
     * @param planNeedInfo 年度计划plan_need_info
     * @return 结果
     */
    @Override
    public int insertPlanNeedInfo(PlanNeedInfo planNeedInfo)
    {
        planNeedInfo.setCreateTime(DateUtils.getNowDate());
        return planNeedInfoMapper.insertPlanNeedInfo(planNeedInfo);
    }

    /**
     * 修改年度计划plan_need_info
     * 
     * @param planNeedInfo 年度计划plan_need_info
     * @return 结果
     */
    @Override
    public int updatePlanNeedInfo(PlanNeedInfo planNeedInfo)
    {
        planNeedInfo.setUpdateTime(DateUtils.getNowDate());
        return planNeedInfoMapper.updatePlanNeedInfo(planNeedInfo);
    }

    /**
     * 批量删除年度计划plan_need_info
     * 
     * @param planIds 需要删除的年度计划plan_need_info主键
     * @return 结果
     */
    @Override
    public int deletePlanNeedInfoByPlanIds(Long[] planIds)
    {
        return planNeedInfoMapper.deletePlanNeedInfoByPlanIds(planIds);
    }

    /**
     * 删除年度计划plan_need_info信息
     * 
     * @param planId 年度计划plan_need_info主键
     * @return 结果
     */
    @Override
    public int deletePlanNeedInfoByPlanId(Long planId)
    {
        return planNeedInfoMapper.deletePlanNeedInfoByPlanId(planId);
    }
}
