package com.ktg.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ktg.common.utils.DateUtils;
import com.ktg.system.domain.SysTeam;
import com.ktg.system.mapper.SysTeamMapper;
import com.ktg.system.service.ISysTeamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 小组Service业务层处理
 *
 * @author cc
 * @date 2024-09-12
 */
@Service
public class SysTeamServiceImpl extends ServiceImpl<SysTeamMapper, SysTeam> implements ISysTeamService
{
    @Autowired
    private SysTeamMapper sysTeamMapper;

    /**
     * 查询小组
     *
     * @param id 小组主键
     * @return 小组
     */
    @Override
    public SysTeam selectSysTeamById(Long id)
    {
        return sysTeamMapper.selectSysTeamById(id);
    }

    /**
     * 查询小组列表
     *
     * @param sysTeam 小组
     * @return 小组
     */
    @Override
    public List<SysTeam> selectSysTeamList(SysTeam sysTeam)
    {
        return sysTeamMapper.selectSysTeamList(sysTeam);
    }

    /**
     * 新增小组
     *
     * @param sysTeam 小组
     * @return 结果
     */
    @Override
    public int insertSysTeam(SysTeam sysTeam)
    {
        sysTeam.setCreateTime(DateUtils.getNowDate());
        return sysTeamMapper.insertSysTeam(sysTeam);
    }

    /**
     * 修改小组
     *
     * @param sysTeam 小组
     * @return 结果
     */
    @Override
    public int updateSysTeam(SysTeam sysTeam)
    {
        sysTeam.setUpdateTime(DateUtils.getNowDate());
        return sysTeamMapper.updateSysTeam(sysTeam);
    }

    /**
     * 批量删除小组
     *
     * @param ids 需要删除的小组主键
     * @return 结果
     */
    @Override
    public int deleteSysTeamByIds(Long[] ids)
    {
        return sysTeamMapper.deleteSysTeamByIds(ids);
    }

    /**
     * 删除小组信息
     *
     * @param id 小组主键
     * @return 结果
     */
    @Override
    public int deleteSysTeamById(Long id)
    {
        return sysTeamMapper.deleteSysTeamById(id);
    }
}
