From e0ff6529b4364fdbf81d25f33e881118b147b3fa Mon Sep 17 00:00:00 2001 From: zf <1603559716@qq.com> Date: 星期一, 31 七月 2023 13:04:41 +0800 Subject: [PATCH] bug修改 --- src/main/java/com/gk/hotwork/Service/ServiceImpl/AttachmentInfoServiceImpl.java | 88 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 88 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/AttachmentInfoServiceImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/AttachmentInfoServiceImpl.java new file mode 100644 index 0000000..250ef31 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/AttachmentInfoServiceImpl.java @@ -0,0 +1,88 @@ +package com.gk.hotwork.Service.ServiceImpl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.AttachmentInfo; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Mapper.AttachmentInfoMapper; +import com.gk.hotwork.Service.AttachmentInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @email 1603559716@qq.com + * @author: zf + * @date: 2023/7/24 + * @time: 13:48 + */ +@Service +public class AttachmentInfoServiceImpl extends ServiceImpl<AttachmentInfoMapper, AttachmentInfo> implements AttachmentInfoService { + @Autowired + private AttachmentInfoMapper attachmentInfoMapper; + + @Override + public AttachmentInfo findByKey(String key) { + AttachmentInfo attachmentInfo = attachmentInfoMapper.selectOne(new LambdaQueryWrapper<AttachmentInfo>() + .eq(AttachmentInfo::getDelFlag,0) + .eq(AttachmentInfo::getFileKey,key)); + return attachmentInfo; + } + @Override + public AttachmentInfo findById(Long id) { + AttachmentInfo attachmentInfo = attachmentInfoMapper.selectOne(new LambdaQueryWrapper<AttachmentInfo>() + .eq(AttachmentInfo::getDelFlag,0) + .eq(AttachmentInfo::getId,id)); + return attachmentInfo; + } + @Override + public List<AttachmentInfo> findByBusinessId(Long businessId) { + List<AttachmentInfo> attachmentInfoList = attachmentInfoMapper.selectList(new LambdaQueryWrapper<AttachmentInfo>() + .eq(AttachmentInfo::getDelFlag,0) + .eq(AttachmentInfo::getBusinessId,businessId)); + return attachmentInfoList; + } + + @Override + public List<AttachmentInfo> findByIds(List<Long> ids) { + return attachmentInfoMapper.selectList(new LambdaQueryWrapper<AttachmentInfo>() + .in(AttachmentInfo::getId,ids) + .eq(AttachmentInfo::getDelFlag,0)); + } + + @Override + public void delete(Long id, UserInfo userInfo) { + AttachmentInfo attachmentInfo = new AttachmentInfo(); + attachmentInfo.setId(id); + attachmentInfo.setUpdateTime(new Date()); + attachmentInfo.setUpdateUid(userInfo.getId()); + attachmentInfo.setUpdateUname(userInfo.getRealname()); + attachmentInfo.setDelFlag(1); + attachmentInfoMapper.updateById(attachmentInfo); + } + + @Override + public AttachmentInfo saveOne(AttachmentInfo attachmentInfo) { + attachmentInfoMapper.insert(attachmentInfo); + return attachmentInfoMapper.selectById(attachmentInfo.getId()); + } + + @Override + public List<AttachmentInfo> saveBatchAttachment(List<AttachmentInfo> attachmentInfoList) { + attachmentInfoMapper.saveBatch(attachmentInfoList); + return attachmentInfoList; + } + + @Override + public void updateBusinessIdBatch(List<AttachmentInfo> attachmentList) { + attachmentInfoMapper.updateBusinessIdBatch(attachmentList); + } + + @Override + public void deleteByBusinessId(Long businessId) { + attachmentInfoMapper.deleteByBusinessId(businessId); + } +} + -- Gitblit v1.9.2