wl
2022-10-17 d46beba25ccb64a1047a98d642b6ce45e82f0bee
ycl-platform/src/main/java/com/ycl/service/store/impl/StoreInfoServiceImpl.java
@@ -2,6 +2,7 @@
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;
@@ -17,6 +18,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@@ -32,14 +34,16 @@
@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