xiaoyong931011
2022-09-24 aa2885980b4b6aeb309aab9762a6220e903b498a
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cc.mrbird.febs.mall.mapper.MallShoppingCartMapper">
 
    <resultMap id="ShoppingCartMap" type="cc.mrbird.febs.mall.entity.MallShoppingCart">
        <id property="id" column="id" />
        <result property="goodsId" column="goods_id" />
        <result property="styleId" column="style_id" />
        <result property="skuId" column="sku_id" />
        <result property="cnt" column="cnt" />
        <association property="goods" select="cc.mrbird.febs.mall.mapper.MallGoodsMapper.selectGoodsDetailById" column="{id=goods_id}"></association>
        <association property="sku" select="cc.mrbird.febs.mall.mapper.MallGoodsSkuMapper.selectSkuInfoById" column="{id=sku_id}"></association>
    </resultMap>
    
    <select id="selectCartGoodsList" resultMap="ShoppingCartMap">
        select * from mall_shopping_cart where member_id=#{memberId}
    </select>
 
    <select id="selectCartGoodsBySkuId" resultType="cc.mrbird.febs.mall.entity.MallShoppingCart">
        select * from mall_shopping_cart
        where member_id=#{memberId} and sku_id=#{skuId}
    </select>
 
    <delete id="delBySkuId">
        delete from mall_shopping_cart
        where member_id=#{memberId} and sku_id=#{skuId}
    </delete>
 
    <delete id="deleteByGoodsId">
        delete from mall_shopping_cart
        where goods_id = #{goodsId}
    </delete>
 
    <delete id="deleteByGoodsIdAndSkuId">
        delete from mall_shopping_cart
        where goods_id = #{goodsId} and sku_id = #{skuId}
    </delete>
 
</mapper>