|
@@ -90,21 +90,37 @@
|
|
|
and f.inception_date <![CDATA[ <= ]]> #{endDate}
|
|
|
</if>) a
|
|
|
<choose>
|
|
|
- <when test="sort != null and sort !='' and sort=='lastPriceDate' and order != null and order !=''">
|
|
|
+ <when test="sort != null and sort=='lastPriceDate' and order != null and order =='asc'">
|
|
|
order by
|
|
|
CASE
|
|
|
WHEN a.lastPriceDate IS NULL THEN 1
|
|
|
ELSE 0
|
|
|
END,
|
|
|
- a.lastPriceDate #{order}
|
|
|
+ a.lastPriceDate asc
|
|
|
</when>
|
|
|
- <when test="sort != null and sort !='' and sort=='firstPriceDate' and order != null and order !=''">
|
|
|
+ <when test="sort != null and sort=='lastPriceDate' and order != null and order =='desc'">
|
|
|
+ order by
|
|
|
+ CASE
|
|
|
+ WHEN a.lastPriceDate IS NULL THEN 1
|
|
|
+ ELSE 0
|
|
|
+ END,
|
|
|
+ a.lastPriceDate desc
|
|
|
+ </when>
|
|
|
+ <when test="sort != null and sort !='' and sort=='firstPriceDate' and order != null and order =='asc'">
|
|
|
+ order by
|
|
|
+ CASE
|
|
|
+ WHEN a.firstPriceDate IS NULL THEN 1
|
|
|
+ ELSE 0
|
|
|
+ END,
|
|
|
+ a.firstPriceDate asc
|
|
|
+ </when>
|
|
|
+ <when test="sort != null and sort !='' and sort=='firstPriceDate' and order != null and order =='desc'">
|
|
|
order by
|
|
|
CASE
|
|
|
WHEN a.firstPriceDate IS NULL THEN 1
|
|
|
ELSE 0
|
|
|
END,
|
|
|
- a.firstPriceDate #{order}
|
|
|
+ a.firstPriceDate desc
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
order by a.lastPriceDate desc
|