sql语句choose/when/otherwise使用注意

sql语句choose/when/otherwise使用注意


1.test中的key不能使用特殊字符 - 或者 +
2.test中的判断仅对!= null有效,不能使用==对字符串判断
3.示例:

		<choose>
			<when test='sortIdOrder != null'>
				order by sort_id desc
			</when>
			<otherwise>
				order by create_time desc
			</otherwise>
		</choose>
发布了94 篇原创文章 · 获赞 44 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/qq_43639296/article/details/96569333
今日推荐