| | |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.entity.store.StoreInfo; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | @Slf4j |
| | | public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo> implements StoreInfoService { |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Page<StoreInfo> list(String keyword, Integer pageSize, Integer pageNum) { |
| | | Page<StoreInfo> page = new Page<>(pageSize, pageNum); |
| | | LambdaQueryWrapper<StoreInfo> wrapper = new LambdaQueryWrapper<>(); |
| | | if (StrUtil.isNotEmpty(keyword)) { |
| | | wrapper.like(StoreInfo::getStoreName, keyword); |
| | | } |
| | | return page(page, wrapper); |
| | | Page<StoreInfo> storeInfoPage = page(page, new LambdaQueryWrapper<StoreInfo>() |
| | | .like(StringUtils.isNotBlank(keyword), StoreInfo::getStoreName, keyword)); |
| | | storeInfoPage.setRecords(list(new LambdaQueryWrapper<StoreInfo>() |
| | | .like(StringUtils.isNotBlank(keyword), StoreInfo::getStoreName, keyword))); |
| | | return storeInfoPage; |
| | | } |
| | | |
| | | @Override |