java mybatis 中sql 模糊查询
示例:
like concat('%',#{groupName},'%')
//--------------
<select id="findList" resultType="com.thinkgem.jeesite.modules.rule.entity.RuleCombinationModel">
SELECT
<include refid="cmsGuestbookColumns"/>
FROM t_zg_rule_group a
<where>
a.DELETE_STATUS = 0
<if test="groupNumber!='' and groupNumber!=null ">
and a.GROUP_NUMBER=#{groupNumber}
</if>
<if test="groupName!='' and groupName!=null ">
and a.GROUP_NAME like concat('%',#{groupName},'%')
<!-- concat('%',#{productName},'%') -->
</if>
<if test="groupStatus!='' and groupStatus!=null ">
and a.GROUP_STATUS=#{groupStatus}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.CREATEDON DESC
</otherwise>
</choose>
</select>
java mybatis 中sql 模糊查询的更多相关文章
- 8.mybatis动态SQL模糊查询 (多参数查询,使用parameterType)
多参数查询,使用parameterType.实例: 用户User[id, name, age] 1.mysql建表并插入数据 2.Java实体类 public class User { public ...
- Mybatis中的模糊查询
今天下午做的一个功能,要用到模糊查询,字段是description,刚开始我的写法用的是sql中的模糊查询语句, 但是这个有问题,只有将字段的全部值传入其中,才能查询,所以不是迷糊查询. 后来经过搜索 ...
- 关于mybatis中llike模糊查询中#和$的使用
模糊查询: 工作中用到,写三种用法吧,第四种为大小写匹配查询 1. sql中字符串拼接 SELECT * FROM tableName WHERE name LIKE CONCAT(CONCAT('% ...
- 如何在java List中进行模糊查询
比如我有下面这样一个List,里面存放的是多个Employee对象.然后我想对这个List进行按照Employee对象的名字进行模糊查询.有什么好的解决方案么? 比如我输入的查询条件为“wang”,那 ...
- mybatis中sql语句查询操作
动态sql where if where可以自动处理第一个and. <!-- 根据id查询用户信息 --> <!-- public User findUserById(int id) ...
- 【Mybatis】Mybatis的sql模糊查询
这个网站中有很多方法.https://code.google.com/p/mybatis/issues/detail?id=85 自己试验了如下的方法. 1. 参数中直接加入%% param.set ...
- 在MyBatis中采用模糊查询变量的引用标志应当是$而不是#
具体如下例: @Select("select count(*) from hy_stock where name like '%${keyword}%' or code like '%${k ...
- java使用elasticsearch进行模糊查询-已在项目中实际应用
java使用elasticsearch进行模糊查询 使用环境上篇文章本人已书写过,需要maven坐标,ES连接工具类的请看上一篇文章,以下是内容是笔者在真实项目中运用总结而产生,并写的是主要方法和思路 ...
- Jmeter中JDBC Request和BeanShell PostProcessor的结合使用(SQL模糊查询)
[前言] 今天记录一下Jmeter中JDBC Request和BeanShell PostProcessor的结合使用的方法(SQL模糊查询) [步骤] 1.下载对应数据库的驱动包到jmeter安装目 ...
随机推荐
- PHP 下的SSL加密设置
这个是报的错[Composer\Downloader\TransportException] The . OpenSSL Error messages: error::SSL routines:SSL ...
- [LintCode] Submatrix Sum 子矩阵之和
Given an integer matrix, find a submatrix where the sum of numbers is zero. Your code should return ...
- [LintCode] Valid Parentheses 验证括号
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the inpu ...
- MRP运算生成采购单时间的逻辑
由MRP运算产生的采购单日期,由生产单指定的安排计划日期.公司设置里的采购提前期和隐藏的供应商供货提前期三个字段共同决定. 可以很容易的在系统中找到,供应商供货提前期,需要在产品视图中将字段selle ...
- hao123列表的实现
<!DOCTYPE html><html><head> <meta http-equiv="Content-Type" co ...
- 兼容的firstChild,lastChild,nextSibling,previousSibling写法
在IE下是支持firstChild,lastChild,nextSibling,previousSibling 但是在FF下,由于它会把标签之间的空格当成文本节点,所以为了准确地找到相应的元素,会用 ...
- webapp 公共样式
html{ font-size: 62.5%;}@media only screen and (min-width: 481px) { html { font-size:94%!important } ...
- PHP后门新玩法:一款猥琐的PHP后门分析
0x00 背景 近日,360网站卫士安全团队近期捕获一个基于PHP实现的webshell样本,其巧妙的代码动态生成方式,猥琐的自身页面伪装手法,让我们在分析这个样本的过程中感受到相当多的乐趣.接下来就 ...
- 使用文件模拟ASM磁盘
尽管Oracle缺省都是使用裸设备来创建ASM磁盘,但其实Oracle也允许使用普通文件来创建ASM磁盘, 当然这种方法最好只用在测试环境下或者学习环境下,不能用在生产环境下.之所以必须要用裸设备, ...
- JQ 队列
<div class="divtt"> <div class="divtest"></div> </div> & ...