Mybatis字符串判断语法
<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