package com.ruoyi.baseinfo.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.baseinfo.mapper.BasePlanInfoMapper;
import com.ruoyi.baseinfo.domain.BasePlanInfo;
import com.ruoyi.baseinfo.service.IBasePlanInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 计划信息Service业务层处理
 * 
 * @author CaesarBao
 * @date 2020-10-23
 */
@Service
public class BasePlanInfoServiceImpl implements IBasePlanInfoService 
{
    @Autowired
    private BasePlanInfoMapper basePlanInfoMapper;

    /**
     * 查询计划信息
     * 
     * @param planid 计划信息ID
     * @return 计划信息
     */
    @Override
    public BasePlanInfo selectBasePlanInfoById(String planid)
    {
        return basePlanInfoMapper.selectBasePlanInfoById(planid);
    }

    /**
     * 查询计划信息列表
     * 
     * @param basePlanInfo 计划信息
     * @return 计划信息
     */
    @Override
    public List<BasePlanInfo> selectBasePlanInfoList(BasePlanInfo basePlanInfo)
    {
        return basePlanInfoMapper.selectBasePlanInfoList(basePlanInfo);
    }

    /**
     * 新增计划信息
     * 
     * @param basePlanInfo 计划信息
     * @return 结果
     */
    @Override
    public int insertBasePlanInfo(BasePlanInfo basePlanInfo)
    {
        basePlanInfo.setCreateTime(DateUtils.getNowDate());
        return basePlanInfoMapper.insertBasePlanInfo(basePlanInfo);
    }

    /**
     * 修改计划信息
     * 
     * @param basePlanInfo 计划信息
     * @return 结果
     */
    @Override
    public int updateBasePlanInfo(BasePlanInfo basePlanInfo)
    {
        basePlanInfo.setUpdateTime(DateUtils.getNowDate());
        return basePlanInfoMapper.updateBasePlanInfo(basePlanInfo);
    }

    /**
     * 删除计划信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBasePlanInfoByIds(String ids)
    {
        return basePlanInfoMapper.deleteBasePlanInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除计划信息信息
     * 
     * @param planid 计划信息ID
     * @return 结果
     */
    @Override
    public int deleteBasePlanInfoById(String planid)
    {
        return basePlanInfoMapper.deleteBasePlanInfoById(planid);
    }
}
