ITeye博客

Mybatis字符串判断语法

後知後觉c · 2019-04-10 16:19 · Mybatis · 编程语言 · Markdown

<select id="findIdIsNull" resultType="string">
        select XSID from LY_CKBZ_GXJW_XSLSXXB where BJID = #{bjdm} and XH is null
        <if test="type == '1'.toString()">
            order by NLSSORT(XM,'NLS_SORT = SCHINESE_PINYIN_M')
        </if>
        <if test="type == '2'.toString()">
            order by KSH
        </if>
    </select>

 

XML的字符串判断语法:

不能写成 <if test="type == '1'">

正确写法:

<if test='type=="y"'>

<if test="type == 'y'.toString()"> 

 

--摘自https://blog.csdn.net/xl19961223/article/details/81362696

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。