mybatis xml中大于、小于、if else的写法

符号

① 转译字符

符号 代码
< &lt;
<= &lt;=
> &gt;
>= &gt;=

② 将符号添加到 <![CDATA[ ]]> 中

<![CDATA[ >= ]]> <![CDATA[ <= ]]>

if else

单个 if 标签

test 中 写 if 条件 并是and 或是or

<if test="">
	<!-- 内容 -->
</if>
if else 标签

test 中 写 if 条件 并是and 或是or

<choose>
   	<when test="">
   		<!-- if 内容 -->
   	</when>
   	<when test="">
   		<!-- else if 内容 -->
   	</when>
   	<otherwise>
   		<!-- else 内容 -->
   	</otherwise>
</choose>
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐