| | |
| | | import com.doumee.dao.business.model.Goods; |
| | | import com.doumee.dao.web.request.goods.GoodsRequest; |
| | | import com.doumee.dao.web.response.goods.GoodsInfoResponse; |
| | | import com.github.yulichang.base.mapper.MPJJoinMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | |
| | | * @author 江蹄蹄 |
| | | * @date 2023/03/21 15:48 |
| | | */ |
| | | public interface GoodsMapper extends BaseMapper<Goods> { |
| | | public interface GoodsMapper extends MPJJoinMapper<Goods> { |
| | | |
| | | |
| | | |
| | | @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 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 ," + |
| | | " ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = g.id ),0) as minPrice " + |
| | | " from goods g " + |
| | | " ${ew.customSqlSegment} ") |
| | | IPage<GoodsInfoResponse> goodsPage(IPage<GoodsRequest> page, @Param(Constants.WRAPPER) Wrapper wrapper); |
| | | |
| | | |
| | | @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 ) as realSaleNum " + |
| | | @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 ," + |
| | | " ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = g.id ),0) as minPrice " + |
| | | " from goods g " + |
| | | " where g.ISDELETED = 0 and g.id = #{id} ") |
| | | GoodsInfoResponse getGoodsInfo(@Param("id") Integer id); |
| | | |
| | | |
| | | @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 " + |
| | | " 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); |
| | | |
| | | |
| | | } |