MyBatis DAO层有多个参数的处理
来源:互联网 发布:淘宝上怎么购买呼死你 编辑:程序博客网 时间:2024/04/19 20:36
<!-- query multi param filter -->
<sql id="query_multi_param_filter">
<if test='_parameter.get("0").id!=null and _parameter.get("0").id!=""'>
id = #{0.id},
</if>
<if test='_parameter.get("0").title!=null and _parameter.get("0").title!=""'>
and title = #{0.title},
</if>
<if test='_parameter.get("0").sellPoint!=null and _parameter.get("0").sellPoint!=""'>
and sell_point like #{0.sellPoint},
</if>
<if test='_parameter.get("0").price!=null'>
and price = #{price},
</if>
<if test='_parameter.get("0").num!=null'>
and num = #{0.num},
</if>
<if test='_parameter.get("0").barcode!=null and _parameter.get("0").barcode!=""'>
and barcode = #{0.barcode},
</if>
<if test='_parameter.get("0").categoryId!=null and _parameter.get("0").categoryId!=""'>
and category_id = #{0.categoryId},
</if>
<if test='_parameter.get("0").status!=null'>
and status = #{0.status}
</if>
<sql id="query_multi_param_filter">
<if test='_parameter.get("0").id!=null and _parameter.get("0").id!=""'>
id = #{0.id},
</if>
<if test='_parameter.get("0").title!=null and _parameter.get("0").title!=""'>
and title = #{0.title},
</if>
<if test='_parameter.get("0").sellPoint!=null and _parameter.get("0").sellPoint!=""'>
and sell_point like #{0.sellPoint},
</if>
<if test='_parameter.get("0").price!=null'>
and price = #{price},
</if>
<if test='_parameter.get("0").num!=null'>
and num = #{0.num},
</if>
<if test='_parameter.get("0").barcode!=null and _parameter.get("0").barcode!=""'>
and barcode = #{0.barcode},
</if>
<if test='_parameter.get("0").categoryId!=null and _parameter.get("0").categoryId!=""'>
and category_id = #{0.categoryId},
</if>
<if test='_parameter.get("0").status!=null'>
and status = #{0.status}
</if>
</sql>
_parameter.get("0")可以获取对应的参数,0为用@Param("0")注解的参数
注意: _parameter.get("0")中0必须用双引号,外边用单引号
阅读全文
0 0
- MyBatis DAO层有多个参数的处理
- mybatis参数的处理
- transBean2Map,Dao层里的参数处理
- Mybatis DAO层参数传递
- Mybatis DAO层参数传递
- Mybatis DAO层参数传递
- Mybatis的Dao向mapper传多个参数(三种解决方案)
- mybatis穿对象和参数 的处理
- mybatis参数处理
- mybatis-参数处理-11
- mybatis参数处理
- MyBatis 参数处理
- mybatis如何处理参数
- spring+mybatis的公用DAO
- myBatis查询dao的循序
- Mybatis原始的dao开发
- mybatis之dao的开发
- MyBatis的Dao层开发
- idea中刷新页面无反应
- 找出不是两个数组共有的元素
- Metasploit 攻击
- 无界面 socket通信模拟在线评测
- 解决Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- MyBatis DAO层有多个参数的处理
- consul UI用127可以访问,指定ip无法访问
- 微信网页授权,获取微信code,获取access_tocken,获取用户信息
- c++三种继承方式
- pip install requests 报错 Could not fetch URL https://pypi.python.org/simple/requests/: There was ..r
- 套接字编程4 ------ 动态生成多线程并发扫描服务器端口的实例
- idea安装报错-NSIS Error-Installer integrity check has failed.......
- 超简单的滑动视图实现
- (微信公众号开发《一》OAuth2.0网页授权认证获取用户的详细信息,实现自动登陆)http://blog.csdn.net/liaohaojian/article/details/70175835