|
|
@@ -54,6 +54,11 @@
|
|
|
with ps as(
|
|
|
select p.*,st.steptypename from performancestep p
|
|
|
left join performancesteptype st on p.steptypeid=st.steptypeid
|
|
|
+ <where>
|
|
|
+ <if test="vo.performancePlanId != null and vo.performancePlanId != '' ">
|
|
|
+ AND p.planid = #{vo.performancePlanId,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
)
|
|
|
select p.performanceplanid,
|
|
|
'- -' "histradedate",
|
|
|
@@ -109,6 +114,24 @@
|
|
|
left join taaccount buyta on p.buyaccountid = buyta.accountid
|
|
|
left join taaccount sellta on p.sellaccountid = sellta.accountid
|
|
|
<where>
|
|
|
+ <if test="vo.performancePlanId != null and vo.performancePlanId != '' ">
|
|
|
+ AND p.performancePlanId =
|
|
|
+ #{vo.performancePlanId,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="vo.buyId != null and vo.buyId != '' ">
|
|
|
+ AND p.buyAccountId in (select accountid from taaccount
|
|
|
+ where userid = #{vo.buyId,jdbcType=DECIMAL})
|
|
|
+ </if>
|
|
|
+ <if test="vo.sellId != null and vo.sellId != '' ">
|
|
|
+ AND p.sellAccountId in (select accountid from taaccount
|
|
|
+ where userid = #{vo.sellId,jdbcType=DECIMAL})
|
|
|
+ </if>
|
|
|
+ <if test="vo.buyAccountId != null and vo.buyAccountId != '' ">
|
|
|
+ AND p.buyAccountId like '%'||#{vo.buyAccountId}||'%'
|
|
|
+ </if>
|
|
|
+ <if test="vo.sellAccountId != null and vo.sellAccountId != '' ">
|
|
|
+ AND p.sellAccountId like '%'||#{vo.sellAccountId}||'%'
|
|
|
+ </if>
|
|
|
<if test="vo.relatedorderid != null and vo.relatedorderid != '' ">
|
|
|
AND p.relatedOrderId like
|
|
|
'%'||#{vo.relatedorderid}||'%'
|
|
|
@@ -118,22 +141,13 @@
|
|
|
<![CDATA[and ps.remaindays < 0]]>
|
|
|
</if>
|
|
|
</if>
|
|
|
- <choose>
|
|
|
- <when test="type = 0 ">
|
|
|
- <if test="accountid != null and accountid != '' ">
|
|
|
- AND p.buyAccountId in (select accountid from taaccount
|
|
|
- where userid = #{accountid})
|
|
|
- </if>
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- <if test="accountid != null and accountid != '' ">
|
|
|
- AND p.sellAccountId in (select accountid from taaccount
|
|
|
- where userid = #{accountid})
|
|
|
- </if>
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
+ <if test="vo.performancetype != null and vo.performancetype != '' ">
|
|
|
+ AND p.performancetype = #{vo.performancetype,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="vo.performanceStatus != null and vo.performanceStatus != '' ">
|
|
|
+ AND p.performancestatus = #{vo.performanceStatus,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
<if test="vo.parentuserid != null and vo.parentuserid!=0">
|
|
|
-
|
|
|
and (buyta.userid in (select userid from useraccount uo
|
|
|
start with uo.userid = #{vo.parentuserid}
|
|
|
connect by prior uo.userid =uo.parentuserid and uo.userid !=#{vo.parentuserid})
|
|
|
@@ -155,6 +169,9 @@
|
|
|
left join performancesteptype st on p.steptypeid=st.steptypeid
|
|
|
<where>
|
|
|
and p.isvaliddata = 1
|
|
|
+ <if test="vo.performancePlanId != null and vo.performancePlanId != '' ">
|
|
|
+ AND p.planid = #{performancePlanId,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
<if test="vo.starttime != null and vo.starttime != '' ">
|
|
|
AND p.histradedate >= #{vo.starttime}
|
|
|
</if>
|
|
|
@@ -210,6 +227,24 @@
|
|
|
left join taaccount buyta on p.buyaccountid = buyta.accountid
|
|
|
left join taaccount sellta on p.sellaccountid = sellta.accountid
|
|
|
where p.performancestatus in(3,6,7,8) and p.isvaliddata = 1
|
|
|
+ <if test="vo.performancePlanId != null and vo.performancePlanId != '' ">
|
|
|
+ AND p.performancePlanId =
|
|
|
+ #{vo.performancePlanId,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="vo.buyId != null and vo.buyId != '' ">
|
|
|
+ AND p.buyAccountId in (select accountid from taaccount
|
|
|
+ where userid = #{vo.buyId,jdbcType=DECIMAL})
|
|
|
+ </if>
|
|
|
+ <if test="vo.sellId != null and vo.sellId != '' ">
|
|
|
+ AND p.sellAccountId in (select accountid from taaccount
|
|
|
+ where userid = #{vo.sellId,jdbcType=DECIMAL})
|
|
|
+ </if>
|
|
|
+ <if test="vo.buyAccountId != null and vo.buyAccountId != '' ">
|
|
|
+ AND p.buyAccountId like '%'||#{vo.buyAccountId}||'%'
|
|
|
+ </if>
|
|
|
+ <if test="vo.sellAccountId != null and vo.sellAccountId != '' ">
|
|
|
+ AND p.sellAccountId like '%'||#{vo.sellAccountId}||'%'
|
|
|
+ </if>
|
|
|
<if test="vo.relatedorderid != null and vo.relatedorderid != '' ">
|
|
|
AND p.relatedOrderId like
|
|
|
'%'||#{vo.relatedorderid}||'%'
|
|
|
@@ -220,20 +255,12 @@
|
|
|
<if test="vo.endtime != null and vo.endtime != '' ">
|
|
|
AND p.histradedate <= #{vo.endtime}
|
|
|
</if>
|
|
|
- <choose>
|
|
|
- <when test="type = 0 ">
|
|
|
- <if test="accountid != null and accountid != '' ">
|
|
|
- AND p.buyAccountId in (select accountid from taaccount
|
|
|
- where userid = #{accountid})
|
|
|
- </if>
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- <if test="accountid != null and accountid != '' ">
|
|
|
- AND p.sellAccountId in (select accountid from taaccount
|
|
|
- where userid = #{accountid})
|
|
|
- </if>
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
+ <if test="vo.performancetype != null and vo.performancetype != '' ">
|
|
|
+ AND p.performancetype = #{vo.performancetype,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="vo.performanceStatus != null and vo.performanceStatus != '' ">
|
|
|
+ AND p.performancestatus = #{vo.performanceStatus,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
<if test="vo.searchrange != null ">
|
|
|
<if test="vo.searchrange == -1 ">
|
|
|
<![CDATA[and ps.remaindays < 0]]>
|