|
@@ -152,8 +152,9 @@ case class JudicialCaseRelationPreNew(s: SparkSession, project: String, ds: Stri
|
|
|
| ,case_id as detail_id
|
|
|
| ,case_amt
|
|
|
|FROM (
|
|
|
- | SELECT *
|
|
|
+ | SELECT id,max(judicase_id) judicase_id
|
|
|
| FROM $project.ads_judicial_case_relation_graph WHERE flag = 'wenshu_detail'
|
|
|
+ | GROUP BY id
|
|
|
| ) a
|
|
|
|RIGHT JOIN (
|
|
|
| SELECT *,md5(cleanup(case_no_trim(case_no))) as new_judicase_id
|
|
@@ -356,13 +357,15 @@ case class JudicialCaseRelationPreNew(s: SparkSession, project: String, ds: Stri
|
|
|
| ,case_amt
|
|
|
| ,md5(CLEANUP(case_no_trim(case_no))) as new_judicase_id
|
|
|
| from $project.$t2
|
|
|
- | where ds= '$t2_ds' and tn not in ('wenshu','zxr','zxr_person','company_dishonest_info','company_dishonest_info_person') and case_no_trim(case_no) is not null
|
|
|
+ | where ds= '$t2_ds' and tn not in ('wenshu','zxr','zxr_person','company_dishonest_info','company_dishonest_info_person')
|
|
|
+ | and case_no_trim(case_no) is not null
|
|
|
| and date is not null and length(date) = 19
|
|
|
|) a
|
|
|
|LEFT JOIN (
|
|
|
| select case_no_trim(case_no) as case_no,max(judicase_id) judicase_id
|
|
|
| from $project.$t2
|
|
|
- | where ds = '$t2_ds' and tn in ('wenshu','zxr','zxr_person','company_dishonest_info','company_dishonest_info_person') and case_no_trim(case_no) is not null
|
|
|
+ | where ds = '$t2_ds' and tn in ('wenshu','zxr','zxr_person','company_dishonest_info','company_dishonest_info_person')
|
|
|
+ | and case_no_trim(case_no) is not null
|
|
|
| group by case_no
|
|
|
|) b
|
|
|
|ON CLEANUP(a.case_no) = CLEANUP(b.case_no)
|
|
@@ -383,7 +386,8 @@ case class JudicialCaseRelationPreNew(s: SparkSession, project: String, ds: Stri
|
|
|
| ,detail_id
|
|
|
| ,case_amt
|
|
|
|from $project.$t2
|
|
|
- |where ds = '$t2_ds' and tn in ('wenshu','zxr','zxr_person','company_dishonest_info','company_dishonest_info_person') and case_no_trim(case_no) is not null
|
|
|
+ |where ds = '$t2_ds' and tn in ('wenshu','zxr','zxr_person','company_dishonest_info','company_dishonest_info_person')
|
|
|
+ | and case_no_trim(case_no) is not null
|
|
|
| and date is not null and length(date) = 19
|
|
|
|""".stripMargin).show(10, false)
|
|
|
|