935090232@qq.com
2021-03-18 5d43370b99a03391c9271d04d3f351f0fd734dae
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml
@@ -27,6 +27,7 @@
          <result property="isSelected" column="isSelected" />
          <result property="shopId" column="shop_id" />
      <result property="companyId" column="company_id" />
      <result property="cartType" column="cart_type" />
   </resultMap>
   
   
@@ -44,6 +45,8 @@
      <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 -->
@@ -59,7 +62,9 @@
         cart_number,
         isSelected,
         shop_id,
            company_id
            company_id,
      cart_type
   </sql>
   
   <!-- 属性sql -->
@@ -75,7 +80,9 @@
         #{item.cartNumber},
         #{item.isSelected},
         #{item.shopId},
      #{item.companyId}
      #{item.companyId},
      #{item.cartType}
   </sql>
   
   <!-- where sql -->
@@ -121,6 +128,10 @@
          <if test="record.companyId != null and record.companyId !='' ">
             and c.company_id = #{record.companyId}
          </if>
          <if test="record.cartType != null and record.cartType !='' ">
             and c.cart_type = #{record.cartType}
          </if>
      </if>
@@ -212,7 +223,7 @@
   <update id="updateAllSelected" >
      update shop_shopping_cart set isSelected  = #{isSelected}  where  shop_id=#{shopId} and cart_user_id=#{openId}
      update shop_shopping_cart set isSelected  = #{isSelected}  where  shop_id=#{shopId} and cart_user_id=#{openId} and cart_type=#{cartType}
   </update>
@@ -334,6 +345,7 @@
          and p.STATUS = 1
          and p.del_flag = 2
         and c.cart_user_id = #{cartUserId}
         and c.cart_type = #{cartType}
      order by c.create_time desc
   </select>
@@ -351,7 +363,7 @@
   <select id="selectUserCartCount" resultType="java.lang.Integer" >
      select sum(cart_number) 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=#{openId} and cart_type=#{cartType};
   </select>
   <!-- 根据id 锁表查询-->