大概場景就是導入Excel表的時候 裏面有超過1000多個學生,這種狀況查詢這1000個學生若是用in的話就會超過長度限制.java
如今的解決思路就是把 要查詢的數據當成一張表來查詢 而後進行連表查詢get
大概語句以下it
<select id="getSchool" resultMap="ExcelModelSchool" parameterClass="java.util.List">io
SELECT
T .SCHOOL_NAME school_Name,
T ."ID" school_Id ,
T.ISMANAGER ISMANAGER
FROM
(select * from (
<iterate open="(" close=")" conjunction=",">
<![CDATA[
SELECT
#list[]# sname
FROM dual
]]>
</iterate>
)) s,
T_SCHOOL T
WHERE
T .SCHOOL_NAME =s.sname
</select>List