|
|
|
@ -33,7 +33,7 @@ public interface BsTradeOrderMapperExt { |
|
|
|
|
Map<String,Object> countTradeOrderPrice(@Param("param") Map<String, Object> param); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Select("<script>" + |
|
|
|
|
/* @Select("<script>" + |
|
|
|
|
" select " + |
|
|
|
|
" a.days settleDay," + |
|
|
|
|
" #{param.merNo} merNo, " + |
|
|
|
@ -79,6 +79,64 @@ public interface BsTradeOrderMapperExt { |
|
|
|
|
" ) b on b.settle_date = a.days " + |
|
|
|
|
" ORDER BY a.days desc;" + |
|
|
|
|
" </script>") |
|
|
|
|
*/ |
|
|
|
|
@Select("<script>" + |
|
|
|
|
" select " + |
|
|
|
|
" a.settleDay, " + |
|
|
|
|
" #{param.merNo} merNo, " + |
|
|
|
|
" (a.tradeNum + b.tradeNum) tradeNum, " + |
|
|
|
|
" (a.tradeAmount - b.tradeAmount) tradeAmount, " + |
|
|
|
|
" (a.settleAmount - b.settleAmount) settleAmount, " + |
|
|
|
|
" (a.shdFeeAmount - b.shdFeeAmount) shdFeeAmount " + |
|
|
|
|
" from " + |
|
|
|
|
" (select " + |
|
|
|
|
" a.days settleDay, " + |
|
|
|
|
" case when b.tradeNum is null then 0 else b.tradeNum end tradeNum, " + |
|
|
|
|
" case when b.tradeAmount is null then 0 else b.tradeAmount end tradeAmount, " + |
|
|
|
|
" case when b.settleAmount is null then 0 else b.settleAmount end settleAmount, " + |
|
|
|
|
" case when b.shdFeeAmount is null then 0 else b.shdFeeAmount end shdFeeAmount " + |
|
|
|
|
" from ( " + |
|
|
|
|
" SELECT date_add(date_sub(#{param.settleTimeS},interval 1 day), INTERVAL ( cast( help_topic_id AS signed INTEGER ) + 1 ) day) days " + |
|
|
|
|
" FROM mysql.help_topic " + |
|
|
|
|
" WHERE help_topic_id <![CDATA[ < ]]> DATEDIFF(#{param.settleTimeE},date_sub(#{param.settleTimeS},interval 1 day)) ORDER BY help_topic_id) a " + |
|
|
|
|
" LEFT JOIN (select " + |
|
|
|
|
" settle_date, " + |
|
|
|
|
" count(1) tradeNum, " + |
|
|
|
|
" sum(trade_amount) tradeAmount, " + |
|
|
|
|
" sum(settle_amount) settleAmount, " + |
|
|
|
|
" sum(shd_fee_amt) shdFeeAmount " + |
|
|
|
|
" from bs_trade_settle " + |
|
|
|
|
" where settle_date between #{param.settleTimeS} and #{param.settleTimeE} " + |
|
|
|
|
" and mer_no = #{param.merNo} " + |
|
|
|
|
" and trade_type = 1 " + |
|
|
|
|
" and `status` = 1 " + |
|
|
|
|
" GROUP BY settle_date " + |
|
|
|
|
" ) b on b.settle_date = a.days) a, " + |
|
|
|
|
" (select " + |
|
|
|
|
" a.days settleDay, " + |
|
|
|
|
" case when b.tradeNum is null then 0 else b.tradeNum end tradeNum, " + |
|
|
|
|
" case when b.tradeAmount is null then 0 else b.tradeAmount end tradeAmount, " + |
|
|
|
|
" case when b.settleAmount is null then 0 else b.settleAmount end settleAmount, " + |
|
|
|
|
" case when b.shdFeeAmount is null then 0 else b.shdFeeAmount end shdFeeAmount " + |
|
|
|
|
" from ( " + |
|
|
|
|
" SELECT date_add(date_sub(#{param.settleTimeS},interval 1 day), INTERVAL ( cast( help_topic_id AS signed INTEGER ) + 1 ) day) days " + |
|
|
|
|
" FROM mysql.help_topic " + |
|
|
|
|
" WHERE help_topic_id <![CDATA[ < ]]> DATEDIFF(#{param.settleTimeE},date_sub(#{param.settleTimeS},interval 1 day)) ORDER BY help_topic_id) a " + |
|
|
|
|
" LEFT JOIN (select " + |
|
|
|
|
" settle_date, " + |
|
|
|
|
" count(1) tradeNum, " + |
|
|
|
|
" sum(trade_amount) tradeAmount, " + |
|
|
|
|
" sum(settle_amount) settleAmount, " + |
|
|
|
|
" sum(shd_fee_amt) shdFeeAmount " + |
|
|
|
|
" from bs_trade_settle " + |
|
|
|
|
" where settle_date between #{param.settleTimeS} and #{param.settleTimeE} " + |
|
|
|
|
" and mer_no = #{param.merNo} " + |
|
|
|
|
" and trade_type = 2 " + |
|
|
|
|
" and `status` = 1 " + |
|
|
|
|
" GROUP BY settle_date " + |
|
|
|
|
" ) b on b.settle_date = a.days) b where b.settleDay = a.settleDay " + |
|
|
|
|
" ORDER BY a.settleDay desc" + |
|
|
|
|
"</script>") |
|
|
|
|
List<Map<String,Object>> queryTradeOrderDetailCount(@Param("param") Map<String, Object> param); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|