您的位置:首页 > 数据库

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

2015-05-14 10:43 519 查看
mybatis的日志打印:
在log4j.properties 里面添加如下的语句

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

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



多个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>

 

不是直接使用名称进行代替。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: