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