MyBatis Mapper.xml各种判断
来源:互联网 发布:不吃肉 知乎 编辑:程序博客网 时间:2024/05/18 01:19
1.判断String是否为空
<if test="stringParam != null and stringParam != ''"></if>
2.判断Integer是否大于0
<if test="idParam !=null and idParam gt 0"></if>3.判断List是否不为空
<if test="listParam !=null and listParam.size >0"></if>
4.判断String是否以某特定字符(比如此处的"user")开头
<if test="stringParam.indexOf('user') != -1"></if>5.判断字符串是否等于特定字符(比如此处的user)
<if test='stringParam != null and stringParam == "user"'></if>
注意不能使用此写法 <if test="stringParam != null and stringParam != 'user'"></if> 即最外边用双引号,里边用单引号,此写法会抱java.lang.NumberFormatException异常
如果要用这个写法要<if test="stringParam != null and stringParam != 'user'.toString()"></if>
阅读全文
0 0
- MyBatis Mapper.xml各种判断
- MyBatis Mapper.xml各种判断
- Mybatis mapper.xml 判断条件写法注意
- mybatis Mapper.xml 详解
- mybatis mapper.xml
- Mybatis(五)-Mapper.xml
- mybatis:Mapper XML Files
- Mybatis-mapper-xml-基础
- mybatis mapper.xml详解
- mybatis and mapper.xml
- mybatis的mapper XML
- MyBatis mapper.xml 详解
- MyBatis mapper.xml配置文件
- mybatis mapper.xml详解
- MyBatis Mapper XML 文件 01
- MyBatis Mapper XML 文件 02
- mybatis mapper.xml方法配置
- Mybatis热加载Mapper.xml
- poj3714 Raid (分治)
- Swing自动扫描服务程序总结
- 2011 Heilongjiang collegiate programming contest 【(7+1)/10】 [补完]
- ubuntu和win时间不匹配
- K近邻法(KNN)原理小结
- MyBatis Mapper.xml各种判断
- 算法--动态规划
- pycaffe对于图片的加载与训练
- 用netscope可视化caffe的prototxt网络结构
- Android studio 快速 app Build running
- POJ1700
- FrameLayout的顺序,以及elevation对其顺序的影响,CardView的上层放了一个Button,为什么Button看不到了
- 广告检索一致率排查过程
- VxWOrks信号量