明天的明天 永远的永远 未知的一切 我与你一起承担 ??

是非成败转头空 青山依旧在 几度夕阳红 。。。
  博客园  :: 首页  :: 管理

JPA Query in 集合(:和?传参)

Posted on 2023-08-06 16:36  且行且思  阅读(89)  评论(0编辑  收藏  举报

? 传参

    @Query(value = "SELECT * FROM tuxinggeo AS sti WHERE type = ?1 AND index = ?2", nativeQuery = true)
    List<TuxingGeo> getLayerByTypeAndIndex(int type, int index);

: 传参

    @Query(value = "SELECT * FROM tuxinggeo AS sti WHERE type = :sti_type AND index = :sti_index AND town in (:townlist) ", nativeQuery = true)
    List<TuxingGeo> getLayerByTypeAndIndex2(@Param("sti_type") int sti_type,@Param("sti_index") int sti_index,@Param("townlist") String[] townlist);