|
@@ -34,20 +34,21 @@
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
<select id="selectTaskReplyList" resultType="java.util.HashMap">
|
|
|
- select * from ( select *from (
|
|
|
- select rp.CONTENT,rp.REPLYIDENTITIES,col.orderby,rp.TASKPUBUSERID
|
|
|
- from QT_TASKPUBCOLUMN col
|
|
|
- inner join QT_TASKREPLY rp
|
|
|
- on col.TASKPUBCOLID = rp.TASKPUBCOLID and rp.TASKPUBUSERID = #{userid}
|
|
|
- where rp.TASKPUBID=#{taskpubid}
|
|
|
- order by rp.RECEIVEDATE desc
|
|
|
- ) t pivot(max(t.CONTENT) for orderby in(
|
|
|
- <foreach collection="columnlist" item="it" separator=",">
|
|
|
- '${it.orderby}'
|
|
|
- </foreach>
|
|
|
- ))
|
|
|
- )tb1
|
|
|
- order by tb1."'${orderbyColumn}'"
|
|
|
+ SELECT
|
|
|
+ <foreach collection="columnlist" item="it" separator="," close=",">
|
|
|
+ MAX(CASE WHEN col.orderby = '${it.orderby}' THEN rp.CONTENT END) AS '${it.orderby}'
|
|
|
+ </foreach>
|
|
|
+ rp.REPLYIDENTITIES
|
|
|
+ FROM
|
|
|
+ QT_TASKPUBCOLUMN col
|
|
|
+ INNER JOIN QT_TASKREPLY rp ON col.TASKPUBCOLID = rp.TASKPUBCOLID
|
|
|
+ AND rp.TASKPUBUSERID = #{userid}
|
|
|
+ WHERE
|
|
|
+ rp.TASKPUBID = #{taskpubid}
|
|
|
+ GROUP BY
|
|
|
+ rp.REPLYIDENTITIES
|
|
|
+ ORDER BY
|
|
|
+ rp.RECEIVEDATE
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTaskReplySummary" resultType="java.util.HashMap" >
|