package com.ruoyi.project.system.attachment.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.project.system.attachment.mapper.AttachmentMapper;
|
import com.ruoyi.project.system.attachment.domain.Attachment;
|
import com.ruoyi.project.system.attachment.service.IAttachmentService;
|
import com.ruoyi.common.utils.text.Convert;
|
|
/**
|
* 附件Service业务层处理
|
*
|
* @author wm
|
* @date 2020-12-14
|
*/
|
@Service
|
public class AttachmentServiceImpl implements IAttachmentService
|
{
|
@Autowired
|
private AttachmentMapper attachmentMapper;
|
|
/**
|
* 查询附件
|
*
|
* @param attachmentId 附件ID
|
* @return 附件
|
*/
|
@Override
|
public Attachment selectAttachmentById(Long attachmentId)
|
{
|
return attachmentMapper.selectAttachmentById(attachmentId);
|
}
|
|
/**
|
* 查询附件列表
|
*
|
* @param attachment 附件
|
* @return 附件
|
*/
|
@Override
|
public List<Attachment> selectAttachmentList(Attachment attachment)
|
{
|
return attachmentMapper.selectAttachmentList(attachment);
|
}
|
|
/**
|
* 新增附件
|
*
|
* @param attachment 附件
|
* @return 结果
|
*/
|
@Override
|
public int insertAttachment(Attachment attachment)
|
{
|
attachment.setCreateTime(DateUtils.getNowDate());
|
return attachmentMapper.insertAttachment(attachment);
|
}
|
|
/**
|
* 修改附件
|
*
|
* @param attachment 附件
|
* @return 结果
|
*/
|
@Override
|
public int updateAttachment(Attachment attachment)
|
{
|
attachment.setUpdateTime(DateUtils.getNowDate());
|
return attachmentMapper.updateAttachment(attachment);
|
}
|
|
/**
|
* 删除附件对象
|
*
|
* @param ids 需要删除的数据ID
|
* @return 结果
|
*/
|
@Override
|
public int deleteAttachmentByIds(String ids)
|
{
|
return attachmentMapper.deleteAttachmentByIds(Convert.toStrArray(ids));
|
}
|
|
/**
|
* 删除附件信息
|
*
|
* @param attachmentId 附件ID
|
* @return 结果
|
*/
|
@Override
|
public int deleteAttachmentById(Long attachmentId)
|
{
|
return attachmentMapper.deleteAttachmentById(attachmentId);
|
}
|
}
|