第一种方式
<if test="orderBy != null">
order by
<choose>
<when test='orderBy=="age"'>age</when>
<when test='orderBy=="size"'>size</when>
<when test='orderBy=="price"'>price</when>
<otherwise>
<otherwise> ${orderBy} </otherwise>
</otherwise>
</choose>
</if>
第二种方式
<choose>
<when test="null != handleType">
group by car_number order by handle_type
</when>
<!-- 没有激活排序条件时,默认热门倒序排序 -->
<otherwise>
group by car_number order by vio_time desc
</otherwise>
</choose>