Mybaitis if标签转义问题

来源:互联网 发布:网点分布图制作软件 编辑:程序博客网 时间:2024/06/18 13:02


mybaitis标签中没有else标签 不知为何这么设计,


<sql id="getAllWhere"><if test="condition != null"><if test="condition.type >=10"> and g.type > #{condition.type}</if><if test="condition.type gt 10"> and g.type > #{condition.type}</if></if><if test="sort != null "> <!-- 时间排序 --><if test="order != null"> order by #{sort} #{order} </if><if test="order == null"> order by #{sort} desc </if></if></sql>


<if test="condition.type gt 10"> and g.type > #{condition.type}</if>


上面的小于符号必须转议,否则不会识别 报错。

原创粉丝点击