|
@@ -235,7 +235,105 @@ case class CompanySummaryPro(s: SparkSession,
|
|
}
|
|
}
|
|
|
|
|
|
object CompanySummaryPro {
|
|
object CompanySummaryPro {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ def run(spark: SparkSession, tab: String, target_tab: String = null): Unit = {
|
|
|
|
+ var csp: CompanySummaryPro = null
|
|
|
|
+
|
|
|
|
+ tab match {
|
|
|
|
+ case "company_dishonest_info" => {
|
|
|
|
+ csp = CompanySummaryPro(s = spark
|
|
|
|
+ , project = "winhc_eci_dev"
|
|
|
|
+ , tableName = "company_dishonest_info"
|
|
|
|
+ , cidField = "split(rowkey,'_')[0]"
|
|
|
|
+ , where = "deleted = 0"
|
|
|
|
+ , groupByInfo = GroupByInfo(field = "status", value_alias = Seq(
|
|
|
|
+ ("0", "company_dishonest_info_0")
|
|
|
|
+ , ("1", "company_dishonest_info_1")
|
|
|
|
+ ))
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ case "company_zxr_list" => {
|
|
|
|
+ csp = CompanySummaryPro(s = spark
|
|
|
|
+ , project = "winhc_eci_dev"
|
|
|
|
+ , tableName = "company_zxr_list"
|
|
|
|
+ , cidField = "split(rowkey,'_')[0]"
|
|
|
|
+ , where = "deleted = 0"
|
|
|
|
+ , groupByInfo = GroupByInfo(field = "status", value_alias = Seq(
|
|
|
|
+ ("0", "company_zxr_list_0")
|
|
|
|
+ , ("1", "company_zxr_list_1")
|
|
|
|
+ ))
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ case "company_zxr_restrict" => {
|
|
|
|
+ csp = CompanySummaryPro(s = spark
|
|
|
|
+ , project = "winhc_eci_dev"
|
|
|
|
+ , tableName = "company_zxr_restrict"
|
|
|
|
+ , cidField = "split(rowkey,'_')[0]"
|
|
|
|
+ , where = "deleted = 0"
|
|
|
|
+ , groupByInfo = GroupByInfo(field = "status", value_alias = Seq(
|
|
|
|
+ ("0", "company_zxr_restrict_0")
|
|
|
|
+ , ("1", "company_zxr_restrict_1")
|
|
|
|
+ ))
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ case "company_land_mortgage" => {
|
|
|
|
+ //土地抵押
|
|
|
|
+ csp = CompanySummaryPro(s = spark
|
|
|
|
+ , project = "winhc_eci_dev"
|
|
|
|
+ , tableName = "company_land_mortgage"
|
|
|
|
+ , cidField = "split(rowkey,'_')[0]"
|
|
|
|
+ // , where = "deleted = 0"
|
|
|
|
+ , groupByInfo = GroupByInfo(field = "type", value_alias = Seq(
|
|
|
|
+ ("mortgagor", "company_land_mortgage_mortgagor")
|
|
|
|
+ , ("mortgagee", "company_land_mortgage_mortgagee")
|
|
|
|
+ , ("bothsame", "company_land_mortgage_bothsame")
|
|
|
|
+ , ("bothone", "company_land_mortgage_bothone")
|
|
|
|
+ , ("bothtwo", "company_land_mortgage_bothtwo")
|
|
|
|
+ ))
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ case "company_land_transfer" => {
|
|
|
|
+ //土地转让
|
|
|
|
+ csp = CompanySummaryPro(s = spark
|
|
|
|
+ , project = "winhc_eci_dev"
|
|
|
|
+ , tableName = "company_land_transfer"
|
|
|
|
+ , cidField = "split(rowkey,'_')[0]"
|
|
|
|
+ // , where = "deleted = 0"
|
|
|
|
+ , groupByInfo = GroupByInfo(field = "type", value_alias = Seq(
|
|
|
|
+ ("pre", "company_land_transfer_pre")
|
|
|
|
+ , ("now", "company_land_transfer_now")
|
|
|
|
+ , ("bothsame", "company_land_transfer_bothsame")
|
|
|
|
+ , ("bothone", "company_land_transfer_bothone")
|
|
|
|
+ , ("bothtwo", "company_land_transfer_bothtwo")
|
|
|
|
+ ))
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ case _ =>
|
|
|
|
+ csp = CompanySummaryPro(s = spark
|
|
|
|
+ , project = "winhc_eci_dev"
|
|
|
|
+ , tableName = tab
|
|
|
|
+ , cidField = "split(rowkey,'_')[0]"
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (target_tab == null)
|
|
|
|
+ csp.calc()
|
|
|
|
+ else
|
|
|
|
+ csp.calc(is_inc = false, target_tab = target_tab)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
def main(args: Array[String]): Unit = {
|
|
def main(args: Array[String]): Unit = {
|
|
|
|
+
|
|
|
|
+ val Array(tab) = args
|
|
|
|
+
|
|
|
|
+ println(
|
|
|
|
+ s"""
|
|
|
|
+ |tab: $tab
|
|
|
|
+ |""".stripMargin)
|
|
|
|
+
|
|
val config = mutable.Map(
|
|
val config = mutable.Map(
|
|
"spark.hadoop.odps.project.name" -> "winhc_eci_dev",
|
|
"spark.hadoop.odps.project.name" -> "winhc_eci_dev",
|
|
"spark.debug.maxToStringFields" -> "200",
|
|
"spark.debug.maxToStringFields" -> "200",
|
|
@@ -243,12 +341,8 @@ object CompanySummaryPro {
|
|
)
|
|
)
|
|
|
|
|
|
val spark = SparkUtils.InitEnv(getClass.getSimpleName, config)
|
|
val spark = SparkUtils.InitEnv(getClass.getSimpleName, config)
|
|
- CompanySummaryPro(s = spark
|
|
|
|
- , project = "winhc_eci_dev"
|
|
|
|
- , tableName = "company_env_punishment"
|
|
|
|
- , cidField = "split(rowkey,'_')[0]"
|
|
|
|
- )
|
|
|
|
- .calc(is_inc = false, target_tab = "winhc_eci_dev.xjk_tmp_summary")
|
|
|
|
|
|
+
|
|
|
|
+ run(spark, tab, "winhc_eci_dev.xjk_tmp_summary")
|
|
|
|
|
|
spark.stop()
|
|
spark.stop()
|
|
}
|
|
}
|