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: ...@@ -1537,11 +1537,12 @@ class SceneSplitProcessor:
# 查询表12(财务审核)的映射关系 # 查询表12(财务审核)的映射关系
query_mapping_sql = f""" query_mapping_sql = f"""
SELECT DISTINCT old_id, new_id, base_scene_code SELECT DISTINCT m.old_id, m.new_id, m.base_scene_code
FROM tmp_rule_id_mapping FROM tmp_rule_id_mapping m
WHERE table_name = '{audit_table}' JOIN {audit_table} ra ON ra.id = m.new_id AND ra.rule_type = 1
AND old_id != new_id WHERE m.table_name = '{audit_table}'
ORDER BY old_id, new_id; AND m.old_id != m.new_id
ORDER BY m.old_id, m.new_id;
""" """
mappings = self.db.execute_query(query_mapping_sql) mappings = self.db.execute_query(query_mapping_sql)
self.logger.info(f" 找到 {len(mappings)} 条审核记录映射关系需要处理") self.logger.info(f" 找到 {len(mappings)} 条审核记录映射关系需要处理")
...@@ -1563,7 +1564,7 @@ class SceneSplitProcessor: ...@@ -1563,7 +1564,7 @@ class SceneSplitProcessor:
continue continue
new_rule_id = audit_record[0] 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_id = audit_record[2]
merchant_name = audit_record[3] merchant_name = audit_record[3]
scene_type = audit_record[4] 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!