码迷,mamicode.com
首页 > 数据库 > 详细

Mybatis 的多个参数的使用和 sql日志的打印

时间:2015-05-14 11:38:17      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:

  1. mybatis的日志打印:

    在log4j.properties 里面添加如下的语句

#log4j.logger.org.apache.ibatis=debug,stdout

#log4j.logger.java.sql=debug,stdout

技术分享

  1. 多个String类型的参数的导入:

<select id="findCategoryByCN" parameterType="String" resultType="Map">

????????select *

????????from t_business_classificationmeta where 1=1

????????<if test="#{1} != null and #{1} != ‘‘"> and TITLE = #{1}</if>

????????<if test="#{0} != null and #{0} != ‘‘"> and CLASSIFICATIONCODE=#{0} </if>

????</select>

?

不是直接使用名称进行代替。

Mybatis 的多个参数的使用和 sql日志的打印

标签:

原文地址:http://www.cnblogs.com/ustc-cui/p/4502707.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!