mybatis中的<if test=“”>test中多条件

代码展示:

其中

accountCode和apiName
都是ApiAllRespBean的属性
<select
id="getAllApiByApiName"
parameterType="pisen.cloud.luna.ms.account.api.beans.ApiAllRespBean"
resultType="pisen.cloud.luna.ms.account.api.beans.ApiAllRespBean"> SELECT ad.name apiName,
ad.uid apiUid,
aa.account_code accountCode,
aa.expire_date expireDate,
aa.expire_time expireTime,
aa.freeze_time freezeTime FROM
account_api aa INNER JOIN api_detail ad on aa.api_uid = ad.uid WHERE
account_code = #{accountCode} <if test="apiName != null and apiName != ''">
AND ad.name like '%' #{apiName} '%'
</if> </select>

【mybatis】mybatis中的<if test=“”>test中多条件的更多相关文章

  1. MyBatis中使用实体中使用枚举,数据库中使用数值

    一.简介 本文主要讲MyBatis中使用实体中使用枚举,数据库中使用数值的解决方案.正常直接使用会报错,需要添加typeHandlers在mybatis-config.xml中. 二.解决方案 如下: ...

  2. mybatis的mapper代理,SqlMapConfig.xml中配置,输入和输出映射使用案例

    public class User { private int id; private String username;// 用户姓名 private String sex;// 性别 private ...

  3. 【MyBatis学习05】SqlMapConfig.xml文件中的配置总结

    经过上两篇博文的总结,对mybatis中的dao开发方法和流程基本掌握了,这一节主要来总结一下mybatis中的全局配置文件SqlMapConfig.xml在开发中的一些常用配置,首先看一下该全局配置 ...

  4. mybatis中的map.xml文件中sql语句需要分号吗?

    mybatis中的map.xml文件中sql语句需要分号吗? :你是说sql介绍的分号吗?不需要的

  5. SpringMVC 实现POI读取Excle文件中数据导入数据库(上传)、导出数据库中数据到Excle文件中(下载)

    读取Excale表返回一个集合: package com.shiliu.game.utils; import java.io.File; import java.io.FileInputStream; ...

  6. springmvc 项目完整示例04 整合mybatis mybatis所需要的jar包 mybatis配置文件 sql语句 mybatis应用

    百度百科: MyBatis 本是apache的一个开源项目iBatis, 2010年这个项目由apache software foundation 迁移到了google code,并且改名为MyBat ...

  7. [MyBatis] MyBatis理论入门

    什么是MyBatis iBATIS提供的持久层框架包括SQL Maps和Data Access Objects(DAOs) 是一款优秀的持久层框架,它支持定制化 SQL.存储过程以及高级映射. MyB ...

  8. (转)MyBatis & MyBatis Plus

    (二期)3.mybatis与mybatis plus [课程三]mybatis ...运用.xmind0.1MB [课程三]mybatis...机制.xmind0.2MB [课程三]mybatis与j ...

  9. MyBatis -01- 初识 MyBatis + MyBatis 环境搭建

    MyBatis -01- 初识 MyBatis + MyBatis 环境搭建 MyBatis 本是 apache 的一个开源项目 iBatis(iBATIS = "internet" ...

随机推荐

  1. 【Luogu】P3228数列(数学题)

    题目链接 考虑我们把所有的增加量拿出来做成一个序列b. 那么在所有n中开头中$1~\sum\limits_{i=1}^{k-1}b[i]$是合法的 也就是说我们枚举所有b[i],然后答案就是$n*m^ ...

  2. BZOJ 1014 [JSOI2008]火星人prefix | Splay维护哈希值

    题目: 题解: #include<cstdio> #include<algorithm> #include<cstring> typedef long long l ...

  3. POJ3585:Accumulation Degree(换根树形dp)

    Accumulation Degree Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 3425   Accepted: 85 ...

  4. Java Nio注意事项

    Selector  : public abstract class Selector extends Object SelectableChannel 对象的多路复用器. 可通过调用此类的 open ...

  5. AGC007 - C Pushing Ball

    Description 题目链接 懒得写详细题意了, 放个链接 \(n\le 2*10^5\) 个球, \(n+1\) 个坑, 排成数轴, 球坑交替. 相邻球-坑距离为等差数列 \(d\). 给定首项 ...

  6. 将PHP程序中返回的JSON格式数据用gzip压缩输出

    //phpinfo(); 搜索下 zlib 是否开启 //此示例开启压缩 Content-Length:124 Size: 404B //未开启gzip压缩 Content-Length:675 Si ...

  7. Windows Server 2008允许多用户登录远程桌面

    远程桌面是windows管理员对服务器进行管理最常用的方式,默认情况下windows server服务器是只允许单个远程链接的,如何开启多个用户远程桌面,下面就来介绍.   工具/原料   windo ...

  8. HDU2669 Romantic

    Description The Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the Tr ...

  9. php 内核变量 引用计数器写时复制

    写时复制,是一个解决内存复用的方法,就是你在php语言层,如$d=$c=$b=$a='value';把$a赋给另一个或多个变量,这时这个变量都只占用一个内存块,当其中一个变量值改变时,才会开辟另一个内 ...

  10. OpenGL入门学习(五)

    http://developer.178.com/201103/94955548786.html 今天要讲的是三维变换的内容,课程比较枯燥.主要是因为很多函数在单独使用时都不好描述其效果,我只好在最后 ...