k.e.book.ddh.service.CcAttachmentService Maven / Gradle / Ivy
package k.e.book.ddh.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import k.e.book.ddh.entity.CcAttachmentDO;
import k.e.book.ddh.entity.CcAttachmentQueryDTO;
import k.e.book.ddh.mapper.CcAttachmentMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcAttachmentService extends ServiceImpl {
public IPage selectProductPage(CcAttachmentQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcAttachmentDO::getId, dto.getId());
}
if(dto.getCategory() != null){
qr.eq(CcAttachmentDO::getCategory, dto.getCategory());
}
if(dto.getAdminId() != null){
qr.eq(CcAttachmentDO::getAdminId, dto.getAdminId());
}
if(dto.getUserId() != null){
qr.eq(CcAttachmentDO::getUserId, dto.getUserId());
}
if(dto.getUrl() != null){
qr.eq(CcAttachmentDO::getUrl, dto.getUrl());
}
if(dto.getImagewidth() != null){
qr.eq(CcAttachmentDO::getImagewidth, dto.getImagewidth());
}
if(dto.getImageheight() != null){
qr.eq(CcAttachmentDO::getImageheight, dto.getImageheight());
}
if(dto.getImagetype() != null){
qr.eq(CcAttachmentDO::getImagetype, dto.getImagetype());
}
if(dto.getImageframes() != null){
qr.eq(CcAttachmentDO::getImageframes, dto.getImageframes());
}
if(dto.getFilename() != null){
qr.eq(CcAttachmentDO::getFilename, dto.getFilename());
}
if(dto.getFilesize() != null){
qr.eq(CcAttachmentDO::getFilesize, dto.getFilesize());
}
if(dto.getMimetype() != null){
qr.eq(CcAttachmentDO::getMimetype, dto.getMimetype());
}
if(dto.getExtparam() != null){
qr.eq(CcAttachmentDO::getExtparam, dto.getExtparam());
}
if(dto.getCreatetime() != null){
qr.eq(CcAttachmentDO::getCreatetime, dto.getCreatetime());
}
if(dto.getUpdatetime() != null){
qr.eq(CcAttachmentDO::getUpdatetime, dto.getUpdatetime());
}
if(dto.getUploadtime() != null){
qr.eq(CcAttachmentDO::getUploadtime, dto.getUploadtime());
}
if(dto.getStorage() != null){
qr.eq(CcAttachmentDO::getStorage, dto.getStorage());
}
if(dto.getSha1() != null){
qr.eq(CcAttachmentDO::getSha1, dto.getSha1());
}
qr.orderByDesc(CcAttachmentDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}