rk
2025-12-11 3a19b72d3a187e6b88b0d1935fab3b8d44bd0120
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.doumee.dao.business;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.doumee.dao.business.model.Shopcart;
import com.doumee.dao.web.response.goods.CartGoodsResponse;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
/**
 * @author 江蹄蹄
 * @date 2023/03/21 15:48
 */
public interface ShopcartMapper extends BaseMapper<Shopcart> {
 
    @Select(" select s.id as shopCartId , s.GOODS_SKU_ID  as goodsSkuId  , s.PRODUCT_ID as goodsId , g.name as goodsName , gs.`NAME` as skuName , s.num , gs.PRICE  , ifnull(gs.STATUS,1) as status ," +
            "case when gs.IMGURL = ''  then g.IMGURL  when gs.IMGURL is null then  g.IMGURL  else gs.IMGURL end imgUrl  " +
            " from shopcart s left join goods g on s.PRODUCT_ID = g.ID left join goods_sku gs ON s.GOODS_SKU_ID = gs.id " +
            "  where 1 = 1 and s.member_id = #{memberId} order by s.CREATE_DATE desc ")
    IPage<CartGoodsResponse> cartGoodsPage(IPage page, @Param("memberId") Integer memberId);
 
 
 
}