mybatis integer 类型0传值问题。
2015-12-03 09:18
323 查看
新手, 接触mybatis 有几个月了,刚开始遇到过
<if test="status!=null and status!=''"> and status = '${status}' </if>
当我status 传入参数为0的时候(Integer status ),到if 条件时,就不执行,被识别成 ‘’ 了。
以前我的做法是把
and status != '' 这句去掉。昨天又遇到这个问题了,然后就再去百度了一下,还可以这样写:
<if test="status!=null and status!='' or status == 0"> and status = '${status}' </if>但是我现在还是不知道为什么 integer 类型的 0 传入后会变成 ‘’,谁知道...求告知...
相关文章推荐
- SQL Server 聚合函数算法优化技巧
- iOS开发-AFNetworking 怎样上传数据? 怎样上传模拟表单
- C# 如何用多字符分割字符串
- webstrom 10 注册码
- 程序员思考
- PHP不同版本之特性
- HPP
- 【Some】【Other】100小时定律
- 【Some】【Other】100小时定律
- 【Some】【Other】100小时定律
- 【Some】【Other】100小时定律
- 【Some】【Other】100小时定律
- 【Some】【Other】100小时定律
- 【Some】【Other】100小时定律
- 【Some】【Other】100小时定律
- 各个时间段对应使用的Xcode版本以及iOS版本。
- 前端开发调试线上代码的两款工具
- 【Codeforces Round 334 (Div 2)E】【博弈-SG函数】Lieges of Legendre n个数 每次取数-1或者变2x为k个x的博弈
- 使用POI实现在java程序中导入导出Excel文件数据
- LMAX Disruptor——一个高性能、低延迟且简单的框架