## 同步升级Q8以上奖衔判断条件修改(306);

This commit is contained in:
cabbage 2025-08-06 13:31:45 +08:00
parent 31ceb761c1
commit 4b374d0a7f
1 changed files with 21 additions and 15 deletions

View File

@ -1183,22 +1183,28 @@
from dual) from dual)
</update> </update>
<!-- 查询左右区足够可以升级的会员 --> <!-- 查询左右区伞下足够可以升级的会员 -->
<select id="listUpgradeAwards" resultMap="CuMemberSettleExt"> <select id="listUpgradeAwards" resultMap="CuMemberSettleExt">
select t.pk_member, ct.pk_awards select ct.pk_member, ct.pk_awards
from (select ct.pk_place_parent pk_member from ${settleTableName} ct
from ${settleTableName} ct where ct.pk_member in
inner join bd_awards ba (select t.pk_place_parent
on ba.pk_id = ct.pk_awards from (select ct.pk_place_parent
and ba.del_flag = 0 from ${settleTableName} ct
where ct.category = 0 where ct.pk_place_parent != 0
and ct.income_status = 0 start with ct.pk_member in
and ba.awards_value >= #{awardsValue} (select ct.pk_member
group by ct.pk_place_parent from ${settleTableName} ct
having count(ct.pk_place_parent) = 2) t inner join bd_awards ba
left join ${settleTableName} ct on ba.pk_id = ct.pk_awards
on ct.pk_member = t.pk_member and ba.del_flag = 0
order by t.pk_member where ct.category = 0
and ct.income_status = 0
and ba.awards_value >= #{awardsValue})
connect by ct.pk_member = prior ct.pk_place_parent
group by ct.pk_place_parent, ct.place_dept) t
group by t.pk_place_parent
having count(1) > 1)
</select> </select>
<!-- 有奖衔的会员,上月最后一期左右区结余,本月左右区新増 --> <!-- 有奖衔的会员,上月最后一期左右区结余,本月左右区新増 -->