提交代码

yy_dev
胡锐 1 year ago
parent 17fa2006ce
commit 7843654179
  1. 60
      service/src/main/java/com/hfkj/dao/BsTradeOrderMapperExt.java
  2. 4
      service/src/main/java/com/hfkj/openapi/v1/utils/SignatureUtil.java

@ -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);
}

@ -83,8 +83,8 @@ public class SignatureUtil {
public static void main(String[] args) throws Exception {
String paramStr = "{\n" +
" \"merchantNo\": \"2023051910562136809\",\n" +
" \"billDateS\": 1688918400000,\n" +
" \"billDateE\": 1691596800000\n" +
" \"billDateS\": 1688140800000,\n" +
" \"billDateE\": 1690732800000,\n" +
"}";
String sign = createSign(JSONObject.parseObject(paramStr), "NGixVhkzVYFFMj8tjj4zOkYQtUiU3bd4");
System.out.println(sign);

Loading…
Cancel
Save