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

  1. mybatis的日志打印:

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

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

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

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

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

        select * spa

        from t_business_classificationmeta where 1=1 debug

        <if test="#{1} != null and #{1} != ''"> and TITLE = #{1}</if> 日志

        <if test="#{0} != null and #{0} != ''"> and CLASSIFICATIONCODE=#{0} </if> blog

    </select> io

 

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

相关文章
相关标签/搜索