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>  

  

posted @ 2017-12-12 22:20  迷茫王子  阅读(278)  评论(0编辑  收藏  举报