MrShi
11 小时以前 4282e1cc35d85e2f84fe37b7f51fde22b374c7c9
server/dmmall_service/src/main/java/com/doumee/dao/business/GoodsMapper.java
@@ -20,7 +20,7 @@
    @Select(" select g.* , " +
            "(( select count(1) from goodsorder_detail gd inner join goods_sku gs on gd.GOODS_SKU_ID = gs.id where gs.GOODS_ID = g.`id`  )+ g.SALENUM) as realSaleNum ," +
            "(( select sum(gd.goods_num) from goodsorder_detail gd inner join goods_sku gs on gd.GOODS_SKU_ID = gs.id where gs.GOODS_ID = g.`id`  )+ g.SALENUM) as realSaleNum ," +
            //"( select gs.id from goods_sku gs where gs.GOODS_ID = g.id  limit 1 ) as realSaleNum ," +
            " ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = g.id ),0) as minPrice  " +
            " from goods g  " +
@@ -38,7 +38,7 @@
    @Select(" select g.* , gs.price as minPrice " +
            " ifnull( ( select   sgr.PRICE from shop_goods_relation sgr where sgr.GOODS_SKU_ID = gs.ID and sgr.ISDELETED = 0 and sgr.`STATUS` = 0  and sgr.SHOP_ID = #{shopId} ) ,0) as exFactoryPrice " +
            " ifnull(( select sum(gd.NAME) from goodsorder_detail gd  inner join goodsorder go on gd.ORDER_ID = go.id  where gd.GOODS_SKU_ID = gs.`id` and  go.DISTRIBUTION_SHOP_ID = 1 ),0) as realSaleNum " +
            " ifnull(( select sum(gd.goods_num) from goodsorder_detail gd  left  join goodsorder go on gd.ORDER_ID = go.id  where gd.GOODS_SKU_ID = gs.`id` and  go.DISTRIBUTION_SHOP_ID = 1 ),0) as realSaleNum " +
            " from goods g left join goods_sku gs on g.id = gs.GOODS_ID " +
            " ${ew.customSqlSegment} ")
    IPage<GoodsInfoResponse> goodsPageForShop(IPage<GoodsRequest> page, @Param(Constants.WRAPPER) Wrapper wrapper,@Param("shopId") Integer shopId);