k.e.book.ddh.service.CcCommandService 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.CcCommandDO;
import k.e.book.ddh.entity.CcCommandQueryDTO;
import k.e.book.ddh.mapper.CcCommandMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcCommandService extends ServiceImpl {
public IPage selectProductPage(CcCommandQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcCommandDO::getId, dto.getId());
}
if(dto.getType() != null){
qr.eq(CcCommandDO::getType, dto.getType());
}
if(dto.getParams() != null){
qr.eq(CcCommandDO::getParams, dto.getParams());
}
if(dto.getCommand() != null){
qr.eq(CcCommandDO::getCommand, dto.getCommand());
}
if(dto.getContent() != null){
qr.eq(CcCommandDO::getContent, dto.getContent());
}
if(dto.getExecutetime() != null){
qr.eq(CcCommandDO::getExecutetime, dto.getExecutetime());
}
if(dto.getCreatetime() != null){
qr.eq(CcCommandDO::getCreatetime, dto.getCreatetime());
}
if(dto.getUpdatetime() != null){
qr.eq(CcCommandDO::getUpdatetime, dto.getUpdatetime());
}
if(dto.getStatus() != null){
qr.eq(CcCommandDO::getStatus, dto.getStatus());
}
qr.orderByDesc(CcCommandDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}