一、 <sql><include>
<sql>用于提取 SQL 语句, <include>用于引用 SQL 语句
1 <sql id="tb_user"> 2 id,user,passwd 3 </sql> 4 5 <select id="selIn" resultType="User" parameterType="list"> 6 select 7 <include refid="tb_user"/> 8 from tb_user where id in 9 <foreach collection="list" open="(" separator="," close=")" item="item"> 10 #{item} 11 </foreach> 12 </select>