## 升级奖衔业绩改为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"> <sql id="CuMemberTreeColumn">
period NUMBER(6) default 0 not null, period
NUMBER(6) default 0 not null,
pk_member NUMBER(20) not null, pk_member NUMBER(20) not null,
pk_parent NUMBER(20) not null, pk_parent NUMBER(20) not null,
pk_place_parent NUMBER(20), pk_place_parent NUMBER(20),
@ -146,7 +147,8 @@
</sql> </sql>
<sql id="CuMemberSettleDetailColumn"> <sql id="CuMemberSettleDetailColumn">
pk_rate NUMBER(6) , pk_rate
NUMBER(6) ,
a_balance NUMBER(17,6) default 0 not null, a_balance NUMBER(17,6) default 0 not null,
b_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, a_sum_amount NUMBER(17,6) default 0 not null,
@ -222,7 +224,8 @@
</sql> </sql>
<sql id="CuMemberBackColumn"> <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, net_repurchase_achieve NUMBER(17,6) default 0 not null,
r_a_balance 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, r_b_balance NUMBER(17,6) default 0 not null,
@ -245,9 +248,13 @@
<sql id="CuMemberTableTrig"> <sql id="CuMemberTableTrig">
CREATE CREATE
OR REPLACE TRIGGER OR REPLACE TRIGGER
${tableName}_TRIG ${tableName}
_
TRIG
BEFORE BEFORE
INSERT OR UPDATE ON ${tableName} FOR EACH ROW INSERT
OR
UPDATE ON ${tableName} FOR EACH ROW
DECLARE DECLARE
v_newVal NUMBER(12) := 0; v_newVal NUMBER(12) := 0;
v_incval v_incval
@ -272,7 +279,8 @@
FROM dual; FROM dual;
END LOOP; END LOOP;
END IF; END IF;
:new.pk_id := v_newVal; :new
.pk_id := v_newVal;
END IF; END IF;
END; END;
</sql> </sql>
@ -378,23 +386,57 @@
</update> </update>
<update id="createCuMemberTreeParentIndex"> <update id="createCuMemberTreeParentIndex">
create index ${tableName}_parent create
on ${tableName} ( pk_parent ) index
${tableName}
_
parent
on
${tableName}
(
pk_parent
)
</update> </update>
<update id="createCuMemberTreePlaceIndex"> <update id="createCuMemberTreePlaceIndex">
create index ${tableName}_place create
on ${tableName} ( pk_place_parent, place_dept ) index
${tableName}
_
place
on
${tableName}
(
pk_place_parent,
place_dept
)
</update> </update>
<update id="createCuMemberTableUniqueIndex"> <update id="createCuMemberTableUniqueIndex">
create unique index ${tableName}_PK_M create
on ${tableName} ( PK_MEMBER, period ) unique index
${tableName}
_
PK_M
on
${tableName}
(
PK_MEMBER,
period
)
</update> </update>
<update id="createCuMemberTreeDayOnlyIndex"> <update id="createCuMemberTreeDayOnlyIndex">
create unique index create
${tableName}_PK_M on ${tableName} ( PK_MEMBER ) unique index
${tableName}
_
PK_M
on
${tableName}
(
PK_MEMBER
)
</update> </update>
<update id="updateCuMemberTreeByCancelOrder"> <update id="updateCuMemberTreeByCancelOrder">
@ -762,8 +804,13 @@
inner join bd_awards bdw inner join bd_awards bdw
on a.ori_awards_value = bdw.awards_value and a.pk_settle_country = bdw.pk_country on a.ori_awards_value = bdw.awards_value and a.pk_settle_country = bdw.pk_country
where bw.del_flag = 0 where bw.del_flag = 0
and bw.community_check &lt;= a.a_sum_real_pv and (
and bw.community_check &lt;= a.b_sum_real_pv (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 order by pk_member desc
</select> </select>