Browse Source

fix:限高的业务日期改为立案时间

晏永年 4 years ago
parent
commit
02537569ab

+ 24 - 10
src/main/scala/com/winhc/bigdata/spark/jobs/judicial/JudicialCaseRelationPre456.scala

@@ -72,8 +72,15 @@ case class JudicialCaseRelationPre456(s: SparkSession, project: String
          |      ,rowkey as detail_id
          |      ,0.0 as case_amt
          |      ,row_number() over(partition by rowkey order by update_time desc) num
-         |      from $project.inc_ads_company_send_announcement
-         |      where length(case_no) > 0 and ds > '0'
+         |      from (
+         |        select case_no,plaintiff,defendant,case_reason,court,start_date,rowkey,update_time
+         |        from $project.ads_company_send_announcement
+         |        where length(case_no) > 0 and ds > '0'
+         |        union all
+         |        select case_no,plaintiff,defendant,case_reason,court,start_date,rowkey,update_time
+         |        from $project.inc_ads_company_send_announcement
+         |        where length(case_no) > 0 and ds > '0'
+         |      )
          |   )
          |where num = 1
          |""".stripMargin).show(10, false)
@@ -110,12 +117,19 @@ case class JudicialCaseRelationPre456(s: SparkSession, project: String
          |      ,concat_ws('',case_stage(case_no)) as case_stage
          |      ,NULL as yg_name
          |      ,if(length(company_name)>3 OR length(company_info)>3, coalesce(company_name,company_info),name) as bg_name
-         |      ,appro_time as date--目前天眼查数据没有执行日期,先以此代替
+         |      ,case_create_time as date--目前天眼查数据没有执行日期,先以此代替
          |      ,rowkey as detail_id
          |      ,0.0 as case_amt
          |      ,row_number() over(partition by rowkey order by update_time desc) num
-         |      from $project.inc_ads_company_zxr_restrict
-         |      where length(case_no) > 0 and ds > '0'
+         |      from (
+         |        select case_no,company_name,company_info,name,court_name,case_create_time,rowkey,update_time
+         |        from $project.ads_company_zxr_restrict
+         |        where length(case_no) > 0 and ds > '0'
+         |        union all
+         |        select case_no,company_name,company_info,name,court_name,case_create_time,rowkey,update_time
+         |        from $project.inc_ads_company_zxr_restrict
+         |        where length(case_no) > 0 and ds > '0'
+         |      )
          |   )
          |where num = 1
          |""".stripMargin).show(10, false)
@@ -149,7 +163,7 @@ case class JudicialCaseRelationPre456(s: SparkSession, project: String
          |    ,company_info
          |    ,source
          |    ,status
-         |    ,appro_time
+         |    ,case_create_time
          |    ,A.create_time AS create_time
          |    ,A.update_time AS update_time
          |    ,A.deleted AS deleted
@@ -220,7 +234,7 @@ case class JudicialCaseRelationPre456(s: SparkSession, project: String
          |    ,A.company_info
          |    ,A.source
          |    ,A.status
-         |    ,A.appro_time
+         |    ,A.case_create_time
          |    ,A.create_time
          |    ,A.update_time
          |    ,A.deleted
@@ -273,7 +287,7 @@ case class JudicialCaseRelationPre456(s: SparkSession, project: String
          |    ,A.company_info
          |    ,A.source
          |    ,A.status
-         |    ,A.appro_time
+         |    ,A.case_create_time
          |    ,A.create_time
          |    ,A.update_time
          |    ,A.deleted
@@ -304,7 +318,7 @@ case class JudicialCaseRelationPre456(s: SparkSession, project: String
          |from (
          |      select
          |      md5(cleanup(case_no)) as judicase_id
-         |      ,"5" as flag
+         |      ,"6" as flag
          |      ,concat_ws('',name,'被采取限制消费措施') AS title
          |      ,concat_ws('',case_type(case_no)) as case_type
          |      ,NULL AS case_reason
@@ -313,7 +327,7 @@ case class JudicialCaseRelationPre456(s: SparkSession, project: String
          |      ,concat_ws('',case_stage(case_no)) as case_stage
          |      ,NULL as yg_name
          |      ,name as bg_name
-         |      ,appro_time as date--目前天眼查数据没有执行日期,先以此代替
+         |      ,case_create_time as date--目前天眼查数据没有执行日期,先以此代替
          |      ,rowkey as detail_id
          |      ,0.0 as case_amt
          |      ,row_number() over(partition by rowkey order by update_time desc) num