您的位置:首页 > 数据库

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

2014-09-24 14:02 381 查看
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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: