| | |
| | | private GoodsorderDetailMapper goodsorderDetailMapper; |
| | | @Override |
| | | public List<BusinessDataCountVO> shopRankList10(CountDataDTO param) { |
| | | Date startDate = null,endDate = null; |
| | | /* Date startDate = null,endDate = null; |
| | | if(param.getYear()!=null && param.getMonth()!=null){ |
| | | List<Date> dList = DateUtil.getDatePeriodByYearAndMonth(param.getYear(),param.getMonth()-1); |
| | | startDate = dList.get(0); |
| | |
| | | List<Date> dList = DateUtil.getDatePeriodByYear(param.getYear()); |
| | | startDate = dList.get(0); |
| | | endDate = dList.get(1); |
| | | } |
| | | }*/ |
| | | //统计订单销量和销售额集合 |
| | | List<BusinessDataCountVO> list1 = goodsorderMapper.selectJoinList(BusinessDataCountVO.class,new MPJLambdaWrapper<Goodsorder>() |
| | | .selectAs(Shop::getName,BusinessDataCountVO::getName) |
| | |
| | | .select("(select count(t.id) )",BusinessDataCountVO::getNum) |
| | | .select("(select sum(t.total_price) )",BusinessDataCountVO::getPrice) |
| | | .leftJoin(Shop.class,Shop::getId,Goodsorder::getDistributionShopId) |
| | | .ge(startDate!=null,Goodsorder::getCreateDate,startDate) |
| | | .ne(endDate!=null,Goodsorder::getCreateDate,endDate) |
| | | .apply(param.getYear()!=null,"YEAR ( t.CREATE_DATE )="+param.getYear() ) |
| | | .apply(param.getYear()!=null && param.getMonth()!=null,"MONTH ( t.CREATE_DATE )="+param.getMonth() ) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey()) |
| | | .groupBy(Goodsorder::getDistributionShopId) |
| | |
| | | } |
| | | @Override |
| | | public List<BusinessDataCountVO> goodsRankList10(CountDataDTO param) { |
| | | Date startDate = null,endDate = null; |
| | | /* Date startDate = null,endDate = null; |
| | | if(param.getYear()!=null && param.getMonth()!=null){ |
| | | List<Date> dList = DateUtil.getDatePeriodByYearAndMonth(param.getYear(),param.getMonth()-1); |
| | | startDate = dList.get(0); |
| | |
| | | List<Date> dList = DateUtil.getDatePeriodByYear(param.getYear()); |
| | | startDate = dList.get(0); |
| | | endDate = dList.get(1); |
| | | } |
| | | }*/ |
| | | //统计订单销量和销售额集合 |
| | | List<BusinessDataCountVO> list1 = goodsorderDetailMapper.selectJoinList(BusinessDataCountVO.class,new MPJLambdaWrapper<GoodsorderDetail>() |
| | | .selectAs(Goods::getName,BusinessDataCountVO::getName) |
| | |
| | | .select("(select sum(ifnull(t.price,0) * ifnull(t.goods_num,0)))",BusinessDataCountVO::getPrice) |
| | | .leftJoin(Goodsorder.class,Goodsorder::getId,GoodsorderDetail::getOrderId) |
| | | .leftJoin(Goods.class,Goods::getId,GoodsorderDetail::getGoodsId) |
| | | .ge(startDate!=null,Goodsorder::getCreateDate,startDate) |
| | | .ne(endDate!=null,Goodsorder::getCreateDate,endDate) |
| | | // .ge(startDate!=null,Goodsorder::getCreateDate,startDate) |
| | | // .ne(endDate!=null,Goodsorder::getCreateDate,endDate) |
| | | .apply(param.getYear()!=null,"YEAR ( t1.CREATE_DATE )="+param.getYear() ) |
| | | .apply(param.getYear()!=null && param.getMonth()!=null,"MONTH ( t1.CREATE_DATE )="+param.getMonth() ) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey()) |
| | | .groupBy(GoodsorderDetail::getGoodsId) |