k.e.book.ddh.service.CcAdminLogService 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.CcAdminLogDO;
import k.e.book.ddh.entity.CcAdminLogQueryDTO;
import k.e.book.ddh.mapper.CcAdminLogMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcAdminLogService extends ServiceImpl {
public IPage selectProductPage(CcAdminLogQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcAdminLogDO::getId, dto.getId());
}
if(dto.getAdminId() != null){
qr.eq(CcAdminLogDO::getAdminId, dto.getAdminId());
}
if(dto.getUsername() != null){
qr.eq(CcAdminLogDO::getUsername, dto.getUsername());
}
if(dto.getUrl() != null){
qr.eq(CcAdminLogDO::getUrl, dto.getUrl());
}
if(dto.getTitle() != null){
qr.eq(CcAdminLogDO::getTitle, dto.getTitle());
}
if(dto.getContent() != null){
qr.eq(CcAdminLogDO::getContent, dto.getContent());
}
if(dto.getIp() != null){
qr.eq(CcAdminLogDO::getIp, dto.getIp());
}
if(dto.getUseragent() != null){
qr.eq(CcAdminLogDO::getUseragent, dto.getUseragent());
}
if(dto.getCreatetime() != null){
qr.eq(CcAdminLogDO::getCreatetime, dto.getCreatetime());
}
qr.orderByDesc(CcAdminLogDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}