Commit f0c6d415 by 林冲

new_division_rule_id处理None为null;

JOIN {audit_table} ra ON ra.id = m.new_id AND ra.rule_type = 1
1 parent 13e34d12
......@@ -1537,11 +1537,12 @@ class SceneSplitProcessor:
# 查询表12(财务审核)的映射关系
query_mapping_sql = f"""
SELECT DISTINCT old_id, new_id, base_scene_code
FROM tmp_rule_id_mapping
WHERE table_name = '{audit_table}'
AND old_id != new_id
ORDER BY old_id, new_id;
SELECT DISTINCT m.old_id, m.new_id, m.base_scene_code
FROM tmp_rule_id_mapping m
JOIN {audit_table} ra ON ra.id = m.new_id AND ra.rule_type = 1
WHERE m.table_name = '{audit_table}'
AND m.old_id != m.new_id
ORDER BY m.old_id, m.new_id;
"""
mappings = self.db.execute_query(query_mapping_sql)
self.logger.info(f" 找到 {len(mappings)} 条审核记录映射关系需要处理")
......@@ -1563,7 +1564,7 @@ class SceneSplitProcessor:
continue
new_rule_id = audit_record[0]
new_division_rule_id = audit_record[1]
new_division_rule_id = audit_record[1] if audit_record[1] is not None else 'NULL'
merchant_id = audit_record[2]
merchant_name = audit_record[3]
scene_type = audit_record[4]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!