k.e.book.ddh.service.CcUserInfoLogService 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.CcUserInfoLogDO;
import k.e.book.ddh.entity.CcUserInfoLogQueryDTO;
import k.e.book.ddh.mapper.CcUserInfoLogMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcUserInfoLogService extends ServiceImpl {
public IPage selectProductPage(CcUserInfoLogQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcUserInfoLogDO::getId, dto.getId());
}
if(dto.getUserId() != null){
qr.eq(CcUserInfoLogDO::getUserId, dto.getUserId());
}
if(dto.getField() != null){
qr.eq(CcUserInfoLogDO::getField, dto.getField());
}
if(dto.getBeforeData() != null){
qr.eq(CcUserInfoLogDO::getBeforeData, dto.getBeforeData());
}
if(dto.getAfterData() != null){
qr.eq(CcUserInfoLogDO::getAfterData, dto.getAfterData());
}
if(dto.getCreatetime() != null){
qr.eq(CcUserInfoLogDO::getCreatetime, dto.getCreatetime());
}
if(dto.getUpdatetime() != null){
qr.eq(CcUserInfoLogDO::getUpdatetime, dto.getUpdatetime());
}
qr.orderByDesc(CcUserInfoLogDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}