## 升级奖衔业绩改为2:1(238);

This commit is contained in:
cabbage 2025-07-18 13:28:33 +08:00
parent bed0a3c6ac
commit 6221f9b1c2
1 changed files with 63 additions and 16 deletions

View File

@ -106,7 +106,8 @@
<!-- 会员网体月表数据,用于查询 网体跟业绩分开 横向分表-->
<sql id="CuMemberTreeColumn">
period NUMBER(6) default 0 not null,
period
NUMBER(6) default 0 not null,
pk_member NUMBER(20) not null,
pk_parent NUMBER(20) not null,
pk_place_parent NUMBER(20),
@ -146,7 +147,8 @@
</sql>
<sql id="CuMemberSettleDetailColumn">
pk_rate NUMBER(6) ,
pk_rate
NUMBER(6) ,
a_balance NUMBER(17,6) default 0 not null,
b_balance NUMBER(17,6) default 0 not null,
a_sum_amount NUMBER(17,6) default 0 not null,
@ -222,7 +224,8 @@
</sql>
<sql id="CuMemberBackColumn">
net_first_achieve NUMBER(17,6) default 0 not null,
net_first_achieve
NUMBER(17,6) default 0 not null,
net_repurchase_achieve NUMBER(17,6) default 0 not null,
r_a_balance NUMBER(17,6) default 0 not null,
r_b_balance NUMBER(17,6) default 0 not null,
@ -245,9 +248,13 @@
<sql id="CuMemberTableTrig">
CREATE
OR REPLACE TRIGGER
${tableName}_TRIG
${tableName}
_
TRIG
BEFORE
INSERT OR UPDATE ON ${tableName} FOR EACH ROW
INSERT
OR
UPDATE ON ${tableName} FOR EACH ROW
DECLARE
v_newVal NUMBER(12) := 0;
v_incval
@ -272,7 +279,8 @@
FROM dual;
END LOOP;
END IF;
:new.pk_id := v_newVal;
:new
.pk_id := v_newVal;
END IF;
END;
</sql>
@ -378,23 +386,57 @@
</update>
<update id="createCuMemberTreeParentIndex">
create index ${tableName}_parent
on ${tableName} ( pk_parent )
create
index
${tableName}
_
parent
on
${tableName}
(
pk_parent
)
</update>
<update id="createCuMemberTreePlaceIndex">
create index ${tableName}_place
on ${tableName} ( pk_place_parent, place_dept )
create
index
${tableName}
_
place
on
${tableName}
(
pk_place_parent,
place_dept
)
</update>
<update id="createCuMemberTableUniqueIndex">
create unique index ${tableName}_PK_M
on ${tableName} ( PK_MEMBER, period )
create
unique index
${tableName}
_
PK_M
on
${tableName}
(
PK_MEMBER,
period
)
</update>
<update id="createCuMemberTreeDayOnlyIndex">
create unique index
${tableName}_PK_M on ${tableName} ( PK_MEMBER )
create
unique index
${tableName}
_
PK_M
on
${tableName}
(
PK_MEMBER
)
</update>
<update id="updateCuMemberTreeByCancelOrder">
@ -762,8 +804,13 @@
inner join bd_awards bdw
on a.ori_awards_value = bdw.awards_value and a.pk_settle_country = bdw.pk_country
where bw.del_flag = 0
and bw.community_check &lt;= a.a_sum_real_pv
and bw.community_check &lt;= a.b_sum_real_pv
and (
(bw.community_check &lt;= a.a_sum_real_pv
and bw.community_check * 2 &lt;= a.b_sum_real_pv)
or
(bw.community_check * 2 &lt;= a.a_sum_real_pv
and bw.community_check &lt;= a.b_sum_real_pv)
)
order by pk_member desc
</select>