Browse Source

修改查询语法适应MySQL数据库

suntg 8 năm trước cách đây
mục cha
commit
fba90fd4f1

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/store/dao/StoreInDao.java

@@ -61,7 +61,7 @@ public interface StoreInDao extends JpaSpecificationExecutor<StoreIn>, JpaReposi
 	 * @param num
 	 * @return
 	 */
-	@Query(nativeQuery = true, value = "SELECT * FROM (select * from store$info s where s.st_type in :types order by s.st_total_reserve desc) WHERE ROWNUM <= :num")
+	@Query(nativeQuery = true, value = "select * from store$info s where s.st_type in :types order by s.st_total_reserve desc LIMIT :num")
 	List<StoreIn> findFiveStoresByType(@Param("num") Integer num, @Param("types") List<String> types);
 
 	/**