当前位置:Gxlcms > 数据库问题 > Mybatis 的多个参数的使用和 sql日志的打印

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

时间:2021-07-01 10:21:17 帮助过:46人阅读

#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日志的打印

标签:

人气教程排行