|
|
@@ -1522,4 +1522,142 @@
|
|
|
</where>
|
|
|
order by r.areaid,r.areatype,r.areaaccountid
|
|
|
</select>
|
|
|
+ <select id="queryDODPage" resultType="com.muchinfo.mtp3pojos.vo.reportform.ReckonDivideOrderDetailResult">
|
|
|
+ select t.tradeid, t.tradefeetype, t.areaid, t.areatype, t.buyorsell,
|
|
|
+ t.tradedate, t.accountid,t.areaaccountid,
|
|
|
+ t.goodsid, t.feeamount, t.dividetype, t.dividevalue, t.divideamount,
|
|
|
+ t.creatdate,m.trademode
|
|
|
+ from RECKON_DIVIDEORDERDETAIL t
|
|
|
+ left join (
|
|
|
+ select t.goodsid,t.goodscode,t.goodsname,t.marketid from goods t
|
|
|
+ union
|
|
|
+ select t.goodsid,t.goodscode,t.goodsname,t.marketid from presale_listinginfo t
|
|
|
+ union
|
|
|
+ select t.goodsid,t.goodscode,t.goodsname,t.marketid from auction_orderinfo t
|
|
|
+ union
|
|
|
+ select t.goodsid,t.goodscode,t.goodsname,t.marketid from his_presale_listinginfo t where t.isvaliddata = 1
|
|
|
+ union
|
|
|
+ select t.goodsid,t.goodscode,t.goodsname,t.marketid from his_auction_orderinfo t where t.isvaliddata = 1
|
|
|
+ union
|
|
|
+ select t.goodsid, t.goodscode,t.goodscode goodsname,t.marketid from his_tender_tenderinfo t where t.isvaliddata
|
|
|
+ = 1
|
|
|
+ union
|
|
|
+ select t.goodsid, t.goodscode, t.goodscode goodsname,t.marketid from tender_tenderinfo t
|
|
|
+ ) g on t.goodsid = g.goodsid
|
|
|
+ left join market m on g.marketid = m.marketid
|
|
|
+ <where>
|
|
|
+ <if test="vo.areaid != null">
|
|
|
+ and t.areaid = #{vo.areaid,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="vo.areatype != null">
|
|
|
+ and t.areatype = #{vo.areatype,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="vo.areaaccountid != null">
|
|
|
+ and t.areaaccountid = #{vo.areaaccountid,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="vo.tradefeetype != null">
|
|
|
+ and t.tradefeetype = #{vo.tradefeetype,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="vo.goodsid != null and vo.goodsid != ''">
|
|
|
+ <choose>
|
|
|
+ <when test="vo.searchtype==1">
|
|
|
+ and t.goodsid = #{vo.goodsid,jdbcType=DECIMAL}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and t.goodsid = #{vo.goodsid,jdbcType=DECIMAL}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="vo.startDate != null and vo.startDate != '' and vo.endDate != null and vo.endDate != '' ">
|
|
|
+ and (t.tradedate >= #{vo.startDate} and t.tradedate <= #{vo.endDate})
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by t.tradedate
|
|
|
+ </select>
|
|
|
+ <select id="queryReckonAGDivideDetail"
|
|
|
+ resultType="com.muchinfo.mtp3pojos.vo.reportform.ReckonDivideOrderDetailResult">
|
|
|
+ <choose>
|
|
|
+ <when test="vo.areatype==12">
|
|
|
+ select t.tradedate,t.accountid,t.goodsid,t.parentuserid,t.dividetype,
|
|
|
+ t.dividevalue,t.divideamount,t.dividemode,t.marketid,t.totalcount,
|
|
|
+ ua.userid "relateduserid",
|
|
|
+ ua.accountname "accountname",
|
|
|
+ <choose>
|
|
|
+ <when test="vo.searchtype==1">
|
|
|
+ t.totalfeeamount feeamount
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ t.feeamount
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ from Reckon_SubAGDivideDetail t
|
|
|
+ left join taaccount ta on t.accountid = ta.accountid
|
|
|
+ left join useraccount ua on ta.userid = ua.userid
|
|
|
+ <where>
|
|
|
+ <if test="vo.areaid != null">
|
|
|
+ <![CDATA[and t.parentuserid = #{vo.areaid}]]>
|
|
|
+ </if>
|
|
|
+ <if test="vo.goodsid != null">
|
|
|
+ <choose>
|
|
|
+ <when test="vo.searchtype==1">
|
|
|
+ <!-- and t.marketid = #{goodsid,jdbcType=DECIMAL} -->
|
|
|
+ and t.goodsid = #{goodsid,jdbcType=DECIMAL}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and t.goodsid = #{goodsid,jdbcType=DECIMAL}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="vo.tradefeetype != null">
|
|
|
+ <![CDATA[and t.tradefeetype = #{vo.tradefeetype}]]>
|
|
|
+ </if>
|
|
|
+ <if test="vo.startDate != null and vo.startDate != '' and vo.endDate != null and vo.endDate != '' ">
|
|
|
+ and (t.tradedate >= #{vo.startDate} and t.tradedate <= #{vo.endDate})
|
|
|
+ </if>
|
|
|
+ <if test="vo.areatype != null and vo.areatype != '' ">
|
|
|
+ and t.areatype = #{vo.areatype}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ select t.*,
|
|
|
+ ua.accountname "accountname" from Reckon_AGDivideDetail t
|
|
|
+ left join useraccount ua on t.relateduserid = ua.userid
|
|
|
+ <where>
|
|
|
+ <if test="vo.memberuserid != null">
|
|
|
+ <![CDATA[and t.memberuserid = #{vo.memberuserid}]]>
|
|
|
+ </if>
|
|
|
+ <if test="vo.parentuserid != null">
|
|
|
+ <![CDATA[and t.parentuserid = #{vo.parentuserid}]]>
|
|
|
+ </if>
|
|
|
+ <if test="vo.accountid != null">
|
|
|
+ <![CDATA[and t.accountid = #{vo.accountid}]]>
|
|
|
+ </if>
|
|
|
+ <if test="vo.areaid != null">
|
|
|
+ <![CDATA[and t.areaid = #{vo.areaid}]]>
|
|
|
+ </if>
|
|
|
+ <if test="vo.goodsid != null">
|
|
|
+ <choose>
|
|
|
+ <when test="vo.searchtype==1">
|
|
|
+ <!-- and t.marketid = #{goodsid,jdbcType=DECIMAL} -->
|
|
|
+ and t.goodsid = #{vgoodsid,jdbcType=DECIMAL}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and t.goodsid = #{vo.goodsid,jdbcType=DECIMAL}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="vo.tradefeetype != null">
|
|
|
+ <![CDATA[and t.tradefeetype = #{vo.tradefeetype}]]>
|
|
|
+ </if>
|
|
|
+ <if test="vo.startDate != null and vo.startDate != '' and vo.endDate != null and vo.endDate != '' ">
|
|
|
+ and (t.tradedate >= #{vo.startDate} and t.tradedate <= #{vo.endDate})
|
|
|
+ </if>
|
|
|
+ <if test="vo.areatype != null and vo.areatype != '' ">
|
|
|
+ and t.areatype = #{vo.areatype}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
</mapper>
|