3种数据库的xml模糊查询

来源:互联网 发布:办公室软件培训心得 编辑:程序博客网 时间:2024/06/05 15:20
  1. <select id="findList" resultType="DwfxGzysxl">    
  2.     SELECT     
  3. *
  4.     FROM a     
  5.     <where>    
  6.         <if test="name != null and name != ''">    
  7.         AND a.name LIKE     
  8.             <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>    
  9.             <if test="dbName == 'mssql'">'%'+#{name}+'%'</if>    
  10.             <if test="dbName == 'mysql'">concat('%',#{name},'%')</if>    
  11.         </if>    
  12.     </where>      
  13. </select>   
0 0
原创粉丝点击