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.BaseGroupInfoMapper;
import com.ruoyi.baseinfo.domain.BaseGroupInfo;
import com.ruoyi.baseinfo.service.IBaseGroupInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 班组基础信息Service业务层处理
 * 
 * @author CaesarBao
 * @date 2020-10-20
 */
@Service
public class BaseGroupInfoServiceImpl implements IBaseGroupInfoService 
{
    @Autowired
    private BaseGroupInfoMapper baseGroupInfoMapper;

    /**
     * 查询班组基础信息
     * 
     * @param objid 班组基础信息ID
     * @return 班组基础信息
     */
    @Override
    public BaseGroupInfo selectBaseGroupInfoById(Long objid)
    {
        return baseGroupInfoMapper.selectBaseGroupInfoById(objid);
    }

    /**
     * 查询班组基础信息列表
     * 
     * @param baseGroupInfo 班组基础信息
     * @return 班组基础信息
     */
    @Override
    public List<BaseGroupInfo> selectBaseGroupInfoList(BaseGroupInfo baseGroupInfo)
    {
        return baseGroupInfoMapper.selectBaseGroupInfoList(baseGroupInfo);
    }

    /**
     * 新增班组基础信息
     * 
     * @param baseGroupInfo 班组基础信息
     * @return 结果
     */
    @Override
    public int insertBaseGroupInfo(BaseGroupInfo baseGroupInfo)
    {
        baseGroupInfo.setCreateTime(DateUtils.getNowDate());
        return baseGroupInfoMapper.insertBaseGroupInfo(baseGroupInfo);
    }

    /**
     * 修改班组基础信息
     * 
     * @param baseGroupInfo 班组基础信息
     * @return 结果
     */
    @Override
    public int updateBaseGroupInfo(BaseGroupInfo baseGroupInfo)
    {
        baseGroupInfo.setUpdateTime(DateUtils.getNowDate());
        return baseGroupInfoMapper.updateBaseGroupInfo(baseGroupInfo);
    }

    /**
     * 删除班组基础信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBaseGroupInfoByIds(String ids)
    {
        return baseGroupInfoMapper.deleteBaseGroupInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除班组基础信息信息
     * 
     * @param objid 班组基础信息ID
     * @return 结果
     */
    @Override
    public int deleteBaseGroupInfoById(Long objid)
    {
        return baseGroupInfoMapper.deleteBaseGroupInfoById(objid);
    }
}
