sql判断语句
方法一:
<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
總結
- 上一篇: mysql读书笔记----时间函数
- 下一篇: java学习(135):map中泛型使用