mybatis中if-else

2022-08-16 16:00:48 浏览数 (1)

mybatisif-else要用choose-when-otherwise

代码语言:javascript复制
<choose>
	<when test="page !=null and page.orderBy != null and page.orderBy != ''">
		ORDER BY ${page.orderBy}
	</when>
	<otherwise>
		ORDER BY a.update_date DESC
	</otherwise>
</choose>

0 人点赞