@@ -31,4 +32,7 @@ public interface TbCfOrderRepository extends PagingAndSortingRepository<TbCfOrde
...
@@ -31,4 +32,7 @@ public interface TbCfOrderRepository extends PagingAndSortingRepository<TbCfOrde
@Modifying
@Modifying
@Query(value="update tb_cf_station_item sk INNER JOIN tb_cf_item_order_r r ON r.item_id=sk.item_id set sk.item_count=sk.item_count+r.item_num WHERE r.order_id = :orderId ",nativeQuery=true)
@Query(value="update tb_cf_station_item sk INNER JOIN tb_cf_item_order_r r ON r.item_id=sk.item_id set sk.item_count=sk.item_count+r.item_num WHERE r.order_id = :orderId ",nativeQuery=true)
@Query(value="SELECT t1.*,t2.order_item_id ordersId,t2.order_status orderStatus,t2.item_num itemNum FROM tb_cf_item_detail t1 LEFT JOIN tb_cf_item_order_r t2 ON t1.item_id = t2.item_id LEFT JOIN tb_cf_order t3 ON t2.order_id = t3.order_id WHERE t2.enable_flag = 1 AND t2.order_id =:orderId",nativeQuery=true)
@@ -30,6 +30,9 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb
...
@@ -30,6 +30,9 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb
@Query(value="select a.item_id as itemId,a.item_code as itemCode,a.item_name as itemName,a.item_brief as itemBrief,a.item_category as itemCategory,a.item_price as itemPrice,a.discount_price as discountPrice,a.item_url as itemUrl,a.item_img as itemImg,a.item_tags as itemTags,a.item_label as itemLabel,a.item_num as itemNum,a.item_collection_num as itemCollectionNum,a.item_count as itemCount,a.item_sku as itemSku,a.item_top as itemTop,a.supplier as supplier,a.platform_code as platformCode,a.platform_name as platformName,a.enable_flag as enableFlag,a.create_time as createTime,a.item_categorytwo as itemCategorytwo,a.item_descrition_id as itemDescritionId,a.sort,a.template,MATCH(a.item_name, a.item_brief) AGAINST(?1 IN NATURAL LANGUAGE MODE) as score from tb_cf_station_item a where a.item_name LIKE CONCAT('%',?1,'%') or a.item_name SOUNDS LIKE ?1 or MATCH(a.item_name, a.item_brief) AGAINST(?1 IN NATURAL LANGUAGE MODE) ORDER BY IF(a.item_name LIKE CONCAT('%',?1,'%'),10000,IF(a.item_name SOUNDS LIKE ?1,9999,score)) desc,a.create_time DESC limit ?2,?3",nativeQuery=true)
@Query(value="select a.item_id as itemId,a.item_code as itemCode,a.item_name as itemName,a.item_brief as itemBrief,a.item_category as itemCategory,a.item_price as itemPrice,a.discount_price as discountPrice,a.item_url as itemUrl,a.item_img as itemImg,a.item_tags as itemTags,a.item_label as itemLabel,a.item_num as itemNum,a.item_collection_num as itemCollectionNum,a.item_count as itemCount,a.item_sku as itemSku,a.item_top as itemTop,a.supplier as supplier,a.platform_code as platformCode,a.platform_name as platformName,a.enable_flag as enableFlag,a.create_time as createTime,a.item_categorytwo as itemCategorytwo,a.item_descrition_id as itemDescritionId,a.sort,a.template,MATCH(a.item_name, a.item_brief) AGAINST(?1 IN NATURAL LANGUAGE MODE) as score from tb_cf_station_item a where a.item_name LIKE CONCAT('%',?1,'%') or a.item_name SOUNDS LIKE ?1 or MATCH(a.item_name, a.item_brief) AGAINST(?1 IN NATURAL LANGUAGE MODE) ORDER BY IF(a.item_name LIKE CONCAT('%',?1,'%'),10000,IF(a.item_name SOUNDS LIKE ?1,9999,score)) desc,a.create_time DESC limit ?2,?3",nativeQuery=true)
@Query(value="select count(*),MATCH(a.item_name, a.item_brief) AGAINST(?1 IN NATURAL LANGUAGE MODE) as score from tb_cf_station_item a where a.item_name LIKE CONCAT('%',?1,'%') or a.item_name SOUNDS LIKE ?1 or MATCH(a.item_name, a.item_brief) AGAINST(?1 IN NATURAL LANGUAGE MODE) ",nativeQuery=true)
@Query("select a from #{#entityName} a WHERE a.enableFlag = 1 and a.userId = :user_id and CURRENT_TIMESTAMP between a.startTime and a.endTime order by a.coupon.deductAmount desc ")
@Query("select a from #{#entityName} a WHERE a.enableFlag = 1 and a.userId = :user_id and CURRENT_TIMESTAMP between a.startTime and a.endTime order by a.coupon.deductAmount desc,a.toitableId asc ")