Mybatis动态SQL单一基础类型参数用if标签

Posted 迷茫王子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mybatis动态SQL单一基础类型参数用if标签相关的知识,希望对你有一定的参考价值。

Mybatis动态SQL单一基础类型参数用if标签时,test中应该用 _parameter,如:

<select id="selectByName" resultMap="ResultMap" parameterType="java.lang.String" >  
    select * from table1  
    <if test="_parameter != null">  
        where _name = #{name}  
    </if>  
</select>  

  

以上是关于Mybatis动态SQL单一基础类型参数用if标签的主要内容,如果未能解决你的问题,请参考以下文章