九、动态SQL(


一、 <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>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM