mybatis xml中大于、小于、if else的写法
符号
① 转译字符
符号 | 代码 |
---|---|
< | < |
<= | <= |
> | > |
>= | >= |
② 将符号添加到 <![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>