doum
4 小时以前 417e33605dda0f28366a1d6e13c41198a156e3a7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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  ," +
            " CASE WHEN ( g.ISDELETED = 1 || g.`STATUS` = 1 || gs.ISDELETED = 1  ) THEN 1 ELSE 0 END 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);
 
 
 
}