|
|
@ -9,6 +9,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -39,6 +40,27 @@ public interface FinancialBDPrizeLogMapper {
|
|
|
|
"GROUP BY fbpl.manager_id")
|
|
|
|
"GROUP BY fbpl.manager_id")
|
|
|
|
JSONObject findByReportAndBDTotal(@Param("record_id") String recordId, @Param("manager_id") String managerId);
|
|
|
|
JSONObject findByReportAndBDTotal(@Param("record_id") String recordId, @Param("manager_id") String managerId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Select("SELECT\n" +
|
|
|
|
|
|
|
|
"\tc.bd_name,\n" +
|
|
|
|
|
|
|
|
"\tc.manager_id,\n" +
|
|
|
|
|
|
|
|
"\tc.kpi_amount,\n" +
|
|
|
|
|
|
|
|
"\tsum( o.total * d.proportion ) AS total_amount \n" +
|
|
|
|
|
|
|
|
"FROM\n" +
|
|
|
|
|
|
|
|
"\tstatistics_customer_order o\n" +
|
|
|
|
|
|
|
|
"\tINNER JOIN sys_clients sc ON sc.client_id = o.client_id\n" +
|
|
|
|
|
|
|
|
"\tINNER JOIN sys_client_bd d ON o.client_id = d.client_id\n" +
|
|
|
|
|
|
|
|
"\tINNER JOIN financial_bd_config c ON d.bd_id = c.manager_id \n" +
|
|
|
|
|
|
|
|
"WHERE\n" +
|
|
|
|
|
|
|
|
"\tsc.org_id = 1 \n" +
|
|
|
|
|
|
|
|
"\tAND o.date >= #{start_date} \n" +
|
|
|
|
|
|
|
|
"\tAND o.date < #{end_date} \n" +
|
|
|
|
|
|
|
|
"\tAND d.start_date <= o.date AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date > o.date \n" +
|
|
|
|
|
|
|
|
"\t) \n" +
|
|
|
|
|
|
|
|
"\tAND c.get_prize = 1 \n" +
|
|
|
|
|
|
|
|
"\tAND c.manager_id = #{manager_id}")
|
|
|
|
|
|
|
|
JSONObject findByReportAndBDTotalRealTime(@Param("manager_id") String manage_id, @Param("start_date") Date start_date, @Param("end_date") Date end_date);
|
|
|
|
|
|
|
|
|
|
|
|
@Select("SELECT prize_log_id,record_id,manager_id,bd_name,bd_level,SUM(total_amount) total_amount," +
|
|
|
|
@Select("SELECT prize_log_id,record_id,manager_id,bd_name,bd_level,SUM(total_amount) total_amount," +
|
|
|
|
"SUM(total_prize) total_prize,SUM(total_donation) total_donation, SUM(send_prize) send_prize," +
|
|
|
|
"SUM(total_prize) total_prize,SUM(total_donation) total_donation, SUM(send_prize) send_prize," +
|
|
|
|
"SUM(hold_prize) hold_prize,last_punish,prize_type FROM financial_bd_prize_log fbpl " +
|
|
|
|
"SUM(hold_prize) hold_prize,last_punish,prize_type FROM financial_bd_prize_log fbpl " +
|
|
|
@ -67,4 +89,23 @@ public interface FinancialBDPrizeLogMapper {
|
|
|
|
"WHERE prize_type = 1 AND record_id = #{record_id}\n" +
|
|
|
|
"WHERE prize_type = 1 AND record_id = #{record_id}\n" +
|
|
|
|
"GROUP BY l.manager_id")
|
|
|
|
"GROUP BY l.manager_id")
|
|
|
|
List<JSONObject> findBdPrizeAmountAndBdType(@Param("record_id") String recordId);
|
|
|
|
List<JSONObject> findBdPrizeAmountAndBdType(@Param("record_id") String recordId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Select("SELECT\n" +
|
|
|
|
|
|
|
|
"\tc.*,\n" +
|
|
|
|
|
|
|
|
"\tsum( ( o.total ) * d.proportion ) AS total_amount\n" +
|
|
|
|
|
|
|
|
"FROM\n" +
|
|
|
|
|
|
|
|
"\tstatistics_customer_order o\n" +
|
|
|
|
|
|
|
|
"\tINNER JOIN sys_clients sc ON sc.client_id = o.client_id\n" +
|
|
|
|
|
|
|
|
"\tINNER JOIN sys_client_bd d ON o.client_id = d.client_id\n" +
|
|
|
|
|
|
|
|
"\tINNER JOIN financial_bd_config c ON d.bd_id = c.manager_id \n" +
|
|
|
|
|
|
|
|
"WHERE\n" +
|
|
|
|
|
|
|
|
"\tsc.org_id = 1 \n" +
|
|
|
|
|
|
|
|
"\tAND o.date >= #{start_date} \n" +
|
|
|
|
|
|
|
|
"\tAND o.date < #{end_date} \n" +
|
|
|
|
|
|
|
|
"\tAND d.start_date <= o.date AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date > o.date \n" +
|
|
|
|
|
|
|
|
"\t) \n" +
|
|
|
|
|
|
|
|
"\tAND c.get_prize = 1 \n" +
|
|
|
|
|
|
|
|
"GROUP BY\n" +
|
|
|
|
|
|
|
|
"\tc.bd_group")
|
|
|
|
|
|
|
|
List<JSONObject> findBdPrizeAmountRealTime(@Param("start_date") Date start_date, @Param("end_date") Date end_date);
|
|
|
|
}
|
|
|
|
}
|
|
|
|