|
@@ -0,0 +1,111 @@
|
|
|
+package com.mofangchuxing.aska.dao.mapper;
|
|
|
+
|
|
|
+import com.mofangchuxing.aska.dao.domain.AskaStat;
|
|
|
+import org.apache.ibatis.annotations.Insert;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
+
|
|
|
+/**
|
|
|
+* @author syl
|
|
|
+* @description 针对表【aska_stat】的数据库操作Mapper
|
|
|
+* @createDate 2023-09-20 10:09:32
|
|
|
+* @Entity com.mofangchuxing.aska.dao.domain.AskaStat
|
|
|
+*/
|
|
|
+public interface AskaStatMapper {
|
|
|
+
|
|
|
+ int deleteByPrimaryKey(Long id);
|
|
|
+
|
|
|
+ int insert(AskaStat record);
|
|
|
+
|
|
|
+ int insertSelective(AskaStat record);
|
|
|
+
|
|
|
+ AskaStat selectByPrimaryKey(Long id);
|
|
|
+
|
|
|
+ int updateByPrimaryKeySelective(AskaStat record);
|
|
|
+
|
|
|
+ int updateByPrimaryKey(AskaStat record);
|
|
|
+
|
|
|
+ // 平台收款,包含不可分账收款
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) \n" +
|
|
|
+ " select '平台','1', '收款', \n" +
|
|
|
+ " date(`pay_time`), count(*) `cc`, sum(`pay_amount`) `pay_amount`\n" +
|
|
|
+ " from `pay_request`\n" +
|
|
|
+ " where date(`pay_time`) = #{dateStr}")
|
|
|
+ void insertPayAmountStat(@Param("dateStr") String dateStr);
|
|
|
+
|
|
|
+ // 平台退款,包括不可分账退款
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) \n" +
|
|
|
+ " select '平台','1', '退款', \n" +
|
|
|
+ " date(`create_time`), count(*) cc, sum(`refund_amount`) \n" +
|
|
|
+ " from `refund_order` where date(`refund_order`.`create_time`) = #{dateStr}")
|
|
|
+ void insertRefundAmountStat(@Param("dateStr") String dateStr);
|
|
|
+
|
|
|
+ // 平台方同意的提现金额
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) select '平台','1', '提现', \n" +
|
|
|
+ " date(`payTime`), count(*) cc, sum(`requestAmount`) `amount`\n" +
|
|
|
+ " from `aska_cashrequest` where status='同意' or status='已付款' where date(`aska_cashrequest`.`payTime`) = #{dateStr}")
|
|
|
+ void insertRequestAmountStat(@Param("dateStr") String dateStr);
|
|
|
+
|
|
|
+ // 平台方计算给门店分账佣金
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) \n" +
|
|
|
+ " select '平台','1', '门店分账佣金', \n" +
|
|
|
+ " date(`createTime`), count(*) `cc`, sum(`retailRealtimeAmount`) `pay_amount`\n" +
|
|
|
+ " from `aska_splitrecord`\n" +
|
|
|
+ " where `recordType`=1 where date(`createTime`) = #{dateStr}")
|
|
|
+ void insertRetailAmountStat(@Param("dateStr") String dateStr);
|
|
|
+
|
|
|
+ // 平台方计算的给门店记账佣金
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) \n" +
|
|
|
+ " select '平台','1', '门店记账佣金', \n" +
|
|
|
+ " date(`createTime`), count(*) `cc`, sum(`retailAccountAmount`) `pay_amount`\n" +
|
|
|
+ " from `aska_splitrecord`\n" +
|
|
|
+ " where `recordType`=1 where date(`createTime`) = #{dateStr}")
|
|
|
+ void insertRetailAccountStat(@Param("dateStr") String dateStr);
|
|
|
+
|
|
|
+ // 平台方计算给门店分账退款
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) \n" +
|
|
|
+ " select '平台','1', '门店分账退款', \n" +
|
|
|
+ " date(`createTime`), count(*) `cc`, -sum(`retailRealtimeAmount`) `pay_amount`\n" +
|
|
|
+ " from `aska_splitrecord`\n" +
|
|
|
+ " where `recordType`=2 where date(`createTime`) = #{dateStr}")
|
|
|
+ void insertRetailRefundAmount(@Param("dateStr") String dateStr);
|
|
|
+
|
|
|
+ // 平台方计算门店记账退款
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) \n" +
|
|
|
+ " select '平台','1', '门店记账退款', \n" +
|
|
|
+ " date(`createTime`), count(*) `cc`, -sum(`retailAccountAmount`) `pay_amount`\n" +
|
|
|
+ " from `aska_splitrecord`\n" +
|
|
|
+ " where `recordType`=2 where date(`createTime`) = #{dateStr}")
|
|
|
+ void insertRetailRefundAccount(@Param("dateStr") String dateStr);
|
|
|
+
|
|
|
+ // 平台方计算渠道的分账佣金
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) \n" +
|
|
|
+ " select '平台','1', '渠道分账佣金', \n" +
|
|
|
+ " date(`createTime`), count(*) `cc`, sum(`channelRealtimeAmount`) `pay_amount`\n" +
|
|
|
+ " from `aska_splitrecord`\n" +
|
|
|
+ " where `recordType`=1 where date(`createTime`) = #{dateStr}")
|
|
|
+ void insertChannelAmount(@Param("dateStr") String dateStr);
|
|
|
+
|
|
|
+ // 平台方计算记账佣金
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) \n" +
|
|
|
+ " select '平台','1', '渠道记账佣金', \n" +
|
|
|
+ " date(`createTime`), count(*) `cc`, sum(`channelAccountAmount`) `pay_amount`\n" +
|
|
|
+ " from `aska_splitrecord`\n" +
|
|
|
+ " where `recordType`=1 where date(`createTime`) = #{dateStr}")
|
|
|
+ void insertChannelAccount(@Param("dateStr") String dateStr);
|
|
|
+
|
|
|
+ // 平台方计算分账佣金退款
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) \n" +
|
|
|
+ " select '平台','1', '渠道分账退款', \n" +
|
|
|
+ " date(`createTime`), count(*) `cc`, -sum(`channelRealtimeAmount`) `pay_amount`\n" +
|
|
|
+ " from `aska_splitrecord`\n" +
|
|
|
+ " where `recordType`=2 where date(`createTime`) = #{dateStr}")
|
|
|
+ void insertChannelRefundAmount(@Param("dateStr") String dateStr);
|
|
|
+
|
|
|
+ // 平台方计算记账佣金退款
|
|
|
+ @Insert("INSERT into `aska_stat`(`aType`,`aId`,`cType`,`statDay`,`orders`,`amount`) \n" +
|
|
|
+ " select '平台','1', '渠道记账退款', \n" +
|
|
|
+ " date(`createTime`), count(*) `cc`, -sum(`channelAccountAmount`) `pay_amount`\n" +
|
|
|
+ " from `aska_splitrecord`\n" +
|
|
|
+ " where `recordType`=2 where date(`createTime`) = #{dateStr}")
|
|
|
+ void insertChannelRefundAccount(@Param("dateStr") String dateStr);
|
|
|
+}
|