方法一:
<if test="null != orderType and 0 == orderType">
order by amountTimes desc</if>
<if test="null != orderType and 1 == orderType">
order by amountTimes asc
</if>
<if test="null != orderType and 2 == orderType">
order by amountUsedTime desc
</if>
<if test="null != orderType and 3 == orderType">
order by amountUsedTime asc
</if>
<if test="null != orderType and 4 == orderType">
order by amountUsedTime/amountTimes desc
</if>
<if test="null != orderType and 5 == orderType">
order by amountUsedTime/amountTimes asc
</if>
方法二:
case
when timage.original_url is null then '/images/no_picture.gif'
when timage.original_url is null then '/images/no_picture.gif'
when timage.original_url is null then '/images/no_picture.gif'
else timage.original_url
end as tourgallery