提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
前言
1、mybatis比较数字或者单字母
<if test="logonRoleType!= null and logonRoleType == '1'.toString()">
</if>
2、mybatis使用if else
<choose>
<when test="sortProp != null and sortProp != ''">
order by t.${sortProp} ${sortOrder}
</when>
<otherwise>
order by t.user_id desc
</otherwise>
</choose>
3、mybatis使用case when
SELECT
CASE
WHEN test_result > 450 THEN 'HIGH'
WHEN test_result < 36 THEN 'LOW'
WHEN sex = 0 THEN '男'
WHEN sex = 1 THEN '女'
ELSE test_result
END AS testValue
FROM
aa
总结
以上就是今天要讲的内容,之后用到了在补充