MyBatis中xml文件中模糊查询的写法
来源:互联网 发布:淘宝店如何提升销量 编辑:程序博客网 时间:2024/05/17 23:23
数据库中某表的一个字段为name,我需要对它进行模糊查询的时候使用了下面的方法,解决了这个问题。
<select id="findList" resultType="DwfxGzysxl"> SELECT <include refid="dwfxGzysxlColumns"/> FROM v_dwfx_gzysxl a <include refid="dwfxGzysxlJoins"/> <where> <if test="name != null and name != ''"> AND a.name LIKE <if test="dbName == 'oracle'">'%'||#{name}||'%'</if> <if test="dbName == 'mssql'">'%'+#{name}+'%'</if> <if test="dbName == 'mysql'">concat('%',#{name},'%')</if> </if> </where> <choose> <when test="page !=null and page.orderBy != null and page.orderBy != ''"> ORDER BY ${page.orderBy} </when> </choose> </select>
1 1
- MyBatis中xml文件中模糊查询的写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的写法总结
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- Mybatis中模糊查询的各种写法
- mybatis中模糊查询的写法
- mybatis中模糊查询的写法
- Mybatis中模糊查询的各种写法
- JSPatch在Swift项目中的使用
- 20161215C语言基础14_函数
- 任务栏出现两列点状
- webpack教程
- ORM——基本思想
- MyBatis中xml文件中模糊查询的写法
- SVN更新的时候前面的U与G是什么意思?
- js apply和js call方法详解
- 如何抑制索引的使用
- 关于使用JSPatch重写setter方法
- java 简单的工厂设计模式
- Git-- .gitignore忽略规则概述
- 何甘霖 js的基本数据类型和typeof的关系
- 究竟什么样的leader是称职的?