perf: 台桌列表增加分页
This commit is contained in:
@@ -217,11 +217,28 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAllNoPage(TbShopTableQueryCriteria criteria) {
|
||||
public Map<String, Object> queryAllPage(TbShopTableQueryCriteria criteria) {
|
||||
if (null == criteria.getAreaId() || criteria.getAreaId() == 0) {
|
||||
criteria.setAreaId(null);
|
||||
}
|
||||
List<TbShopTable> tbShopTableList = tbShopTableRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder));
|
||||
|
||||
LambdaQueryWrapper<TbShopTable> query = new LambdaQueryWrapper<TbShopTable>()
|
||||
.eq(TbShopTable::getShopId, criteria.getShopId());
|
||||
if (StrUtil.isNotBlank(criteria.getName())) {
|
||||
query.like(TbShopTable::getName, criteria.getName());
|
||||
}
|
||||
|
||||
if (criteria.getAreaId() != null) {
|
||||
query.eq(TbShopTable::getAreaId, criteria.getAreaId());
|
||||
}
|
||||
|
||||
if (criteria.getQrcode() != null) {
|
||||
query.eq(TbShopTable::getQrcode, criteria.getQrcode());
|
||||
}
|
||||
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page<TbShopTable> shopTablePage =
|
||||
mpShopTableService.page(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(criteria.getPage(), criteria.getSize()), query);
|
||||
List<TbShopTable> tbShopTableList = shopTablePage.getRecords();
|
||||
ArrayList<Map<String, Object>> infoList = new ArrayList<>();
|
||||
for (TbShopTable date : tbShopTableList) {
|
||||
if (StrUtil.isBlank(date.getQrcode())) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public interface TbShopTableService {
|
||||
*/
|
||||
Map<String,Object> queryAll(TbShopTableQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
Map<String,Object> queryAllNoPage(TbShopTableQueryCriteria criteria);
|
||||
Map<String,Object> queryAllPage(TbShopTableQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
|
||||
Reference in New Issue
Block a user