| | |
| | | .eq("g.ISDELETED",Constants.ZERO) |
| | | .eq(!Objects.isNull(model) && Objects.nonNull(model.getCategoryId()), |
| | | "g.CATEGORY_ID", model.getCategoryId()) |
| | | |
| | | //TODO 适用品牌 适用系列 |
| | | // .eq(!Objects.isNull(model) && Objects.nonNull(model.getApplicableBrandId()), |
| | | // "","") |
| | | // .eq(!Objects.isNull(model) && Objects.nonNull(model.getSeriesBrandId()), |
| | | // "","") |
| | | |
| | | //适用品牌 适用系列 |
| | | .apply(!Objects.isNull(model) && Objects.nonNull(model.getApplicableBrandId()), |
| | | " find_in_set( '["+model.getApplicableBrandId()+"]' , g.BRAND_IDS ) ") |
| | | .apply(!Objects.isNull(model) && Objects.nonNull(model.getSeriesBrandId()), |
| | | " find_in_set( '["+model.getSeriesBrandId()+"]' , g.SERIAL_IDS ) ") |
| | | .eq("g.STATUS", Constants.ZERO) |
| | | .like(StringUtils.isNotBlank(model.getGoodsName()),"g.NAME",model.getGoodsName()); |
| | | |
| | |
| | | wrapper.orderByDesc("g.price"); |
| | | } |
| | | } |
| | | |
| | | // for(PageWrap.SortData sortData:pageWrap.getSorts1()){ |
| | | // if ("CREATE_DATE".equalsIgnoreCase(sortData.getProperty())){ |
| | | // if (PageWrap.ASC.equalsIgnoreCase(sortData.getDirection())){ |
| | | // wrapper.orderByAsc("g.CREATE_DATE"); |
| | | // } |
| | | // wrapper.orderByDesc("g.CREATE_DATE"); |
| | | // |
| | | // } |
| | | // if ("realSaleNum".equalsIgnoreCase(sortData.getProperty())){ |
| | | // |
| | | // if (PageWrap.ASC.equalsIgnoreCase(sortData.getDirection())){ |
| | | // wrapper.orderByAsc("realSaleNum"); |
| | | // } |
| | | // wrapper.orderByDesc("realSaleNum"); |
| | | // } |
| | | // if ("PRICE".equalsIgnoreCase(sortData.getProperty())){ |
| | | // if (PageWrap.ASC.equalsIgnoreCase(sortData.getDirection())){ |
| | | // wrapper.orderByAsc("g.PRICE"); |
| | | // } |
| | | // wrapper.orderByDesc("g.PRICE"); |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | IPage<GoodsInfoResponse> page = goodsMapper.goodsPage(pageWrap.toPage(),wrapper); |
| | | IPage<GoodsInfoResponse> page = |
| | | Objects.isNull(model.getShopId())? |
| | | goodsMapper.goodsPage(pageWrap.toPage(),wrapper) |
| | | : |
| | | goodsMapper.goodsPageForShop(pageWrap.toPage(),wrapper,model.getShopId()) ; |
| | | if (!CollectionUtils.isEmpty(page.getRecords())){ |
| | | String preFixPath = systemDictDataBiz.getPreFixPath(Constants.RESOURCE_PATH, Constants.GOODS_FILE); |
| | | page.getRecords().forEach(s->s.setImgurl(preFixPath+s.getImgurl())); |
| | | |
| | | } |
| | | |
| | | |
| | | // if (pageWrap.getModel().getType().equals(Constants.TWO)) { |
| | | // for (GoodsInfoResponse goodsResponse : page.getRecords()) { |
| | | // //查询商品的分类 |
| | | // goodsResponse.setCategoryLabels(labelsMapper.selectById(goodsResponse.getCategoryId())); |
| | | // //查询商品的品牌 |
| | | // goodsResponse.setBrandLabels(labelsMapper.selectById(goodsResponse.getBrandId())); |
| | | // //查询商品的标签信息 |
| | | // if (StringUtils.isNotBlank(goodsResponse.getLabels())) { |
| | | // goodsResponse.setLabelsList(labelsMapper.selectList(new QueryWrapper<Labels>() |
| | | // .apply(" find_in_set( id, " + goodsResponse.getLabels().split(",") + " ) "))); |
| | | // } |
| | | // //查询是否已订阅 |
| | | // goodsResponse.setIsSubscribe(goodsorderDetailMapper.selectCount(new QueryWrapper<GoodsorderDetail>() |
| | | // .eq("CREATOR", pageWrap.getModel().getMemberId()) |
| | | // .apply(" GOODS_SKU_ID in ( SELECT g.id FROM goods_sku g where g.GOODS_ID = " + goodsResponse.getId() + " ) ") |
| | | // )); |
| | | // //sku基础信息 |
| | | // this.getSkuInfo(goodsResponse); |
| | | // } |
| | | // } |
| | | return page; |
| | | } |
| | | |