波神

导航

myBatis中if test 字符串注意事项

错误写法:

            <if test="userName == 'boshen'">
                AND `USER_NAME` = #{userName}
            </if>

正确写法:

            <if test='userName == "boshen"'>
                AND `USER_NAME` = #{userName}
            </if>

            <if test="userName == 'boshen'.toString()">
                AND `USER_NAME` = #{userName}
            </if>

 

posted on 2018-12-19 15:34  波神  阅读(366)  评论(0编辑  收藏  举报