|
@@ -303,37 +303,69 @@ case class CompanyIndexJob(s: SparkSession,
|
|
|
val alias_tab = "alias_base_" + company_tab
|
|
|
sql(
|
|
|
s"""
|
|
|
- |SELECT company_id AS id
|
|
|
- | ,get_company(name) AS name
|
|
|
+ |SELECT id
|
|
|
+ | ,name
|
|
|
| ,new_cid
|
|
|
| ,name_alias
|
|
|
- | ,get_history_name(name,history_names) AS history_name
|
|
|
- | ,cast(legal_entity_id as string) as legal_entity_id
|
|
|
- | ,cast(legal_entity_type as string) as legal_entity_type
|
|
|
+ | ,history_name
|
|
|
+ | ,legal_entity_id
|
|
|
+ | ,legal_entity_type
|
|
|
| ,legal_entity_name
|
|
|
| ,province_code
|
|
|
| ,city_code
|
|
|
| ,county_code
|
|
|
- | ,to_millis_timestamp(estiblish_time) AS estiblish_time
|
|
|
+ | ,estiblish_time
|
|
|
| ,cate_first_code
|
|
|
| ,cate_second_code
|
|
|
| ,cate_third_code
|
|
|
| ,reg_status
|
|
|
| ,reg_status_std
|
|
|
- | ,get_company_org_type_std(name,company_org_type) as company_org_type_std
|
|
|
+ | ,company_org_type_std
|
|
|
| ,company_type
|
|
|
| ,credit_code
|
|
|
| ,reg_capital
|
|
|
- | ,get_amount(reg_capital) as reg_capital_amount
|
|
|
+ | ,reg_capital_amount
|
|
|
| ,reg_location
|
|
|
- | ,get_phones_emails(phones) AS phones
|
|
|
- | ,get_phones_emails(emails) AS emails
|
|
|
- | ,get_geo(lat,lng) AS geo
|
|
|
+ | ,phones
|
|
|
+ | ,emails
|
|
|
+ | ,geo
|
|
|
| ,logo
|
|
|
| ,reg_number
|
|
|
- | ,get_company_score_weight(reg_status,name,reg_capital_amount,company_type) as company_score_weight
|
|
|
+ | ,get_company_score_weight(reg_status,xjk_name,reg_capital_amount,company_type) AS company_score_weight
|
|
|
| ,deleted
|
|
|
- |FROM $company_tab
|
|
|
+ |FROM (
|
|
|
+ | SELECT company_id AS id
|
|
|
+ | ,name as xjk_name
|
|
|
+ | ,get_company(name) AS name
|
|
|
+ | ,new_cid
|
|
|
+ | ,name_alias
|
|
|
+ | ,get_history_name(name,history_names) AS history_name
|
|
|
+ | ,CAST (legal_entity_id AS STRING ) AS legal_entity_id
|
|
|
+ | ,CAST (legal_entity_type AS STRING ) AS legal_entity_type
|
|
|
+ | ,legal_entity_name
|
|
|
+ | ,province_code
|
|
|
+ | ,city_code
|
|
|
+ | ,county_code
|
|
|
+ | ,to_millis_timestamp(estiblish_time) AS estiblish_time
|
|
|
+ | ,cate_first_code
|
|
|
+ | ,cate_second_code
|
|
|
+ | ,cate_third_code
|
|
|
+ | ,reg_status
|
|
|
+ | ,reg_status_std
|
|
|
+ | ,get_company_org_type_std(name,company_org_type) AS company_org_type_std
|
|
|
+ | ,company_type
|
|
|
+ | ,credit_code
|
|
|
+ | ,reg_capital
|
|
|
+ | ,get_amount(reg_capital) AS reg_capital_amount
|
|
|
+ | ,reg_location
|
|
|
+ | ,get_phones_emails(phones) AS phones
|
|
|
+ | ,get_phones_emails(emails) AS emails
|
|
|
+ | ,get_geo(lat,lng) AS geo
|
|
|
+ | ,logo
|
|
|
+ | ,reg_number
|
|
|
+ | ,deleted
|
|
|
+ | FROM $company_tab
|
|
|
+ | )
|
|
|
|""".stripMargin)
|
|
|
.createTempView(alias_tab)
|
|
|
alias_tab
|