|
|
@@ -2,6 +2,7 @@ package com.fs.hisStore.mapper;
|
|
|
|
|
|
import java.util.List;
|
|
|
import com.fs.hisStore.domain.FsStoreCartScrm;
|
|
|
+import com.fs.hisStore.domain.FsStoreScrm;
|
|
|
import com.fs.hisStore.param.FsStoreCartCountParam;
|
|
|
import com.fs.hisStore.vo.FsStoreCartQueryVO;
|
|
|
import com.fs.hisStore.vo.FsStoreCartVO;
|
|
|
@@ -66,7 +67,29 @@ public interface FsStoreCartScrmMapper
|
|
|
*/
|
|
|
public int deleteFsStoreCartByIds(Long[] ids);
|
|
|
|
|
|
- @Select("select c.*,p.product_type,p.product_name,p.image as product_image,v.price,v.sku as product_attr_name,v.image as product_attr_image,v.stock from fs_store_cart_scrm c inner join fs_store_product_scrm p on p.product_id=c.product_id inner join fs_store_product_attr_value_scrm v on v.id=c.product_attr_value_id where c.is_pay=0 and c.is_del=0 and c.is_buy=0 and p.is_show=1 and p.is_del=0 and c.user_id= #{uid}")
|
|
|
+// @Select("select c.*,p.product_type,p.product_name,p.image as product_image,v.price,v.sku as product_attr_name,v.image as product_attr_image,v.stock from fs_store_cart_scrm c inner join fs_store_product_scrm p on p.product_id=c.product_id inner join fs_store_product_attr_value_scrm v on v.id=c.product_attr_value_id where c.is_pay=0 and c.is_del=0 and c.is_buy=0 and p.is_show=1 and p.is_del=0 and c.user_id= #{uid}")
|
|
|
+@Select({"<script> " +
|
|
|
+ "select q.* FROM (" +
|
|
|
+ "select c.*,p.product_type,p.product_name,p.image as product_image,v.price,v.sku as product_attr_name," +
|
|
|
+ "v.image as product_attr_image,v.stock,s.store_id,s.store_name " +
|
|
|
+ "from fs_store_cart_scrm c " +
|
|
|
+ "inner join fs_store_product_scrm p on p.product_id=c.product_id " +
|
|
|
+ "inner join fs_store_product_attr_value_scrm v on v.id=c.product_attr_value_id " +
|
|
|
+ "left join fs_store_scrm s on v.store_id = s.store_id " +
|
|
|
+ "where c.is_pay=0 and c.is_del=0 and c.is_buy=0 and p.is_show=1 and p.is_del=0 and c.user_id= #{uid}" +
|
|
|
+ ") q where 1= 1" +
|
|
|
+ "<if test = 'storeId != null '> " +
|
|
|
+ "<choose>" +
|
|
|
+ "<when test='storeId == -1'>" +
|
|
|
+ "and q.store_id IS NULL" +
|
|
|
+ "</when>" +
|
|
|
+ "<otherwise>" +
|
|
|
+ "and q.store_id =#{storeId} " +
|
|
|
+ "</otherwise>" +
|
|
|
+ "</choose>" +
|
|
|
+ "</if>" +
|
|
|
+ "</script>"})
|
|
|
+List<FsStoreCartVO> selectFsStoreCartListByUid(@Param("uid") long uid,@Param("storeId") Long storeId);
|
|
|
List<FsStoreCartVO> selectFsStoreCartListByUid(long uid);
|
|
|
@Delete({"<script>"+
|
|
|
"delete from fs_store_cart_scrm where id in"+
|
|
|
@@ -120,4 +143,26 @@ public interface FsStoreCartScrmMapper
|
|
|
"</if>" +
|
|
|
"</script>"})
|
|
|
Integer selectFsStoreCartCount(@Param("maps") FsStoreCartCountParam param);
|
|
|
+
|
|
|
+ @Select(
|
|
|
+// "select s.*" +
|
|
|
+// "from fs_store_cart c " +
|
|
|
+// "inner join fs_store_product p on p.product_id=c.product_id " +
|
|
|
+// "inner join fs_store_product_attr_value v on v.id=c.product_attr_value_id " +
|
|
|
+// "left join fs_store s on v.store_id = s.store_id " +
|
|
|
+// "where c.is_pay=0 and c.is_del=0 and c.is_buy=0 and p.is_show=1 and p.is_del=0 and c.user_id= #{uid} GROUP BY s.store_id"
|
|
|
+ "SELECT sorted.store_id, sorted.store_name" +
|
|
|
+ " FROM (" +
|
|
|
+ "SELECT c.id, c.product_id, c.product_attr_value_id, c.user_id, c.create_time AS cart_create_time," +
|
|
|
+ "s.store_id, s.store_name " +
|
|
|
+ "FROM fs_store_cart_scrm c " +
|
|
|
+ "INNER JOIN fs_store_product_scrm p ON p.product_id = c.product_id " +
|
|
|
+ "INNER JOIN fs_store_product_attr_value_scrm v ON v.id = c.product_attr_value_id " +
|
|
|
+ "LEFT JOIN fs_store_scrm s ON v.store_id = s.store_id " +
|
|
|
+ "WHERE c.is_pay = 0 AND c.is_del = 0 AND c.is_buy = 0 AND p.is_show = 1 AND p.is_del = 0 AND c.user_id= #{uid} " +
|
|
|
+ "ORDER BY c.create_time DESC " +
|
|
|
+ ") sorted " +
|
|
|
+ "GROUP BY sorted.store_id;"
|
|
|
+ )
|
|
|
+ List<FsStoreScrm> selectFsStoreByUid(long uid);
|
|
|
}
|