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>
上面的小于符号必须转议,否则不会识别 报错。