|
@@ -149,7 +149,7 @@
|
|
|
<where>
|
|
<where>
|
|
|
and t.tradefeetype in (101,102,201,202,301,302,110,108,109,103,104,107,211,212,311,312)
|
|
and t.tradefeetype in (101,102,201,202,301,302,110,108,109,103,104,107,211,212,311,312)
|
|
|
<if test="vo.tradedate != null and vo.tradedate != '' ">
|
|
<if test="vo.tradedate != null and vo.tradedate != '' ">
|
|
|
- and t.tradedate = #{tradedate,jdbcType=CHAR}
|
|
|
|
|
|
|
+ and t.tradedate = #{vo.tradedate,jdbcType=CHAR}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.areaid != null">
|
|
<if test="vo.areaid != null">
|
|
|
<choose>
|
|
<choose>
|
|
@@ -382,8 +382,8 @@
|
|
|
<when test="vo.cycletype==0">
|
|
<when test="vo.cycletype==0">
|
|
|
SELECT
|
|
SELECT
|
|
|
T.RECKONDATE,
|
|
T.RECKONDATE,
|
|
|
- T.GOODSID,
|
|
|
|
|
- T.MARKETID,
|
|
|
|
|
|
|
+ g.goodsname,
|
|
|
|
|
+ m.marketname,
|
|
|
SUM(T.TRADEQTY) TRADEQTY,
|
|
SUM(T.TRADEQTY) TRADEQTY,
|
|
|
SUM(T.OPENQTY) OPENQTY,
|
|
SUM(T.OPENQTY) OPENQTY,
|
|
|
SUM(T.CLOSEQTY) CLOSEQTY,
|
|
SUM(T.CLOSEQTY) CLOSEQTY,
|
|
@@ -394,6 +394,8 @@
|
|
|
FROM RECKON_DAYACCOUNTTRADE T
|
|
FROM RECKON_DAYACCOUNTTRADE T
|
|
|
inner join taaccount ta on t.accountid = ta.accountid
|
|
inner join taaccount ta on t.accountid = ta.accountid
|
|
|
inner join useraccount ua on ta.userid in ua.userid
|
|
inner join useraccount ua on ta.userid in ua.userid
|
|
|
|
|
+ inner join goods g on g.goodsid = T.goodsid
|
|
|
|
|
+ inner join market m on m.marketid = T.marketid
|
|
|
<where>
|
|
<where>
|
|
|
<if test="vo.userid != null and vo.userid != ''">
|
|
<if test="vo.userid != null and vo.userid != ''">
|
|
|
and ua.memberuserid = #{vo.userid}
|
|
and ua.memberuserid = #{vo.userid}
|
|
@@ -402,14 +404,14 @@
|
|
|
and T.reckondate=#{vo.cycletime}
|
|
and T.reckondate=#{vo.cycletime}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
- group by T.RECKONDATE, T.GOODSID, T.MARKETID
|
|
|
|
|
|
|
+ group by T.RECKONDATE,g.goodsname, m.marketname
|
|
|
</when>
|
|
</when>
|
|
|
<otherwise>
|
|
<otherwise>
|
|
|
SELECT
|
|
SELECT
|
|
|
T.CYCLETIME as reckondate,
|
|
T.CYCLETIME as reckondate,
|
|
|
T.CYCLETYPE,
|
|
T.CYCLETYPE,
|
|
|
- T.GOODSID,
|
|
|
|
|
- T.MARKETID,
|
|
|
|
|
|
|
+ g.goodsname,
|
|
|
|
|
+ m.marketname,
|
|
|
SUM(T.TRADEQTY) TRADEQTY,
|
|
SUM(T.TRADEQTY) TRADEQTY,
|
|
|
SUM(T.OPENQTY) OPENQTY,
|
|
SUM(T.OPENQTY) OPENQTY,
|
|
|
SUM(T.CLOSEQTY) CLOSEQTY,
|
|
SUM(T.CLOSEQTY) CLOSEQTY,
|
|
@@ -420,6 +422,8 @@
|
|
|
FROM REPORT_DAYACCOUNTTRADE T
|
|
FROM REPORT_DAYACCOUNTTRADE T
|
|
|
inner join taaccount ta on t.accountid = ta.accountid
|
|
inner join taaccount ta on t.accountid = ta.accountid
|
|
|
inner join useraccount ua on ta.userid in ua.userid
|
|
inner join useraccount ua on ta.userid in ua.userid
|
|
|
|
|
+ inner join goods g on g.goodsid = T.goodsid
|
|
|
|
|
+ inner join market m on m.marketid = T.marketid
|
|
|
<where>
|
|
<where>
|
|
|
<if test="vo.userid != null and vo.userid != ''">
|
|
<if test="vo.userid != null and vo.userid != ''">
|
|
|
and ua.memberuserid = #{vo.userid}
|
|
and ua.memberuserid = #{vo.userid}
|
|
@@ -431,7 +435,7 @@
|
|
|
and T.CYCLETIME = #{vo.cycletime}
|
|
and T.CYCLETIME = #{vo.cycletime}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
- group by T.CYCLETIME, t.CYCLETYPE, T.GOODSID, T.MARKETID
|
|
|
|
|
|
|
+ group by T.CYCLETIME, t.CYCLETYPE,g.goodsname, m.marketname
|
|
|
</otherwise>
|
|
</otherwise>
|
|
|
</choose>
|
|
</choose>
|
|
|
</select>
|
|
</select>
|
|
@@ -439,53 +443,57 @@
|
|
|
<select id="queryOrgReckonSum" parameterType="com.muchinfo.mtp3pojos.vo.reportform.OrgReportQueryParam"
|
|
<select id="queryOrgReckonSum" parameterType="com.muchinfo.mtp3pojos.vo.reportform.OrgReportQueryParam"
|
|
|
resultType="com.muchinfo.mtp3pojos.vo.reportform.OrgReportQueryResult">
|
|
resultType="com.muchinfo.mtp3pojos.vo.reportform.OrgReportQueryResult">
|
|
|
select
|
|
select
|
|
|
|
|
+ t.userid as "userId",
|
|
|
|
|
+ t.reckondate as "cycleTime",
|
|
|
|
|
+ ua.userid || '/' || ua.accountname as "accountName",
|
|
|
<if test="vo.type == 1">
|
|
<if test="vo.type == 1">
|
|
|
<!-- 包含子机构 -->
|
|
<!-- 包含子机构 -->
|
|
|
- sum(nvl(t.investorinamount2, 0)) as "investorInAmount",
|
|
|
|
|
- sum(nvl(t.investoroutamount2, 0)) as "investorOutAmount",
|
|
|
|
|
- sum(nvl(t.investorclosepl2, 0)) as "investorClosePl",
|
|
|
|
|
- sum(nvl(t.investorreckonpl2, 0)) as "investorReckonPl",
|
|
|
|
|
- sum(nvl(t.investorbuytradeqty2, 0)) as "investorBuyTradeQty",
|
|
|
|
|
- sum(nvl(t.investorselltradeqty2, 0)) as "investorSellTradeQty",
|
|
|
|
|
- sum(nvl(t.investortradefee2, 0)) as "investorTradeFee",
|
|
|
|
|
- sum(nvl(t.investordeliveryfee2, 0)) as "investorDeliveryFee",
|
|
|
|
|
- sum(nvl(t.investorholdfee2, 0)) as "investorHoldFee",
|
|
|
|
|
- sum(nvl(t.investorbuydeliveryamount2, 0)) as "investorBuyDeliveryAmount",
|
|
|
|
|
- sum(nvl(t.investorusedmargin2, 0)) as "investorusedmargin",
|
|
|
|
|
- sum(nvl(t.investorbuyholdqty2, 0)) as "investorBuyHoldQty",
|
|
|
|
|
- sum(nvl(t.investorsellholdqty2, 0)) as "investorSellHoldQty",
|
|
|
|
|
- sum(nvl(t.investorsignqty2, 0)) as "investorSignQty",
|
|
|
|
|
- sum(nvl(t.investortotalnum2, 0)) as "investorTotalNum",
|
|
|
|
|
- sum(nvl(t.investortrialnum2, 0)) as "investorTrialNum",
|
|
|
|
|
- sum(nvl(t.investorretrialnum2, 0)) as "investorRetrialNum",
|
|
|
|
|
- sum(nvl(t.investoramount2, 0)) as "investorAmount"
|
|
|
|
|
|
|
+ t.investortotalnum2 as "investorTotalNum",
|
|
|
|
|
+ t.investortrialnum2 as "investorTrialNum",
|
|
|
|
|
+ t.investorretrialnum2 as "investorRetrialNum",
|
|
|
|
|
+ t.investorsignqty2 as "investorSignQty",
|
|
|
|
|
+ t.investorinamount2 as "investorInAmount",
|
|
|
|
|
+ t.investoroutamount2 as "investorOutAmount",
|
|
|
|
|
+ t.investoramount2 as "investorAmount",
|
|
|
|
|
+ t.investorclosepl2 as "investorClosePl",
|
|
|
|
|
+ t.investorreckonpl2 as "investorReckonPl",
|
|
|
|
|
+ t.investorbuytradeqty2 as "investorBuyTradeQty",
|
|
|
|
|
+ t.investorselltradeqty2 as "investorSellTradeQty",
|
|
|
|
|
+ t.investorbuyholdqty2 as "investorBuyHoldQty",
|
|
|
|
|
+ t.investorsellholdqty2 as "investorSellHoldQty",
|
|
|
|
|
+ t.investortradefee2 as "investorTradeFee",
|
|
|
|
|
+ t.investordeliveryfee2 as "investorDeliveryFee",
|
|
|
|
|
+ t.investorholdfee2 as "investorHoldFee",
|
|
|
|
|
+ t.investorbuydeliveryamount2 as "investorBuyDeliveryAmount",
|
|
|
|
|
+ t.investorselldeliveryamount2 as "investorSellDeliveryAmount",
|
|
|
|
|
+ t.investorusedmargin2 as "investorusedmargin"
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.type != 1">
|
|
<if test="vo.type != 1">
|
|
|
- sum(nvl(t.investorinamount, 0)) as "investorInAmount",
|
|
|
|
|
- sum(nvl(t.investoroutamount, 0)) as "investorOutAmount",
|
|
|
|
|
- sum(nvl(t.investorclosepl, 0)) as "investorClosePl",
|
|
|
|
|
- sum(nvl(t.investorreckonpl, 0)) as "investorReckonPl",
|
|
|
|
|
- sum(nvl(t.investorbuytradeqty, 0)) as "investorBuyTradeQty",
|
|
|
|
|
- sum(nvl(t.investorselltradeqty, 0)) as "investorSellTradeQty",
|
|
|
|
|
- sum(nvl(t.investortradefee, 0)) as "investorTradeFee",
|
|
|
|
|
- sum(nvl(t.investordeliveryfee, 0)) as "investorDeliveryFee",
|
|
|
|
|
- sum(nvl(t.investorholdfee, 0)) as "investorHoldFee",
|
|
|
|
|
- sum(nvl(t.investorbuydeliveryamount, 0)) as "investorBuyDeliveryAmount",
|
|
|
|
|
- sum(nvl(t.investorusedmargin, 0)) as "investorusedmargin",
|
|
|
|
|
- sum(nvl(t.investorbuyholdqty, 0)) as "investorBuyHoldQty",
|
|
|
|
|
- sum(nvl(t.investorsellholdqty, 0)) as "investorSellHoldQty",
|
|
|
|
|
- sum(nvl(t.investorsignqty, 0)) as "investorSignQty",
|
|
|
|
|
- sum(nvl(t.investortotalnum, 0)) as "investorTotalNum",
|
|
|
|
|
- sum(nvl(t.investortrialnum, 0)) as "investorTrialNum",
|
|
|
|
|
- sum(nvl(t.investorretrialnum, 0)) as "investorRetrialNum",
|
|
|
|
|
- sum(nvl(t.investoramount, 0)) as "investorAmount"
|
|
|
|
|
|
|
+ t.investortotalnum as "investorTotalNum",
|
|
|
|
|
+ t.investortrialnum as "investorTrialNum",
|
|
|
|
|
+ t.investorretrialnum as "investorRetrialNum",
|
|
|
|
|
+ t.investorsignqty as "investorSignQty",
|
|
|
|
|
+ t.investorinamount as "investorInAmount",
|
|
|
|
|
+ t.investoroutamount as "investorOutAmount",
|
|
|
|
|
+ t.investoramount as "investorAmount",
|
|
|
|
|
+ t.investorclosepl as "investorClosePl",
|
|
|
|
|
+ t.investorreckonpl as "investorReckonPl",
|
|
|
|
|
+ t.investorbuytradeqty as "investorBuyTradeQty",
|
|
|
|
|
+ t.investorselltradeqty as "investorSellTradeQty",
|
|
|
|
|
+ t.investorbuyholdqty as "investorBuyHoldQty",
|
|
|
|
|
+ t.investorsellholdqty as "investorSellHoldQty",
|
|
|
|
|
+ t.investortradefee as "investorTradeFee",
|
|
|
|
|
+ t.investordeliveryfee as "investorDeliveryFee",
|
|
|
|
|
+ t.investorholdfee as "investorHoldFee",
|
|
|
|
|
+ t.investorbuydeliveryamount as "investorBuyDeliveryAmount",
|
|
|
|
|
+ t.investorselldeliveryamount as "investorSellDeliveryAmount",
|
|
|
|
|
+ t.investorusedmargin as "investorusedmargin"
|
|
|
</if>
|
|
</if>
|
|
|
from reckon_daymember t
|
|
from reckon_daymember t
|
|
|
left join useraccount ua on t.userid=ua.userid
|
|
left join useraccount ua on t.userid=ua.userid
|
|
|
<where>
|
|
<where>
|
|
|
<if test="vo.reckondate != null and vo.reckondate != '' and vo.reckondateend != null and vo.reckondateend != ''">
|
|
<if test="vo.reckondate != null and vo.reckondate != '' and vo.reckondateend != null and vo.reckondateend != ''">
|
|
|
- and (t.reckondate >= #{vo.reckondate,jdbcType=CHAR} and t.reckondate <=
|
|
|
|
|
- #{vo.reckondateend,jdbcType=CHAR})
|
|
|
|
|
|
|
+ and (t.reckondate >= #{vo.reckondate,jdbcType=CHAR} and t.reckondate <= #{vo.reckondateend,jdbcType=CHAR})
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.accountid !=null and vo.accountid != '' ">
|
|
<if test="vo.accountid !=null and vo.accountid != '' ">
|
|
|
and t.userid = #{vo.accountid}
|
|
and t.userid = #{vo.accountid}
|
|
@@ -508,6 +516,9 @@
|
|
|
<select id="queryOrgReportSum" parameterType="com.muchinfo.mtp3pojos.vo.reportform.OrgReportQueryParam"
|
|
<select id="queryOrgReportSum" parameterType="com.muchinfo.mtp3pojos.vo.reportform.OrgReportQueryParam"
|
|
|
resultType="com.muchinfo.mtp3pojos.vo.reportform.OrgReportQueryResult">
|
|
resultType="com.muchinfo.mtp3pojos.vo.reportform.OrgReportQueryResult">
|
|
|
select
|
|
select
|
|
|
|
|
+ t.userid as "userId",
|
|
|
|
|
+ t.cycletime as "cycleTime",
|
|
|
|
|
+ ua.userid || '/' || ua.accountname as "accountName",
|
|
|
<if test="vo.type == 1">
|
|
<if test="vo.type == 1">
|
|
|
<!-- 包含子机构 -->
|
|
<!-- 包含子机构 -->
|
|
|
sum(nvl(t.investorinamount2, 0)) as "investorInAmount",
|
|
sum(nvl(t.investorinamount2, 0)) as "investorInAmount",
|
|
@@ -580,6 +591,7 @@
|
|
|
</choose>
|
|
</choose>
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
|
|
+ GROUP BY t.userid, t.cycletime, ua.accountname, ua.userid
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="queryReckonDayTa" parameterType="com.muchinfo.mtp3pojos.vo.reportform.InvestorReportQueryParam"
|
|
<select id="queryReckonDayTa" parameterType="com.muchinfo.mtp3pojos.vo.reportform.InvestorReportQueryParam"
|
|
@@ -625,18 +637,16 @@
|
|
|
and (ra.reckondate >= #{vo.reckondate,jdbcType=CHAR} and ra.reckondate <=
|
|
and (ra.reckondate >= #{vo.reckondate,jdbcType=CHAR} and ra.reckondate <=
|
|
|
#{vo.reckondateend,jdbcType=CHAR})
|
|
#{vo.reckondateend,jdbcType=CHAR})
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="vo.flag != null and vo.flag == 0">
|
|
|
|
|
- and ua.usertype=5
|
|
|
|
|
- </if>
|
|
|
|
|
|
|
+ and ua.usertype=5
|
|
|
<if test="vo.memberid !=null and vo.memberid != ''">
|
|
<if test="vo.memberid !=null and vo.memberid != ''">
|
|
|
- and ua.subarealevelpath like concat('%','#{vo.memberid}', '%')
|
|
|
|
|
|
|
+ and ua.subarealevelpath like '%'||#{vo.memberid}||'%'
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.accountid !=null and vo.accountid != '' ">
|
|
<if test="vo.accountid !=null and vo.accountid != '' ">
|
|
|
and ra.userid = #{vo.accountid}
|
|
and ra.userid = #{vo.accountid}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.subareaid !=null and vo.subareaid != ''">
|
|
<if test="vo.subareaid !=null and vo.subareaid != ''">
|
|
|
and us.subarealevelpath like
|
|
and us.subarealevelpath like
|
|
|
- concat('%','#{vo.subareaid}', '%')
|
|
|
|
|
|
|
+ '%'||#{vo.subareaid}||'%'
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.brokerid !=null and vo.brokerid != ''">
|
|
<if test="vo.brokerid !=null and vo.brokerid != ''">
|
|
|
and ua.broker = #{vo.brokerid }
|
|
and ua.broker = #{vo.brokerid }
|
|
@@ -900,15 +910,17 @@
|
|
|
ra.floatpl,
|
|
ra.floatpl,
|
|
|
ra.floatnetvalue,
|
|
ra.floatnetvalue,
|
|
|
ra.riskrate,
|
|
ra.riskrate,
|
|
|
- ra.otherincome
|
|
|
|
|
|
|
+ ra.otherincome,
|
|
|
|
|
+ u.memberuserid || '/' || t.accountname memberaccountname
|
|
|
from REPORT_TAACCOUNT ra
|
|
from REPORT_TAACCOUNT ra
|
|
|
left join useraccount ua on ra.userid=ua.userid
|
|
left join useraccount ua on ra.userid=ua.userid
|
|
|
left join useraccount us on ua.parentuserid=us.userid
|
|
left join useraccount us on ua.parentuserid=us.userid
|
|
|
left join loginaccount la on ra.userid = la.userid
|
|
left join loginaccount la on ra.userid = la.userid
|
|
|
|
|
+ left join taaccount ta on ta.accountid = ra.accountid
|
|
|
|
|
+ left join useraccount u on ta.userid = u.userid
|
|
|
|
|
+ left join useraccount t on u.memberuserid = t.userid
|
|
|
<where>
|
|
<where>
|
|
|
- <if test="vo.flag != null and vo.flag == 0">
|
|
|
|
|
- and ua.usertype=5
|
|
|
|
|
- </if>
|
|
|
|
|
|
|
+ and ua.usertype=5
|
|
|
<if test="vo.usertype != null">
|
|
<if test="vo.usertype != null">
|
|
|
and ua.usertype=#{vo.usertype}
|
|
and ua.usertype=#{vo.usertype}
|
|
|
</if>
|
|
</if>
|
|
@@ -928,14 +940,14 @@
|
|
|
and ra.userid = #{vo.accountid}
|
|
and ra.userid = #{vo.accountid}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.memberid !=null and vo.memberid != ''">
|
|
<if test="vo.memberid !=null and vo.memberid != ''">
|
|
|
- and ua.subarealevelpath like concat('%','#{vo.memberid}', '%')
|
|
|
|
|
|
|
+ and ua.subarealevelpath like '%'||#{vo.memberid}||'%'
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.brokerid !=null and vo.brokerid != ''">
|
|
<if test="vo.brokerid !=null and vo.brokerid != ''">
|
|
|
and ua.broker = #{vo.brokerid}
|
|
and ua.broker = #{vo.brokerid}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.subareaid !=null and vo.subareaid != ''">
|
|
<if test="vo.subareaid !=null and vo.subareaid != ''">
|
|
|
and us.subarealevelpath like
|
|
and us.subarealevelpath like
|
|
|
- concat('%','#{vo.subareaid}', '%')
|
|
|
|
|
|
|
+ '%'||#{vo.subareaid}||'%'
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.parentuserid != null">
|
|
<if test="vo.parentuserid != null">
|
|
|
<choose>
|
|
<choose>
|
|
@@ -953,10 +965,10 @@
|
|
|
</choose>
|
|
</choose>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.inamount != null and vo.inamount !='' ">
|
|
<if test="vo.inamount != null and vo.inamount !='' ">
|
|
|
- and ra.inamount >= #{vo.inamount}
|
|
|
|
|
|
|
+ and ra.inamount >= #{vo.inamount, jdbcType=DECIMAL}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="vo.outamount != null and vo.outamount !='' ">
|
|
<if test="vo.outamount != null and vo.outamount !='' ">
|
|
|
- and ra.outamount >= #{outamount}
|
|
|
|
|
|
|
+ and ra.outamount >= #{vo.outamount, jdbcType=DECIMAL}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
group by ra.cycletype,
|
|
group by ra.cycletype,
|
|
@@ -985,8 +997,9 @@
|
|
|
ra.floatpl,
|
|
ra.floatpl,
|
|
|
ra.floatnetvalue,
|
|
ra.floatnetvalue,
|
|
|
ra.riskrate,
|
|
ra.riskrate,
|
|
|
- ra.otherincome
|
|
|
|
|
-
|
|
|
|
|
|
|
+ ra.otherincome,
|
|
|
|
|
+ u.memberuserid,
|
|
|
|
|
+ t.accountname
|
|
|
<choose>
|
|
<choose>
|
|
|
<when test="vo.sortfield != null and vo.sortfield == 1">
|
|
<when test="vo.sortfield != null and vo.sortfield == 1">
|
|
|
<choose>
|
|
<choose>
|