|
@@ -241,6 +241,8 @@ case class inc_company_relation_v3(s: SparkSession,
|
|
|
| FROM $inc_ads_company_holder
|
|
|
| WHERE ds = '$ds'
|
|
|
|and holder_type = 1
|
|
|
+ |and length(holder_id) = 33
|
|
|
+ |and length(company_id) = 32
|
|
|
|)a
|
|
|
|JOIN
|
|
|
| (
|
|
@@ -262,6 +264,8 @@ case class inc_company_relation_v3(s: SparkSession,
|
|
|
| FROM $inc_ads_company_holder
|
|
|
|WHERE ds = '$ds'
|
|
|
|and holder_type = 2
|
|
|
+ |and length(holder_id) = 32
|
|
|
+ |and length(company_id) = 32
|
|
|
|)a JOIN
|
|
|
| (
|
|
|
| SELECT rowkey
|
|
@@ -289,6 +293,8 @@ case class inc_company_relation_v3(s: SparkSession,
|
|
|
| '高管' as LABEL
|
|
|
| FROM $inc_ads_company_staff
|
|
|
|WHERE ds = '$ds'
|
|
|
+ |and length(hid) = 33
|
|
|
+ |and length(company_id) = 32
|
|
|
|)a
|
|
|
|JOIN
|
|
|
| (
|
|
@@ -322,6 +328,8 @@ case class inc_company_relation_v3(s: SparkSession,
|
|
|
| FROM $inc_ads_company_legal_entity
|
|
|
|WHERE ds = '$ds'
|
|
|
|and legal_entity_type = 1
|
|
|
+ |and length(legal_entity_id) = 33
|
|
|
+ |and length(company_id) = 32
|
|
|
|)a
|
|
|
|UNION ALL
|
|
|
|SELECT legal_entity_id start_id,name_cleanup(legal_entity_name) start_name,a.company_id end_id,name_cleanup(company_name) end_name,deleted,legal_entity_type,label
|
|
@@ -331,6 +339,8 @@ case class inc_company_relation_v3(s: SparkSession,
|
|
|
| FROM $inc_ads_company_legal_entity
|
|
|
|WHERE ds = '$ds'
|
|
|
|and legal_entity_type = 2
|
|
|
+ |and length(legal_entity_id) = 32
|
|
|
+ |and length(company_id) = 32
|
|
|
|)a
|
|
|
|)
|
|
|
|WHERE start_id <> end_id
|