k.e.book.ddh.service.CcQueueLogService 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.CcQueueLogDO;
import k.e.book.ddh.entity.CcQueueLogQueryDTO;
import k.e.book.ddh.mapper.CcQueueLogMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcQueueLogService extends ServiceImpl {
public CcQueueLogDO saveNotify(String c, String t) {
CcQueueLogDO dd = new CcQueueLogDO();
dd.setContent(c);
dd.setStatus(0);
dd.setType(t);
this.save(dd);
return dd;
}
public IPage selectProductPage(CcQueueLogQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if (dto.getId() != null) {
qr.eq(CcQueueLogDO::getId, dto.getId());
}
if (dto.getContent() != null) {
qr.eq(CcQueueLogDO::getContent, dto.getContent());
}
if (dto.getStatus() != null) {
qr.eq(CcQueueLogDO::getStatus, dto.getStatus());
}
if (dto.getCreatetime() != null) {
qr.eq(CcQueueLogDO::getCreatetime, dto.getCreatetime());
}
if (dto.getUpdatetime() != null) {
qr.eq(CcQueueLogDO::getUpdatetime, dto.getUpdatetime());
}
if (dto.getType() != null) {
qr.eq(CcQueueLogDO::getType, dto.getType());
}
qr.orderByDesc(CcQueueLogDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}