package com.ruoyi.szxc.service.impl;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.szxc.domain.SzxcHelp;
import com.ruoyi.szxc.mapper.SzxcHelpMapper;
import com.ruoyi.szxc.service.ISzxcHelpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 帮办事Service业务层处理
 * 
 * @author hs
 * @date 2024-03-20
 */
@Service
public class SzxcHelpServiceImpl implements ISzxcHelpService 
{
    @Autowired
    private SzxcHelpMapper szxcHelpMapper;

    /**
     * 查询帮办事
     * 
     * @param id 帮办事主键
     * @return 帮办事
     */
    @Override
    public SzxcHelp selectSzxcHelpById(Long id)
    {
        return szxcHelpMapper.selectSzxcHelpById(id);
    }

    /**
     * 查询帮办事列表
     * 
     * @param szxcHelp 帮办事
     * @return 帮办事
     */
    @Override
    @DataScope(deptAlias = "h")
    public List<SzxcHelp> selectSzxcHelpList(SzxcHelp szxcHelp)
    {
        return szxcHelpMapper.selectSzxcHelpList(szxcHelp);
    }

    /**
     * 新增帮办事
     * 
     * @param szxcHelp 帮办事
     * @return 结果
     */
    @Override
    public int insertSzxcHelp(SzxcHelp szxcHelp)
    {
        szxcHelp.setCreateTime(DateUtils.getNowDate());
        return szxcHelpMapper.insertSzxcHelp(szxcHelp);
    }

    /**
     * 修改帮办事
     * 
     * @param szxcHelp 帮办事
     * @return 结果
     */
    @Override
    public int updateSzxcHelp(SzxcHelp szxcHelp)
    {
        szxcHelp.setUpdateTime(DateUtils.getNowDate());
        return szxcHelpMapper.updateSzxcHelp(szxcHelp);
    }

    /**
     * 批量删除帮办事
     * 
     * @param ids 需要删除的帮办事主键
     * @return 结果
     */
    @Override
    public int deleteSzxcHelpByIds(Long[] ids)
    {
        return szxcHelpMapper.deleteSzxcHelpByIds(ids);
    }

    /**
     * 删除帮办事信息
     * 
     * @param id 帮办事主键
     * @return 结果
     */
    @Override
    public int deleteSzxcHelpById(Long id)
    {
        return szxcHelpMapper.deleteSzxcHelpById(id);
    }
}
