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安装目 ...
随机推荐
- Java_CookieUtil
package com.willow.util; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequ ...
- script标签不带属性与带async、defer的区别
<script> 当页面解析到script标签时,会停止解析并下载对应的脚本,并马上执行,执行完毕后再继续解析页面 <script async> async 在下载脚本的同时不 ...
- pushState()、popstate事件配合ajax实现浏览器前进后退页面局部刷新
最近研究pushState,看了网上的文章还是不怎么会用,于是自己摸索着理解使用,终于实现局部刷新同时前进后退. 首先说说pushState(),这个函数将当前的url等信息加入history堆栈中: ...
- 如何用bat批处理编译swf项目
平时用FB等IDE编译多模块的游戏项目时,除了添加移除模块的操作很繁琐外,编译速度也非常之慢.而用bat来编译swf项目,速度非常快,稳定. 在此分享自己工作用的bat,每次运行会重新编译主模块Gam ...
- return和finally的执行顺序
创建一个类,新建一个方法: public class Demo { public int get() { int x=1; try { x++; return x; }finally{ ++x; } ...
- android中的ActionBar和ToolBar
一.ToolBar 1.概述 Google在2015的IO大会上发布了系列的Material Design风格的控件.其中ToolBar是替代ActionBar的控件.由于ActionBar在各个安卓 ...
- zk编程语言: 如何改变datebox框值的大小及高度
<?page title="" contentType="text/html;charset=UTF-8"?> <zk > <st ...
- IIS 注册4.0 Framework
打开cmd ,运行如下命令 C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
- 面试题-->写一个函数,返回一个数组中所有元素被第一个元素除的结果
package com.rui.test; import java.util.Random; /** * @author poseidon * @version 1.0 * @date:2015年10 ...
- modifiedvalues 主程序测试
##~ #-------------------------------------------------class InputFrame(wx.Frame):def __init__(self,t ...