package hw.tagApi.system.service.impl;

import java.util.List;
import hw.tagApi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import hw.tagApi.system.mapper.SysAttachInfoMapper;
import hw.tagApi.system.domain.SysAttachInfo;
import hw.tagApi.system.service.ISysAttachInfoService;

/**
 * 附件信息Service业务层处理
 * 
 * @author Yinq
 * @date 2025-04-22
 */
@Service
public class SysAttachInfoServiceImpl implements ISysAttachInfoService 
{
    @Autowired
    private SysAttachInfoMapper sysAttachInfoMapper;

    /**
     * 查询附件信息
     * 
     * @param attachId 附件信息主键
     * @return 附件信息
     */
    @Override
    public SysAttachInfo selectSysAttachInfoByAttachId(Long attachId)
    {
        return sysAttachInfoMapper.selectSysAttachInfoByAttachId(attachId);
    }

    /**
     * 查询附件信息列表
     * 
     * @param sysAttachInfo 附件信息
     * @return 附件信息
     */
    @Override
    public List<SysAttachInfo> selectSysAttachInfoList(SysAttachInfo sysAttachInfo)
    {
        return sysAttachInfoMapper.selectSysAttachInfoList(sysAttachInfo);
    }

    /**
     * 新增附件信息
     * 
     * @param sysAttachInfo 附件信息
     * @return 结果
     */
    @Override
    public int insertSysAttachInfo(SysAttachInfo sysAttachInfo)
    {
        sysAttachInfo.setCreateTime(DateUtils.getNowDate());
        return sysAttachInfoMapper.insertSysAttachInfo(sysAttachInfo);
    }

    /**
     * 修改附件信息
     * 
     * @param sysAttachInfo 附件信息
     * @return 结果
     */
    @Override
    public int updateSysAttachInfo(SysAttachInfo sysAttachInfo)
    {
        sysAttachInfo.setUpdateTime(DateUtils.getNowDate());
        return sysAttachInfoMapper.updateSysAttachInfo(sysAttachInfo);
    }

    /**
     * 批量删除附件信息
     * 
     * @param attachIds 需要删除的附件信息主键
     * @return 结果
     */
    @Override
    public int deleteSysAttachInfoByAttachIds(Long[] attachIds)
    {
        return sysAttachInfoMapper.deleteSysAttachInfoByAttachIds(attachIds);
    }

    /**
     * 删除附件信息信息
     * 
     * @param attachId 附件信息主键
     * @return 结果
     */
    @Override
    public int deleteSysAttachInfoByAttachId(Long attachId)
    {
        return sysAttachInfoMapper.deleteSysAttachInfoByAttachId(attachId);
    }
}
