你的位置:首页 > 软件开发 > Java > MyBatis动态SQL语句

MyBatis动态SQL语句

发布时间:2017-04-24 00:00:42
关键字1.if 条件2.choose , when 和 otherwise条件3.where 条件4.trim 条件5.forEach循环6.set 条件 一、if主要针对Map集合或者实体类 <select id="selectduo" para ...

MyBatis动态SQL语句

关键字

1.if 条件

2.choose , when 和 otherwise条件

3.where 条件

4.trim 条件

5.forEach循环

6.set 条件

 

一、if主要针对Map集合或者实体类

  <select id="selectduo" parameterType="Map" resultType="student" >    select * from student s where 1=1      <if test="sno!=null">      and s.sno=#{sno}       </if>      <if test="sname!=null">      and s.sname like #{sname}      </if>  </select>

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:MyBatis动态SQL语句

关键词:sql

sql
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。