k.e.book.ddh.service.CcUserCreditsLogService 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.CcUserCreditsLogDO;
import k.e.book.ddh.entity.CcUserCreditsLogQueryDTO;
import k.e.book.ddh.mapper.CcUserCreditsLogMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcUserCreditsLogService extends ServiceImpl {
public IPage selectProductPage(CcUserCreditsLogQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcUserCreditsLogDO::getId, dto.getId());
}
if(dto.getUserId() != null){
qr.eq(CcUserCreditsLogDO::getUserId, dto.getUserId());
}
if(dto.getType() != null){
qr.eq(CcUserCreditsLogDO::getType, dto.getType());
}
if(dto.getCredits() != null){
qr.eq(CcUserCreditsLogDO::getCredits, dto.getCredits());
}
if(dto.getBefore() != null){
qr.eq(CcUserCreditsLogDO::getBefore, dto.getBefore());
}
if(dto.getAfter() != null){
qr.eq(CcUserCreditsLogDO::getAfter, dto.getAfter());
}
if(dto.getMemo() != null){
qr.eq(CcUserCreditsLogDO::getMemo, dto.getMemo());
}
if(dto.getCreatetime() != null){
qr.eq(CcUserCreditsLogDO::getCreatetime, dto.getCreatetime());
}
qr.orderByDesc(CcUserCreditsLogDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}