From 5c53ef0972d7b64bf1caa84b6dda6690d8d7e7ea Mon Sep 17 00:00:00 2001
From: cabbage <281119120@qq.com>
Date: Fri, 18 Jul 2025 13:28:33 +0800
Subject: [PATCH] =?UTF-8?q?##=20=E5=8D=87=E7=BA=A7=E5=A5=96=E8=A1=94?=
=?UTF-8?q?=E4=B8=9A=E7=BB=A9=E6=94=B9=E4=B8=BA2:1=EF=BC=88238=EF=BC=89?=
=?UTF-8?q?=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../member/achieve/CuMemberTreeMapper.xml | 79 +++++++++++++++----
1 file changed, 63 insertions(+), 16 deletions(-)
diff --git a/bd-business/bd-business-bonus/src/main/resources/mapper/member/achieve/CuMemberTreeMapper.xml b/bd-business/bd-business-bonus/src/main/resources/mapper/member/achieve/CuMemberTreeMapper.xml
index 56cf4b7d..60f1f8ec 100644
--- a/bd-business/bd-business-bonus/src/main/resources/mapper/member/achieve/CuMemberTreeMapper.xml
+++ b/bd-business/bd-business-bonus/src/main/resources/mapper/member/achieve/CuMemberTreeMapper.xml
@@ -106,7 +106,8 @@
- 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 @@
- 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 @@
- 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 @@
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;
@@ -378,23 +386,57 @@
- create index ${tableName}_parent
- on ${tableName} ( pk_parent )
+ create
+ index
+ ${tableName}
+ _
+ parent
+ on
+ ${tableName}
+ (
+ pk_parent
+ )
- create index ${tableName}_place
- on ${tableName} ( pk_place_parent, place_dept )
+ create
+ index
+ ${tableName}
+ _
+ place
+ on
+ ${tableName}
+ (
+ pk_place_parent,
+ place_dept
+ )
- create unique index ${tableName}_PK_M
- on ${tableName} ( PK_MEMBER, period )
+ create
+ unique index
+ ${tableName}
+ _
+ PK_M
+ on
+ ${tableName}
+ (
+ PK_MEMBER,
+ period
+ )
- create unique index
- ${tableName}_PK_M on ${tableName} ( PK_MEMBER )
+ create
+ unique index
+ ${tableName}
+ _
+ PK_M
+ on
+ ${tableName}
+ (
+ PK_MEMBER
+ )
@@ -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 <= a.a_sum_real_pv
- and bw.community_check <= a.b_sum_real_pv
+ and (
+ (bw.community_check <= a.a_sum_real_pv
+ and bw.community_check * 2 <= a.b_sum_real_pv)
+ or
+ (bw.community_check * 2 <= a.a_sum_real_pv
+ and bw.community_check <= a.b_sum_real_pv)
+ )
order by pk_member desc