|  |  |  | 
|---|
|  |  |  | <result property="isSelected" column="isSelected" /> | 
|---|
|  |  |  | <result property="shopId" column="shop_id" /> | 
|---|
|  |  |  | <result property="companyId" column="company_id" /> | 
|---|
|  |  |  | <result property="cartType" column="cart_type" /> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | <result property="isSelected" column="isSelected" /> | 
|---|
|  |  |  | <result property="shopId" column="shop_id" /> | 
|---|
|  |  |  | <result property="companyId" column="company_id" /> | 
|---|
|  |  |  | <result property="cartType" column="cart_type" /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 字段sql --> | 
|---|
|  |  |  | 
|---|
|  |  |  | cart_number, | 
|---|
|  |  |  | isSelected, | 
|---|
|  |  |  | shop_id, | 
|---|
|  |  |  | company_id | 
|---|
|  |  |  | company_id, | 
|---|
|  |  |  | cart_type | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 属性sql --> | 
|---|
|  |  |  | 
|---|
|  |  |  | #{item.cartNumber}, | 
|---|
|  |  |  | #{item.isSelected}, | 
|---|
|  |  |  | #{item.shopId}, | 
|---|
|  |  |  | #{item.companyId} | 
|---|
|  |  |  | #{item.companyId}, | 
|---|
|  |  |  | #{item.cartType} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- where sql --> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="record.companyId != null and record.companyId !='' "> | 
|---|
|  |  |  | and c.company_id = #{record.companyId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | p.img_mobile, | 
|---|
|  |  |  | p.img_pc, | 
|---|
|  |  |  | u.nick_name, | 
|---|
|  |  |  | s.NAME | 
|---|
|  |  |  | s.NAME, | 
|---|
|  |  |  | c.cart_type, | 
|---|
|  |  |  | from shop_shopping_cart c | 
|---|
|  |  |  | LEFT JOIN shop_product p ON c.cart_product_id = p.id | 
|---|
|  |  |  | LEFT JOIN shop_sku s ON c.cart_sku_id = s.id | 
|---|
|  |  |  | LEFT JOIN biz_user u ON c.cart_user_id = u.open_id | 
|---|
|  |  |  | LEFT JOIN sys_vip_info u ON c.cart_user_id = u.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | <include refid="where_sql"></include> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | 
|---|
|  |  |  | from shop_shopping_cart c | 
|---|
|  |  |  | LEFT JOIN shop_product p ON c.cart_product_id = p.id | 
|---|
|  |  |  | LEFT JOIN shop_sku s ON c.cart_sku_id = s.id | 
|---|
|  |  |  | LEFT JOIN biz_user u ON c.cart_user_id = u.open_id | 
|---|
|  |  |  | LEFT JOIN sys_vip_info u ON c.cart_user_id = u.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | <include refid="where_sql"></include> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | 
|---|
|  |  |  | p.img_pc, | 
|---|
|  |  |  | p.buy_limit, | 
|---|
|  |  |  | s.NAME, | 
|---|
|  |  |  | s.stock | 
|---|
|  |  |  | s.stock, | 
|---|
|  |  |  | s.score_count, | 
|---|
|  |  |  | s.score_price, | 
|---|
|  |  |  | c.cart_type | 
|---|
|  |  |  | from shop_shopping_cart c | 
|---|
|  |  |  | LEFT JOIN shop_product p ON c.cart_product_id = p.id | 
|---|
|  |  |  | LEFT JOIN shop_sku s ON c.cart_sku_id = s.id | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 统计用户购物车数量 --> | 
|---|
|  |  |  | <select id="selectUserCartCount" resultType="java.lang.Integer" > | 
|---|
|  |  |  | select sum(cart_number) from shop_shopping_cart  c | 
|---|
|  |  |  | select ifnull(sum(cart_number),0) from shop_shopping_cart  c | 
|---|
|  |  |  | LEFT JOIN shop_product p on p.id = c.cart_product_id | 
|---|
|  |  |  | where c.shop_Id=#{shopId} and  p.del_flag = 2 and cart_user_id=#{openId}; | 
|---|
|  |  |  | where c.shop_Id=#{shopId} and  p.del_flag = 2 and cart_user_id=#{userId} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 根据id 锁表查询--> | 
|---|