## 兼容1:2新拓展收益,计算首购复购比例;
This commit is contained in:
parent
03d8f8572b
commit
7848b05e46
|
@ -23,42 +23,7 @@
|
||||||
<select id="queryCuBonusStatis" parameterType="com.hzs.member.statis.vo.CuBonusStatisVO"
|
<select id="queryCuBonusStatis" parameterType="com.hzs.member.statis.vo.CuBonusStatisVO"
|
||||||
resultType="com.hzs.member.statis.vo.CuBonusStatisVO">
|
resultType="com.hzs.member.statis.vo.CuBonusStatisVO">
|
||||||
SELECT
|
SELECT
|
||||||
cbs.PK_BD_VERTEX pkVertex,
|
cbs.*,
|
||||||
cbs.PK_TEAM_CODE pkTeamCode,
|
|
||||||
ver.VERTEX_NAME as vertexName,
|
|
||||||
ct.TEAM_NAME as teamName,
|
|
||||||
cbs.PK_ID pkId,
|
|
||||||
cbs.PERIOD period,
|
|
||||||
cbs.CREATION_TIME creationTime,
|
|
||||||
cbs.PK_COUNTRY pkCountry,
|
|
||||||
<!-- PV字段 -->
|
|
||||||
cbs.MAIN_REG_PV mainRegPv,
|
|
||||||
cbs.MAIN_UP_PV mainUpPv,
|
|
||||||
cbs.MAIN_REPUR_PV mainRepurPv,
|
|
||||||
cbs.SPECIAL_REGISTER_PV specialRegisterPv,
|
|
||||||
cbs.SPECIAL_UPGRADE_PV specialUpgradePv,
|
|
||||||
cbs.SPECIAL_REPURCHASE_PV specialRepurchasePv,
|
|
||||||
cbs.FICTITIOUS_PV fictitiousPv,
|
|
||||||
cbs.MALL_PV mallPv,
|
|
||||||
cbs.COOPERATE_PV cooperatePv,
|
|
||||||
cbs.WELFARE_ORDER_PV welfareOrderPv,
|
|
||||||
<!-- 金额字段 -->
|
|
||||||
cbs.main_reg_amount mainRegAmount,
|
|
||||||
cbs.main_up_amount mainUpAmount,
|
|
||||||
cbs.main_repur_amount mainRepurAmount,
|
|
||||||
cbs.special_register_amount,
|
|
||||||
cbs.special_upgrade_amount,
|
|
||||||
cbs.special_repurchase_amount,
|
|
||||||
<!-- 奖金字段 -->
|
|
||||||
cbs.INTRODUCE_BONUS introduceBonus,
|
|
||||||
cbs.ORG_BONUS orgBonus,
|
|
||||||
cbs.LEADER_BONUS leaderBonus,
|
|
||||||
cbs.SERVICE_BONUS serviceBonus,
|
|
||||||
cbs.REPUR_RANGE_BONUS repurRangeBonus,
|
|
||||||
cbs.REPUR_ORG_BONUS repurOrgBonus,
|
|
||||||
cbs.repur_leader_bonus repurLeaderBonus,
|
|
||||||
cbs.pur_real_subtotal purRealSubtotal,
|
|
||||||
cbs.repur_real_subtotal repurRealSubtotal,
|
|
||||||
<!-- 首购金额 = 注册 + 升级 + 特殊注册 + 特殊升级 + 虚拟订单(空单) -->
|
<!-- 首购金额 = 注册 + 升级 + 特殊注册 + 特殊升级 + 虚拟订单(空单) -->
|
||||||
(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT)
|
(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT)
|
||||||
AS firstPurchaseAll,
|
AS firstPurchaseAll,
|
||||||
|
@ -113,6 +78,71 @@
|
||||||
/ (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
|
/ (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
|
||||||
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
|
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
|
||||||
end AS totalBonusRate
|
end AS totalBonusRate
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
cbs.PK_BD_VERTEX pkVertex,
|
||||||
|
cbs.PK_TEAM_CODE pkTeamCode,
|
||||||
|
ver.VERTEX_NAME as vertexName,
|
||||||
|
ct.TEAM_NAME as teamName,
|
||||||
|
cbs.PK_ID pkId,
|
||||||
|
cbs.PERIOD period,
|
||||||
|
cbs.CREATION_TIME creationTime,
|
||||||
|
cbs.PK_COUNTRY pkCountry,
|
||||||
|
<!-- PV字段 -->
|
||||||
|
cbs.MAIN_REG_PV ,
|
||||||
|
cbs.MAIN_UP_PV ,
|
||||||
|
cbs.MAIN_REPUR_PV ,
|
||||||
|
cbs.SPECIAL_REGISTER_PV ,
|
||||||
|
cbs.SPECIAL_UPGRADE_PV ,
|
||||||
|
cbs.SPECIAL_REPURCHASE_PV ,
|
||||||
|
cbs.FICTITIOUS_PV ,
|
||||||
|
cbs.MALL_PV ,
|
||||||
|
cbs.COOPERATE_PV ,
|
||||||
|
cbs.WELFARE_ORDER_PV ,
|
||||||
|
<!-- 金额字段 -->
|
||||||
|
cbs.main_reg_amount,
|
||||||
|
cbs.main_up_amount,
|
||||||
|
cbs.main_repur_amount,
|
||||||
|
cbs.special_register_amount,
|
||||||
|
cbs.special_upgrade_amount,
|
||||||
|
cbs.special_repurchase_amount,
|
||||||
|
cbs.fictitious_amount,
|
||||||
|
cbs.mall_amount,
|
||||||
|
cbs.cooperate_amount,
|
||||||
|
cbs.welfare_order,
|
||||||
|
<!-- 奖金字段 -->
|
||||||
|
cbs.introduce_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end leader_bonus,
|
||||||
|
cbs.service_bonus ,
|
||||||
|
cbs.repur_range_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end repur_org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end repur_leader_bonus,
|
||||||
|
cbs.repur_push_income
|
||||||
FROM CU_BONUS_STATIS cbs
|
FROM CU_BONUS_STATIS cbs
|
||||||
left join bd_vertex ver on cbs.pk_bd_vertex = ver.pk_id
|
left join bd_vertex ver on cbs.pk_bd_vertex = ver.pk_id
|
||||||
LEFT JOIN cu_member_team ct ON ct.pk_id = cbs.pk_team_code
|
LEFT JOIN cu_member_team ct ON ct.pk_id = cbs.pk_team_code
|
||||||
|
@ -134,6 +164,7 @@
|
||||||
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
ORDER BY cbs.CREATION_TIME asc
|
ORDER BY cbs.CREATION_TIME asc
|
||||||
|
) cbs
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询体系合计的订单业绩-->
|
<!-- 查询体系合计的订单业绩-->
|
||||||
|
@ -235,9 +266,74 @@
|
||||||
/ sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
|
/ sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
|
||||||
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
|
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
|
||||||
end AS totalBonusRateSum
|
end AS totalBonusRateSum
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
cbs.PK_BD_VERTEX pkVertex,
|
||||||
|
cbs.PK_TEAM_CODE pkTeamCode,
|
||||||
|
ver.VERTEX_NAME as vertexName,
|
||||||
|
cbs.PK_ID pkId,
|
||||||
|
cbs.PERIOD period,
|
||||||
|
cbs.CREATION_TIME creationTime,
|
||||||
|
cbs.PK_COUNTRY pkCountry,
|
||||||
|
<!-- PV字段 -->
|
||||||
|
cbs.MAIN_REG_PV ,
|
||||||
|
cbs.MAIN_UP_PV ,
|
||||||
|
cbs.MAIN_REPUR_PV ,
|
||||||
|
cbs.SPECIAL_REGISTER_PV ,
|
||||||
|
cbs.SPECIAL_UPGRADE_PV ,
|
||||||
|
cbs.SPECIAL_REPURCHASE_PV ,
|
||||||
|
cbs.FICTITIOUS_PV ,
|
||||||
|
cbs.MALL_PV ,
|
||||||
|
cbs.COOPERATE_PV ,
|
||||||
|
cbs.WELFARE_ORDER_PV ,
|
||||||
|
<!-- 金额字段 -->
|
||||||
|
cbs.main_reg_amount,
|
||||||
|
cbs.main_up_amount,
|
||||||
|
cbs.main_repur_amount,
|
||||||
|
cbs.special_register_amount,
|
||||||
|
cbs.special_upgrade_amount,
|
||||||
|
cbs.special_repurchase_amount,
|
||||||
|
cbs.fictitious_amount,
|
||||||
|
cbs.mall_amount,
|
||||||
|
cbs.cooperate_amount,
|
||||||
|
cbs.welfare_order,
|
||||||
|
<!-- 奖金字段 -->
|
||||||
|
cbs.introduce_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end leader_bonus,
|
||||||
|
cbs.service_bonus ,
|
||||||
|
cbs.repur_range_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end repur_org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end repur_leader_bonus,
|
||||||
|
cbs.repur_push_income
|
||||||
FROM CU_BONUS_STATIS cbs
|
FROM CU_BONUS_STATIS cbs
|
||||||
left join bd_vertex ver on cbs.pk_bd_vertex = ver.pk_id
|
left join bd_vertex ver on cbs.pk_bd_vertex = ver.pk_id
|
||||||
WHERE ver.DEL_FLAG = 0
|
WHERE 1 = 1
|
||||||
|
and ver.DEL_FLAG = 0
|
||||||
<if test="pkCountry != null">
|
<if test="pkCountry != null">
|
||||||
and cbs.PK_COUNTRY = #{pkCountry}
|
and cbs.PK_COUNTRY = #{pkCountry}
|
||||||
</if>
|
</if>
|
||||||
|
@ -253,6 +349,8 @@
|
||||||
<if test="endDate!=null and endDate!='' ">
|
<if test="endDate!=null and endDate!='' ">
|
||||||
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
|
)
|
||||||
|
cbs
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 奖金拨比图表-->
|
<!-- 奖金拨比图表-->
|
||||||
|
|
|
@ -2,58 +2,10 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hzs.member.statis.mapper.CuBonusVertexStatisMapper">
|
<mapper namespace="com.hzs.member.statis.mapper.CuBonusVertexStatisMapper">
|
||||||
|
|
||||||
<!-- 奖金拨比列表-->
|
<!-- 奖金拨比列表-->
|
||||||
<select id="queryCuBonusStatis" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"
|
<select id="queryCuBonusStatis" parameterType="com.hzs.member.statis.vo.CuBonusVertexStatisVO"
|
||||||
resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO">
|
resultType="com.hzs.member.statis.vo.CuBonusVertexStatisVO">
|
||||||
SELECT
|
select cbs.*,
|
||||||
cbs.PK_BD_VERTEX pkVertex,
|
|
||||||
cbs.PK_TEAM_CODE pkTeamCode,
|
|
||||||
cm.MEMBER_CODE as memberCode,
|
|
||||||
cm.MEMBER_NAME as memberName,
|
|
||||||
cbs.PK_ID pkId,
|
|
||||||
cbs.PERIOD period,
|
|
||||||
cbs.CREATION_TIME creationTime,
|
|
||||||
cbs.PK_COUNTRY pkCountry,
|
|
||||||
<!-- PV字段 -->
|
|
||||||
cbs.MAIN_REG_PV mainRegPv,
|
|
||||||
cbs.MAIN_UP_PV mainUpPv,
|
|
||||||
cbs.MAIN_REPUR_PV mainRepurPv,
|
|
||||||
cbs.SPECIAL_REGISTER_PV specialRegisterPv,
|
|
||||||
cbs.SPECIAL_UPGRADE_PV specialUpgradePv,
|
|
||||||
cbs.SPECIAL_REPURCHASE_PV specialRepurchasePv,
|
|
||||||
cbs.FICTITIOUS_PV fictitiousPv,
|
|
||||||
cbs.HIFANS_REG_PV hifansRegPv,
|
|
||||||
cbs.HAI_FUN_UPGRADE_PV haiFunUpgradePv,
|
|
||||||
cbs.MALL_PV mallPv,
|
|
||||||
cbs.COOPERATE_PV cooperatePv,
|
|
||||||
cbs.WELFARE_ORDER_PV welfareOrderPv,
|
|
||||||
<!-- 金额字段 -->
|
|
||||||
cbs.main_reg_amount mainRegAmount,
|
|
||||||
cbs.main_up_amount mainUpAmount,
|
|
||||||
cbs.main_repur_amount mainRepurAmount,
|
|
||||||
cbs.special_register_amount,
|
|
||||||
cbs.special_upgrade_amount,
|
|
||||||
cbs.special_repurchase_amount,
|
|
||||||
<!-- 奖金字段 -->
|
|
||||||
cbs.introduce_bonus introduceBonus,
|
|
||||||
cbs.org_bonus orgBonus,
|
|
||||||
cbs.leader_bonus leaderBonus,
|
|
||||||
cbs.service_bonus serviceBonus,
|
|
||||||
cbs.repur_range_bonus repurRangeBonus,
|
|
||||||
cbs.repur_org_bonus repurOrgBonus,
|
|
||||||
cbs.repur_leader_bonus repurLeaderBonus,
|
|
||||||
<!-- 首购相关收益占比,页面未使用
|
|
||||||
CASE WHEN (cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT)=0 THEN 0 ELSE
|
|
||||||
ROUND(#{perCent}*cbs.INTRODUCE_BONUS/(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT),4) end as introduceBonusRate,
|
|
||||||
CASE WHEN (cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT)=0 THEN 0 ELSE
|
|
||||||
ROUND(#{perCent}*cbs.ORG_BONUS/(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT),4) end as orgBonusRate,
|
|
||||||
CASE WHEN (cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT)=0 THEN 0 ELSE
|
|
||||||
ROUND(#{perCent}*cbs.LEADER_BONUS/(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT),4) end leaderBonusRate,
|
|
||||||
CASE WHEN (cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT)=0 THEN 0 ELSE
|
|
||||||
ROUND(#{perCent}*cbs.SHARE_BONUS/(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT),4) end shareBonusRate,
|
|
||||||
CASE WHEN (cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT)=0 THEN 0 ELSE
|
|
||||||
ROUND(#{perCent}*cbs.SERVICE_BONUS/(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT),4) end serviceBonusRate,
|
|
||||||
-->
|
|
||||||
<!-- 首购金额 = 注册 + 升级 + 特殊注册 + 特殊升级 + 虚拟订单(空单) -->
|
<!-- 首购金额 = 注册 + 升级 + 特殊注册 + 特殊升级 + 虚拟订单(空单) -->
|
||||||
(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT)
|
(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT)
|
||||||
AS firstPurchaseAll,
|
AS firstPurchaseAll,
|
||||||
|
@ -108,6 +60,71 @@
|
||||||
/ (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
|
/ (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
|
||||||
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
|
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
|
||||||
end AS totalBonusRate
|
end AS totalBonusRate
|
||||||
|
from (
|
||||||
|
SELECT
|
||||||
|
cbs.PK_BD_VERTEX ,
|
||||||
|
cbs.PK_TEAM_CODE ,
|
||||||
|
cm.MEMBER_CODE ,
|
||||||
|
cm.MEMBER_NAME ,
|
||||||
|
cbs.PK_ID ,
|
||||||
|
cbs.PERIOD ,
|
||||||
|
cbs.CREATION_TIME ,
|
||||||
|
cbs.PK_COUNTRY ,
|
||||||
|
<!-- PV字段 -->
|
||||||
|
cbs.MAIN_REG_PV ,
|
||||||
|
cbs.MAIN_UP_PV ,
|
||||||
|
cbs.MAIN_REPUR_PV ,
|
||||||
|
cbs.SPECIAL_REGISTER_PV ,
|
||||||
|
cbs.SPECIAL_UPGRADE_PV ,
|
||||||
|
cbs.SPECIAL_REPURCHASE_PV ,
|
||||||
|
cbs.FICTITIOUS_PV ,
|
||||||
|
cbs.MALL_PV ,
|
||||||
|
cbs.COOPERATE_PV ,
|
||||||
|
cbs.WELFARE_ORDER_PV ,
|
||||||
|
<!-- 金额字段 -->
|
||||||
|
cbs.main_reg_amount,
|
||||||
|
cbs.main_up_amount,
|
||||||
|
cbs.main_repur_amount,
|
||||||
|
cbs.special_register_amount,
|
||||||
|
cbs.special_upgrade_amount,
|
||||||
|
cbs.special_repurchase_amount,
|
||||||
|
cbs.fictitious_amount,
|
||||||
|
cbs.mall_amount,
|
||||||
|
cbs.cooperate_amount,
|
||||||
|
cbs.welfare_order,
|
||||||
|
<!-- 奖金字段 -->
|
||||||
|
cbs.introduce_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end leader_bonus,
|
||||||
|
cbs.service_bonus ,
|
||||||
|
cbs.repur_range_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end repur_org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end repur_leader_bonus,
|
||||||
|
cbs.repur_push_income
|
||||||
FROM CU_BONUS_VERTEX_STATIS cbs
|
FROM CU_BONUS_VERTEX_STATIS cbs
|
||||||
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0
|
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
|
@ -124,6 +141,7 @@
|
||||||
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
ORDER BY cbs.CREATION_TIME asc
|
ORDER BY cbs.CREATION_TIME asc
|
||||||
|
) cbs
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,18 +229,6 @@
|
||||||
sum (cbs.REPUR_RANGE_BONUS) repurRangeBonusSum,
|
sum (cbs.REPUR_RANGE_BONUS) repurRangeBonusSum,
|
||||||
sum (cbs.REPUR_ORG_BONUS) repurOrgBonusSum,
|
sum (cbs.REPUR_ORG_BONUS) repurOrgBonusSum,
|
||||||
sum (cbs.REPUR_LEADER_BONUS) repurLeaderBonusSum,
|
sum (cbs.REPUR_LEADER_BONUS) repurLeaderBonusSum,
|
||||||
<!-- 首购相关收益占比,页面未使用
|
|
||||||
CASE WHEN (sum(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT))=0 THEN 0 ELSE
|
|
||||||
ROUND(sum(#{perCent}*cbs.INTRODUCE_BONUS)/(sum(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT)),4) end as introduceBonusRateSum,
|
|
||||||
CASE WHEN (sum(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT))=0 THEN 0 ELSE
|
|
||||||
ROUND(sum(#{perCent}*cbs.ORG_BONUS)/(sum(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT)),4) end as orgBonusRateSum,
|
|
||||||
CASE WHEN (sum(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT))=0 THEN 0 ELSE
|
|
||||||
ROUND(sum(#{perCent}*cbs.LEADER_BONUS)/(sum(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT)),4) end leaderBonusRateSum,
|
|
||||||
CASE WHEN (sum(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT))=0 THEN 0 ELSE
|
|
||||||
ROUND(sum(#{perCent}*cbs.SHARE_BONUS)/(sum(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT)),4) end shareBonusRateSum,
|
|
||||||
CASE WHEN (sum(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT))=0 THEN 0 ELSE
|
|
||||||
ROUND(sum(#{perCent}*cbs.SERVICE_BONUS)/(sum(cbs.MAIN_REG_AMOUNT+cbs.MAIN_UP_AMOUNT)),4) end serviceBonusRateSum,
|
|
||||||
-->
|
|
||||||
sum (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT)
|
sum (cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT)
|
||||||
AS firstPurchaseAllSum,
|
AS firstPurchaseAllSum,
|
||||||
sum (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER)
|
sum (cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER)
|
||||||
|
@ -266,6 +272,71 @@
|
||||||
/ sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
|
/ sum(cbs.MAIN_REG_AMOUNT + cbs.MAIN_UP_AMOUNT + cbs.SPECIAL_REGISTER_AMOUNT + cbs.SPECIAL_UPGRADE_AMOUNT + cbs.FICTITIOUS_AMOUNT
|
||||||
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
|
+ cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
|
||||||
end AS totalBonusRateSum
|
end AS totalBonusRateSum
|
||||||
|
from (
|
||||||
|
SELECT
|
||||||
|
cbs.PK_BD_VERTEX ,
|
||||||
|
cbs.PK_TEAM_CODE ,
|
||||||
|
cm.MEMBER_CODE ,
|
||||||
|
cm.MEMBER_NAME ,
|
||||||
|
cbs.PK_ID ,
|
||||||
|
cbs.PERIOD ,
|
||||||
|
cbs.CREATION_TIME ,
|
||||||
|
cbs.PK_COUNTRY ,
|
||||||
|
<!-- PV字段 -->
|
||||||
|
cbs.MAIN_REG_PV ,
|
||||||
|
cbs.MAIN_UP_PV ,
|
||||||
|
cbs.MAIN_REPUR_PV ,
|
||||||
|
cbs.SPECIAL_REGISTER_PV ,
|
||||||
|
cbs.SPECIAL_UPGRADE_PV ,
|
||||||
|
cbs.SPECIAL_REPURCHASE_PV ,
|
||||||
|
cbs.FICTITIOUS_PV ,
|
||||||
|
cbs.MALL_PV ,
|
||||||
|
cbs.COOPERATE_PV ,
|
||||||
|
cbs.WELFARE_ORDER_PV ,
|
||||||
|
<!-- 金额字段 -->
|
||||||
|
cbs.main_reg_amount,
|
||||||
|
cbs.main_up_amount,
|
||||||
|
cbs.main_repur_amount,
|
||||||
|
cbs.special_register_amount,
|
||||||
|
cbs.special_upgrade_amount,
|
||||||
|
cbs.special_repurchase_amount,
|
||||||
|
cbs.fictitious_amount,
|
||||||
|
cbs.mall_amount,
|
||||||
|
cbs.cooperate_amount,
|
||||||
|
cbs.welfare_order,
|
||||||
|
<!-- 奖金字段 -->
|
||||||
|
cbs.introduce_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end leader_bonus,
|
||||||
|
cbs.service_bonus ,
|
||||||
|
cbs.repur_range_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end repur_org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end repur_leader_bonus,
|
||||||
|
cbs.repur_push_income
|
||||||
FROM CU_BONUS_VERTEX_STATIS cbs
|
FROM CU_BONUS_VERTEX_STATIS cbs
|
||||||
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0
|
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
|
@ -281,6 +352,7 @@
|
||||||
<if test="endDate!=null and endDate!='' ">
|
<if test="endDate!=null and endDate!='' ">
|
||||||
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
|
) cbs
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询顶点奖金拨比汇总-->
|
<!-- 查询顶点奖金拨比汇总-->
|
||||||
|
@ -332,8 +404,71 @@
|
||||||
ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS)
|
ELSE ROUND(#{perCent} * sum(cbs.REPUR_RANGE_BONUS + cbs.REPUR_ORG_BONUS + cbs.REPUR_PUSH_INCOME + cbs.REPUR_LEADER_BONUS)
|
||||||
/ #{rate} / sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4)
|
/ #{rate} / sum(cbs.MAIN_REPUR_PV + cbs.MALL_PV + cbs.COOPERATE_PV + cbs.SPECIAL_REPURCHASE_PV + cbs.WELFARE_ORDER_PV), 4)
|
||||||
end AS repurBonusPvRate
|
end AS repurBonusPvRate
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
cbs.PK_BD_VERTEX ,
|
||||||
|
cbs.PK_TEAM_CODE ,
|
||||||
|
cbs.PK_ID ,
|
||||||
|
cbs.PERIOD ,
|
||||||
|
cbs.CREATION_TIME ,
|
||||||
|
cbs.PK_COUNTRY ,
|
||||||
|
<!-- PV字段 -->
|
||||||
|
cbs.MAIN_REG_PV ,
|
||||||
|
cbs.MAIN_UP_PV ,
|
||||||
|
cbs.MAIN_REPUR_PV ,
|
||||||
|
cbs.SPECIAL_REGISTER_PV ,
|
||||||
|
cbs.SPECIAL_UPGRADE_PV ,
|
||||||
|
cbs.SPECIAL_REPURCHASE_PV ,
|
||||||
|
cbs.FICTITIOUS_PV ,
|
||||||
|
cbs.MALL_PV ,
|
||||||
|
cbs.COOPERATE_PV ,
|
||||||
|
cbs.WELFARE_ORDER_PV ,
|
||||||
|
<!-- 金额字段 -->
|
||||||
|
cbs.main_reg_amount,
|
||||||
|
cbs.main_up_amount,
|
||||||
|
cbs.main_repur_amount,
|
||||||
|
cbs.special_register_amount,
|
||||||
|
cbs.special_upgrade_amount,
|
||||||
|
cbs.special_repurchase_amount,
|
||||||
|
cbs.fictitious_amount,
|
||||||
|
cbs.mall_amount,
|
||||||
|
cbs.cooperate_amount,
|
||||||
|
cbs.welfare_order,
|
||||||
|
<!-- 奖金字段 -->
|
||||||
|
cbs.introduce_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end leader_bonus,
|
||||||
|
cbs.service_bonus ,
|
||||||
|
cbs.repur_range_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end repur_org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end repur_leader_bonus,
|
||||||
|
cbs.repur_push_income
|
||||||
FROM CU_BONUS_VERTEX_STATIS cbs
|
FROM CU_BONUS_VERTEX_STATIS cbs
|
||||||
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX and cm.del_flag = 0
|
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
<if test="pkCountry != null">
|
<if test="pkCountry != null">
|
||||||
and cbs.PK_COUNTRY = #{pkCountry}
|
and cbs.PK_COUNTRY = #{pkCountry}
|
||||||
|
@ -347,6 +482,9 @@
|
||||||
<if test="endDate!=null and endDate!='' ">
|
<if test="endDate!=null and endDate!='' ">
|
||||||
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
|
)
|
||||||
|
cbs
|
||||||
|
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX and cm.del_flag = 0
|
||||||
GROUP BY cbs.PK_BD_VERTEX, cm.MEMBER_CODE, cm.MEMBER_NAME
|
GROUP BY cbs.PK_BD_VERTEX, cm.MEMBER_CODE, cm.MEMBER_NAME
|
||||||
)
|
)
|
||||||
ORDER BY firstPurchaseAll desc, repurchaseAllAmount desc
|
ORDER BY firstPurchaseAll desc, repurchaseAllAmount desc
|
||||||
|
@ -441,13 +579,77 @@
|
||||||
ELSE ROUND(#{perCent} * sum(cbs.REPUR_LEADER_BONUS)
|
ELSE ROUND(#{perCent} * sum(cbs.REPUR_LEADER_BONUS)
|
||||||
/ sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
|
/ sum(cbs.MAIN_REPUR_AMOUNT + cbs.MALL_AMOUNT + cbs.COOPERATE_AMOUNT + cbs.SPECIAL_REPURCHASE_AMOUNT + cbs.WELFARE_ORDER), 4)
|
||||||
end AS repurLeaderBonusRate
|
end AS repurLeaderBonusRate
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
cbs.PK_BD_VERTEX ,
|
||||||
|
cbs.PK_TEAM_CODE ,
|
||||||
|
cm.MEMBER_CODE ,
|
||||||
|
cm.MEMBER_NAME ,
|
||||||
|
cbs.PK_ID ,
|
||||||
|
cbs.PERIOD ,
|
||||||
|
cbs.CREATION_TIME ,
|
||||||
|
cbs.PK_COUNTRY ,
|
||||||
|
<!-- PV字段 -->
|
||||||
|
cbs.MAIN_REG_PV ,
|
||||||
|
cbs.MAIN_UP_PV ,
|
||||||
|
cbs.MAIN_REPUR_PV ,
|
||||||
|
cbs.SPECIAL_REGISTER_PV ,
|
||||||
|
cbs.SPECIAL_UPGRADE_PV ,
|
||||||
|
cbs.SPECIAL_REPURCHASE_PV ,
|
||||||
|
cbs.FICTITIOUS_PV ,
|
||||||
|
cbs.MALL_PV ,
|
||||||
|
cbs.COOPERATE_PV ,
|
||||||
|
cbs.WELFARE_ORDER_PV ,
|
||||||
|
<!-- 金额字段 -->
|
||||||
|
cbs.main_reg_amount,
|
||||||
|
cbs.main_up_amount,
|
||||||
|
cbs.main_repur_amount,
|
||||||
|
cbs.special_register_amount,
|
||||||
|
cbs.special_upgrade_amount,
|
||||||
|
cbs.special_repurchase_amount,
|
||||||
|
cbs.fictitious_amount,
|
||||||
|
cbs.mall_amount,
|
||||||
|
cbs.cooperate_amount,
|
||||||
|
cbs.welfare_order,
|
||||||
|
<!-- 奖金字段 -->
|
||||||
|
cbs.introduce_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_fir_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end leader_bonus,
|
||||||
|
cbs.service_bonus ,
|
||||||
|
cbs.repur_range_bonus ,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_org_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
org_bonus
|
||||||
|
end repur_org_bonus,
|
||||||
|
case
|
||||||
|
when cbs.cal_fir_achieve = 0 and cbs.cal_rep_achieve = 0 then
|
||||||
|
cbs.repur_leader_bonus
|
||||||
|
else
|
||||||
|
cbs.cal_rep_achieve / (cbs.cal_fir_achieve + cbs.cal_rep_achieve) *
|
||||||
|
leader_bonus
|
||||||
|
end repur_leader_bonus,
|
||||||
|
cbs.repur_push_income
|
||||||
FROM CU_BONUS_VERTEX_STATIS cbs
|
FROM CU_BONUS_VERTEX_STATIS cbs
|
||||||
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX and cm.del_flag = 0
|
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX AND cm.DEL_FLAG = 0
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
<if test="pkCountry != null">
|
<if test="pkCountry != null">
|
||||||
and cbs.PK_COUNTRY= #{pkCountry}
|
and cbs.PK_COUNTRY = #{pkCountry}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="pkVertex != null ">
|
<if test="pkVertex != null ">
|
||||||
and cbs.PK_BD_VERTEX = #{pkVertex}
|
and cbs.PK_BD_VERTEX = #{pkVertex}
|
||||||
</if>
|
</if>
|
||||||
|
@ -457,6 +659,8 @@
|
||||||
<if test="endDate!=null and endDate!='' ">
|
<if test="endDate!=null and endDate!='' ">
|
||||||
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
and cbs.CREATION_TIME <= to_date(#{endDate} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
|
) cbs
|
||||||
|
LEFT JOIN CU_MEMBER cm ON cm.PK_ID = cbs.PK_BD_VERTEX and cm.del_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询时间内奖金拨比顶点会员-->
|
<!-- 查询时间内奖金拨比顶点会员-->
|
||||||
|
|
Loading…
Reference in New Issue