fix(pl): 补齐客户品类证件额度三期收口项。
完善 H5 建档、归档待完善引导、齐备上传入口与新规则只读提示,并同步计划验收状态与单测。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
208c93d192
commit
b0c1bca683
12 files changed
+439
-73
No files matched your search
@@ -0,0 +1,24 @@
|
||||
-- 只读:按证面品名归纳候选证用品类名(上线前人工建品类参考)
|
||||
-- 不写库。执行后人工创建 pl_cert_category、关联产品,并回填证件 customer_id/category_id,再配置 effective_at。
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
SELECT
|
||||
TRIM(product_name_on_cert) AS candidate_category_name,
|
||||
COUNT(*) AS cert_count,
|
||||
SUM(CASE WHEN cert_type = 'purchase' THEN 1 ELSE 0 END) AS purchase_count,
|
||||
SUM(CASE WHEN cert_type = 'transport' THEN 1 ELSE 0 END) AS transport_count
|
||||
FROM (
|
||||
SELECT 'purchase' AS cert_type, product_name_on_cert
|
||||
FROM pl_purchase_cert
|
||||
WHERE del_flag = 0
|
||||
AND product_name_on_cert IS NOT NULL
|
||||
AND TRIM(product_name_on_cert) <> ''
|
||||
UNION ALL
|
||||
SELECT 'transport' AS cert_type, product_name_on_cert
|
||||
FROM pl_transport_cert
|
||||
WHERE del_flag = 0
|
||||
AND product_name_on_cert IS NOT NULL
|
||||
AND TRIM(product_name_on_cert) <> ''
|
||||
) t
|
||||
GROUP BY TRIM(product_name_on_cert)
|
||||
ORDER BY cert_count DESC, candidate_category_name;
|
||||
Reference in new issue
Block a user