mybatis 多个参数传递获取,基础教程
2015-08-28 06:46
316 查看
一、mybatis传递多个参数时获取
parameterType="java.util.Map",参数依次为:param1,param2,param3.........
或者 #{0},#{1},#{2}。。。。。
二、条件判断
<where>
<if test="param1 != null and param1 != ''">
and t.kind = #{param1}//#号获取的是字符串,$获取的数值
</if>
<where>
传一个参数时:test中用 _parameter
匹配bean属性和表中字段
<resultMap id="tchannel" type="com.htcf.website.model.pojo.TChannel">
<result property="id" column="id" />
<result property="kind" column="kind" />
<result property="lob" column="lob" />
</resultMap>
三、特殊字符
<![CDATA[ ]]>
parameterType="java.util.Map",参数依次为:param1,param2,param3.........
或者 #{0},#{1},#{2}。。。。。
二、条件判断
<where>
<if test="param1 != null and param1 != ''">
and t.kind = #{param1}//#号获取的是字符串,$获取的数值
</if>
<where>
传一个参数时:test中用 _parameter
匹配bean属性和表中字段
<resultMap id="tchannel" type="com.htcf.website.model.pojo.TChannel">
<result property="id" column="id" />
<result property="kind" column="kind" />
<result property="lob" column="lob" />
</resultMap>
三、特殊字符
<![CDATA[ ]]>
相关文章推荐
- 看啊福卡
- 从零开始学Java之 出入门卫管理系统(一)
- JNI
- Jump Game
- 微信读书App来了 小伙伴们快去占榜吧
- Docker Compose—简化复杂应用的利器
- Linked List
- 工厂方法模式——23种设计模式综合实例应用
- 面向对象编程所需要遵循的原则
- 开放封闭原则OCP
- 2nd Round Google Interview
- leedcode做题总结, 题目Maximum Subarray II & Maximum Subarray Difference
- [LeetCode#210]Course Schedule II
- Js 和 PHP 中保留小数点后X位数的方法 toFixed、round、number_format、sprintf
- 找一找自己和大神之间的差距
- Leetcode #235 Lowest Common Ancestor of a Binary Search Tree
- Calculator| ||
- Leetcode #191 Number of 1 Bits
- Android Design Support Library之TabLayout
- 让Style帮你减少JAVA的错误