CREATE TABLE REC_LOAN_LAST."rec_xwbank_cus_info_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(64),
	"cust_no" VARCHAR(64),
	"cert_type" VARCHAR(12),
	"cert_no" VARCHAR(32),
	"cust_name" VARCHAR(64),
	"gender" VARCHAR(64),
	"birth_day" VARCHAR(24),
	"phone" VARCHAR(24),
	"address" VARCHAR(800),
	"area" VARCHAR(64),
	"city" VARCHAR(64),
	"province" VARCHAR(64),
	"relate_name" VARCHAR(64),
	"relate_type" VARCHAR(64),
	"relate_phone" VARCHAR(24),
	"company_name" VARCHAR(64),
	"company_type" VARCHAR(24),
	"company_address" VARCHAR(800),
	"company_area" VARCHAR(64),
	"company_city" VARCHAR(64),
	"company_province" VARCHAR(64),
	"resid_zip" VARCHAR(24),
	"home_add" VARCHAR(800),
	"postal_address_zip" VARCHAR(800),
	"company_zip" VARCHAR(24),
	"post_zip" VARCHAR(24),
	"marital_sts" VARCHAR(6),
	"education" VARCHAR(6),
	"per_monthly_pay" dec(20,4),
	"home_phone" VARCHAR(24),
	"occupation" VARCHAR(24),
	"position" VARCHAR(24),
	"title_code" VARCHAR(24),
	"reserve" VARCHAR(24),
	"idcard_address" VARCHAR(800),
	"idcard_start_date" VARCHAR(24),
	"idcard_end_date" VARCHAR(24),
	"issue_cert_org" VARCHAR(64),
	"ethnic" VARCHAR(6),
	"ready_data" text,
	"living_status" varchar(12),
	"degree" varchar(24),
	"cert_area" varchar(12),
	"cert_city" varchar(12),
	"cert_province" varchar(12),
	"spouse_name" varchar(64),
	"spouse_cert_type" varchar(12),
	"spouse_cert_no" varchar(64),
	"spouse_work_comp_name" varchar(128),
	"spouse_work_comp_phone" varchar(32),
	"credit_home_address" varchar(255),
	"credit_comp_address" varchar(255),
	"credit_home_phone" varchar(24),
	"credit_comp_phone" varchar(24),
	"cust_ctry" VARCHAR(24),



	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT rec_xwbank_cus_info_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_rec_cus_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_cus_info_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_cus_info_tmp IS '新网银行临时客户表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.biz_date IS '业务日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.cust_no IS '新网客户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.cert_type IS '证件类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.cert_no IS '证件号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.cust_name IS '客户名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.gender IS '性别';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.birth_day IS '生日';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.phone IS '电话号码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.address IS '居住地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.area IS '区县';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.city IS '城市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.province IS '省份';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.relate_name IS '联系人';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.relate_type IS '联系人关系';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.relate_phone IS '联系人电话';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.company_name IS '公司名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.company_type IS '公司类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.company_address IS '公司地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.company_area IS '公司所在区县';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.company_city IS '公司所在城市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.company_province IS '公司所在省份';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.resid_zip IS '居住地邮编';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.home_add IS '家庭地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.postal_address_zip IS '通讯地址邮编';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.company_zip IS '公司所在地邮编';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.marital_sts IS '婚姻状况';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.education IS '学历';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.per_monthly_pay IS '个人月收入';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.home_phone IS '住宅电话';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.occupation IS '职业';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.position IS '本人职务';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.title_code IS '本人职称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.reserve IS '备用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.idcard_address IS '身份证地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.idcard_start_date IS '身份证有效期起 ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.idcard_end_date IS '身份证有效期止';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.issue_cert_org IS '发证机关';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.reserve IS '民族';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.cust_ctry IS '国籍';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.ready_data IS '预留字段';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.living_status IS '居住状况';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.degree IS '学位';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.cert_area IS '身份证区';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.cert_city IS '身份证市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.cert_province IS '身份证省';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.spouse_name IS '配偶姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.spouse_cert_type IS '配偶证件类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.spouse_cert_no IS '配偶证件号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.spouse_work_comp_name IS '配偶工作单位';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.spouse_work_comp_phone IS '配偶工作电话';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.credit_home_address IS '征信居住地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.credit_comp_address IS '征信单位地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.credit_home_phone IS '征信住宅电话';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_tmp.credit_comp_phone IS '征信单位电话';


CREATE TABLE REC_LOAN_LAST."rec_xwbank_cus_info_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(64),
	"cust_no" VARCHAR(64),
	"cert_type" VARCHAR(12),
	"cert_no" VARCHAR(32),
	"cust_name" VARCHAR(64),
	"gender" VARCHAR(64),
	"birth_day" VARCHAR(24),
	"phone" VARCHAR(24),
	"address" VARCHAR(800),
	"area" VARCHAR(64),
	"city" VARCHAR(64),
	"province" VARCHAR(64),
	"relate_name" VARCHAR(64),
	"relate_type" VARCHAR(64),
	"relate_phone" VARCHAR(24),
	"company_name" VARCHAR(64),
	"company_type" VARCHAR(24),
	"company_address" VARCHAR(800),
	"company_area" VARCHAR(64),
	"company_city" VARCHAR(64),
	"company_province" VARCHAR(64),
	"resid_zip" VARCHAR(24),
	"home_add" VARCHAR(800),
	"postal_address_zip" VARCHAR(800),
	"company_zip" VARCHAR(24),
	"post_zip" VARCHAR(24),
	"marital_sts" VARCHAR(6),
	"education" VARCHAR(6),
	"per_monthly_pay" dec(20,4),
	"home_phone" VARCHAR(24),
	"occupation" VARCHAR(24),
	"position" VARCHAR(24),
	"title_code" VARCHAR(24),
	"reserve" VARCHAR(24),
	"idcard_address" VARCHAR(800),
	"idcard_start_date" VARCHAR(24),
	"idcard_end_date" VARCHAR(24),
	"issue_cert_org" VARCHAR(64),
	"ethnic" VARCHAR(6),
	"ready_data" text,
	"living_status" varchar(12),
	"degree" varchar(24),
	"cert_area" varchar(12),
	"cert_city" varchar(12),
	"cert_province" varchar(12),
	"spouse_name" varchar(64),
	"spouse_cert_type" varchar(12),
	"spouse_cert_no" varchar(64),
	"spouse_work_comp_name" varchar(128),
	"spouse_work_comp_phone" varchar(32),
	"credit_home_address" varchar(255),
	"credit_comp_address" varchar(255),
	"credit_home_phone" varchar(24),
	"credit_comp_phone" varchar(24),
	"cust_ctry" VARCHAR(24),



	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_cus_info_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_rec_cus_his_bizdate ON REC_LOAN_LAST."rec_xwbank_cus_info_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_cus_info_his IS '新网银行临时客户表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.biz_date IS '业务日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.cust_no IS '新网客户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.cert_type IS '证件类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.cert_no IS '证件号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.cust_name IS '客户名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.gender IS '性别';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.birth_day IS '生日';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.phone IS '电话号码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.address IS '居住地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.area IS '区县';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.city IS '城市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.province IS '省份';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.relate_name IS '联系人';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.relate_type IS '联系人关系';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.relate_phone IS '联系人电话';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.company_name IS '公司名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.company_type IS '公司类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.company_address IS '公司地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.company_area IS '公司所在区县';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.company_city IS '公司所在城市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.company_province IS '公司所在省份';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.resid_zip IS '居住地邮编';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.home_add IS '家庭地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.postal_address_zip IS '通讯地址邮编';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.company_zip IS '公司所在地邮编';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.marital_sts IS '婚姻状况';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.education IS '学历';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.per_monthly_pay IS '个人月收入';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.home_phone IS '住宅电话';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.occupation IS '职业';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.position IS '本人职务';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.title_code IS '本人职称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.reserve IS '备用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.idcard_address IS '身份证地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.idcard_start_date IS '身份证有效期起 ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.idcard_end_date IS '身份证有效期止';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.issue_cert_org IS '发证机关';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.reserve IS '民族';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.cust_ctry IS '国籍';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.ready_data IS '预留字段';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.living_status IS '居住状况';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.degree IS '学位';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.cert_area IS '身份证区';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.cert_city IS '身份证市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.cert_province IS '身份证省';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.spouse_name IS '配偶姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.spouse_cert_type IS '配偶证件类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.spouse_cert_no IS '配偶证件号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.spouse_work_comp_name IS '配偶工作单位';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.spouse_work_comp_phone IS '配偶工作电话';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.credit_home_address IS '征信居住地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.credit_comp_address IS '征信单位地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.credit_home_phone IS '征信住宅电话';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_cus_info_his.credit_comp_phone IS '征信单位电话';




CREATE TABLE REC_LOAN_LAST."rec_xwbank_credit_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(64),
	"cust_no" VARCHAR(64),
	"limit_no" VARCHAR(64),
	"limit_type" VARCHAR(18),
	"limit_amt" DEC(20,4),
	"used_amt" DEC(20,4),
	"uncancle_amt" DEC(20,4),
	"actual_repay_no_enter"  DEC(20,4),
	"failure_date" VARCHAR(24),
	"effective_date" VARCHAR(24),
	"cont_no" VARCHAR(64),
	"credit_order_no" VARCHAR(64),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_credit_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_credit_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_credit_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_credit_tmp IS '新网银行客户授信信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.cust_no IS '新网客户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.limit_no IS '额度编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.limit_type IS '额度类型X004 好人贷-XW 现金分期
额度
X008 好人贷-YX 现金分期
额度
X009 好人贷-XM 现金分期
额度
根据具体合作
产品定义
X010 好人贷-QD 现金分期
额度
X011 好人贷-ML 现金分期
额度
X068 好人贷-DSD 现金分
期额度';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.limit_amt IS '当前生效额度';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.used_amt IS '已使用额度';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.uncancle_amt IS '未对消授权金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.actual_repay_no_enter IS '实时还款未入账金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.failure_date IS '失效日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.effective_date IS '当前额度生效日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.cont_no IS '合同号';






CREATE TABLE REC_LOAN_LAST."rec_xwbank_credit_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(64),
	"cust_no" VARCHAR(64),
	"limit_no" VARCHAR(64),
	"limit_type" VARCHAR(18),
	"limit_amt" DEC(20,4),
	"used_amt" DEC(20,4),
	"uncancle_amt" DEC(20,4),
	"actual_repay_no_enter"  DEC(20,4),
	"failure_date" VARCHAR(24),
	"effective_date" VARCHAR(24),
	"cont_no" VARCHAR(64),
	"credit_order_no" VARCHAR(64),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_credit_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_credit_his_bizdate ON REC_LOAN_LAST."rec_xwbank_credit_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_credit_his IS '新网银行客户授信信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.cust_no IS '新网客户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.limit_no IS '额度编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.limit_type IS '额度类型X004 好人贷-XW 现金分期
额度
X008 好人贷-YX 现金分期
额度
X009 好人贷-XM 现金分期
额度
根据具体合作
产品定义
X010 好人贷-QD 现金分期
额度
X011 好人贷-ML 现金分期
额度
X068 好人贷-DSD 现金分
期额度';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.limit_amt IS '当前生效额度';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.used_amt IS '已使用额度';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.uncancle_amt IS '未对消授权金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.actual_repay_no_enter IS '实时还款未入账金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.failure_date IS '失效日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.effective_date IS '当前额度生效日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.cont_no IS '合同号';














CREATE TABLE REC_LOAN_LAST."rec_xwbank_loandetail_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"term" INT,
	"pay_out_date" VARCHAR(12),
	"loan_end_date" VARCHAR(12),
	"first_repay_date" VARCHAR(12),
	"loan_amt" DEC(20,4),
	"loan_usage" VARCHAR(12),
	"repay_type" VARCHAR(12),
	"loan_rate" VARCHAR(16),
	"cust_name" VARCHAR(32),
	"tran_value_date" VARCHAR(12),
	"stop_int_date" VARCHAR(12),
	"repayed_term" INT,
    "payoff_date" VARCHAR(12),
    "rate_type" VARCHAR(4),
    "repay_cycle_type" VARCHAR(4),
    "loan_type" VARCHAR(4),
    "cus_type" VARCHAR(4),
    "prd_no" VARCHAR(32),
    "prd_name" VARCHAR(32),
    "account_sts" VARCHAR(4),
    "guarantee_flag" VARCHAR(4),
    "normal_balance_amt" DEC(20,4),
    "due_balance_amt" DEC(20,4),
    "penalty_interest" DEC(20,4),
    "over_interest" DEC(20,4),
    "penalty_rate" VARCHAR(16),
    "cust_no" VARCHAR(32),
    "cont_no" VARCHAR(32),
    "max_due_day" INT,
    "bank_card_no" VARCHAR(128),
    "bank_name" VARCHAR(32),
    "payee_name" VARCHAR(32),
    "update_flag" VARCHAR(32),
    "ser_no" VARCHAR(32),
    "biaoneiwai_flag" VARCHAR(4),
    "lpr_rate" VARCHAR(18),
    "float_point" VARCHAR(18),
    "loan_order_no" VARCHAR(64),
    "cust_rate" VARCHAR(64),
    "loan_ratio" VARCHAR(64),
    "loan_arrival_time"  VARCHAR(64),
    "clearing_transaction_no" VARCHAR(64),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_loandetail_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_loandetail_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_loandetail_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_loandetail_tmp IS '新网银行贷款明细表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.term IS '借据总期数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.pay_out_date IS '借款发放日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.loan_end_date IS '最后一期还款计划结
清日';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.first_repay_date IS '第一期还款计划的还
款日
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.loan_amt IS '借款金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.loan_usage IS '借款用途';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.repay_type IS '还款方式';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.loan_rate IS '利率-日利率';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.cust_name IS '客户姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.tran_value_date IS '交易起息日-订单生成日(贷款发
放日期）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.stop_int_date IS '停息标志 ： 1 停息 0 未停息  ：订单取消、订单结清
(正常还款、提前结
清、代偿、代扣）会
停息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.repayed_term IS '已还期数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.payoff_date IS '结清日';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.rate_type IS '利率类型  (01:固定,02:浮动,03:阶段)';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.repay_cycle_type IS '还款周期 0- 月
6- 年
7- 一次性
9- 其他';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.loan_type IS '贷款类型 03-消费贷； 联合贷默认值';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.cus_type IS '借款人类型  07-自然人； 联合贷默认值';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.prd_no IS '产品编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.prd_name IS '产品名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.account_sts IS '账户状态';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.guarantee_flag IS '担保方式 4-信用/免担保；';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.normal_balance_amt IS '正常本金余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.due_balance_amt IS '逾期本金余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.penalty_interest IS '罚息金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.over_interest IS '逾期利息金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.penalty_rate IS '罚息利率';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.cust_no IS '客户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.cont_no IS '合同号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.max_due_day IS '最大延滞天数截止目前为止，该笔借据逾
期且未结清最小一期的延
滞天数（订单最大逾期天
数）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.bank_card_no IS '收款人银行账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.bank_name IS '收款人账户银行';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.payee_name IS '收款人名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.update_flag IS '更新标示0：新增
1：更新';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.ser_no IS '交易流水号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.biaoneiwai_flag IS '表内外计息标识O-表外计息
I-表内计息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.lpr_rate IS 'LPR 值，年利率';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_tmp.float_point IS '浮动值';









CREATE TABLE REC_LOAN_LAST."rec_xwbank_loandetail_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"term" INT,
	"pay_out_date" VARCHAR(12),
	"loan_end_date" VARCHAR(12),
	"first_repay_date" VARCHAR(12),
	"loan_amt" DEC(20,4),
	"loan_usage" VARCHAR(12),
	"repay_type" VARCHAR(12),
	"loan_rate" VARCHAR(16),
	"cust_name" VARCHAR(32),
	"tran_value_date" VARCHAR(12),
	"stop_int_date" VARCHAR(12),
	"repayed_term" INT,
    "payoff_date" VARCHAR(12),
    "rate_type" VARCHAR(4),
    "repay_cycle_type" VARCHAR(4),
    "loan_type" VARCHAR(4),
    "cus_type" VARCHAR(4),
    "prd_no" VARCHAR(32),
    "prd_name" VARCHAR(32),
    "account_sts" VARCHAR(4),
    "guarantee_flag" VARCHAR(4),
    "normal_balance_amt" DEC(20,4),
    "due_balance_amt" DEC(20,4),
    "penalty_interest" DEC(20,4),
    "over_interest" DEC(20,4),
    "penalty_rate" VARCHAR(16),
    "cust_no" VARCHAR(32),
    "cont_no" VARCHAR(32),
    "max_due_day" INT,
    "bank_card_no" VARCHAR(128),
    "bank_name" VARCHAR(32),
    "payee_name" VARCHAR(32),
    "update_flag" VARCHAR(32),
    "ser_no" VARCHAR(32),
    "biaoneiwai_flag" VARCHAR(4),
    "lpr_rate" VARCHAR(18),
    "float_point" VARCHAR(18),
     "loan_order_no" VARCHAR(64),
    "cust_rate" VARCHAR(64),
    "loan_ratio" VARCHAR(64),
    "loan_arrival_time"  VARCHAR(64),
    "clearing_transaction_no" VARCHAR(64),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_loandetail_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_loandetail_his_bizdate ON REC_LOAN_LAST."rec_xwbank_loandetail_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_loandetail_his IS '新网银行贷款明细表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.term IS '借据总期数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.pay_out_date IS '借款发放日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.loan_end_date IS '最后一期还款计划结
清日';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.first_repay_date IS '第一期还款计划的还
款日
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.loan_amt IS '借款金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.loan_usage IS '借款用途';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.repay_type IS '还款方式';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.loan_rate IS '利率-日利率';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.cust_name IS '客户姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.tran_value_date IS '交易起息日-订单生成日(贷款发
放日期）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.stop_int_date IS '停息标志 ： 1 停息 0 未停息  ：订单取消、订单结清
(正常还款、提前结
清、代偿、代扣）会
停息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.repayed_term IS '已还期数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.payoff_date IS '结清日';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.rate_type IS '利率类型  (01:固定,02:浮动,03:阶段)';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.repay_cycle_type IS '还款周期 0- 月
6- 年
7- 一次性
9- 其他';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.loan_type IS '贷款类型 03-消费贷； 联合贷默认值';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.cus_type IS '借款人类型  07-自然人； 联合贷默认值';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.prd_no IS '产品编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.prd_name IS '产品名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.account_sts IS '账户状态';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.guarantee_flag IS '担保方式 4-信用/免担保；';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.normal_balance_amt IS '正常本金余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.due_balance_amt IS '逾期本金余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.penalty_interest IS '罚息金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.over_interest IS '逾期利息金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.penalty_rate IS '罚息利率';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.cust_no IS '客户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.cont_no IS '合同号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.max_due_day IS '最大延滞天数截止目前为止，该笔借据逾
期且未结清最小一期的延
滞天数（订单最大逾期天
数）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.bank_card_no IS '收款人银行账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.bank_name IS '收款人账户银行';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.payee_name IS '收款人名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.update_flag IS '更新标示0：新增
1：更新';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.ser_no IS '交易流水号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.biaoneiwai_flag IS '表内外计息标识O-表外计息
I-表内计息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.lpr_rate IS 'LPR 值，年利率';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_loandetail_his.float_point IS '浮动值';





CREATE TABLE REC_LOAN_LAST."rec_xwbank_repay_plan_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"term" INT,
	"last_repay_date" VARCHAR(12),
	"tran_date" VARCHAR(12),
	"total_repay_amt" DEC(20,4),
	"plan_principal_amt" DEC(20,4),
	"plan_interest_amt" DEC(20,4),
	"now_term_sts" VARCHAR(4),
	"term_no" INT,
	"now_term_due_day" INT,
	"now_total_amt" DEC(20,4),
	"now_prin_amt" DEC(20,4),
	"now_curr_int_amt" DEC(20,4),
	"now_due_total_amt" DEC(20,4),
	"curr_pnlt_amt" DEC(20,4),
	"paid_prin_amt" DEC(20,4),
	"paid_int_amt" DEC(20,4),
	"real_repay_date" VARCHAR(12),
	"paid_pnlt_amt" DEC(20,4),
	"payoff_sts" VARCHAR(4),
	"plan_repay_date" VARCHAR(12),
	"plan_start_date" VARCHAR(12),
	"plan_rate" VARCHAR(16),
    "prin_bal" DEC(20,4),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_repay_plan_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_repay_plan_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_repay_plan_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_repay_plan_tmp IS '新网银行还款计划表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.term IS '借据总期数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.last_repay_date IS '还款截至日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.tran_date IS '交易日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.total_repay_amt IS '应还金额  该订单本金总额+利息总额+罚息总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.plan_principal_amt IS '计划本金-该订单本金总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.plan_interest_amt IS '计划利息-该订单利息总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.now_term_sts IS '状态 0-新建
    1-已抛帐；
    2-正常结清；
    3 逾期；
    9-已取消、已失效
    10-已回购结清
    11-已代偿结清
  本期次还款计划状态；已抛账为当前贷款正常期次计息中';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.term_no IS '期数-还款计划中本期所处第几
         期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.now_term_due_day IS '本期延滞天数-本期逾期天数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.now_total_amt IS '当期总金额:当期总金额=当期本金
    +当期利息+当期罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.now_prin_amt IS '当期本金';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.now_curr_int_amt IS '当期利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.now_due_total_amt IS '当期逾期金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.curr_pnlt_amt IS '当期罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.paid_prin_amt IS '本期实还本金';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.paid_int_amt IS '本期实还利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.real_repay_date IS '本期实际还款日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.paid_pnlt_amt IS '本期实还罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.payoff_sts IS '本期结清标记 0-否；1-是';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.plan_repay_date IS '本期计划还款日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.plan_start_date IS '本期开始日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.plan_rate IS '本期利率';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_tmp.prin_bal IS '剩余本金-扣除本期本金后贷款剩余
  本金';






CREATE TABLE REC_LOAN_LAST."rec_xwbank_repay_plan_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"term" INT,
	"last_repay_date" VARCHAR(12),
	"tran_date" VARCHAR(12),
	"total_repay_amt" DEC(20,4),
	"plan_principal_amt" DEC(20,4),
	"plan_interest_amt" DEC(20,4),
	"now_term_sts" VARCHAR(4),
	"term_no" INT,
	"now_term_due_day" INT,
	"now_total_amt" DEC(20,4),
	"now_prin_amt" DEC(20,4),
	"now_curr_int_amt" DEC(20,4),
	"now_due_total_amt" DEC(20,4),
	"curr_pnlt_amt" DEC(20,4),
	"paid_prin_amt" DEC(20,4),
	"paid_int_amt" DEC(20,4),
	"real_repay_date" VARCHAR(12),
	"paid_pnlt_amt" DEC(20,4),
	"payoff_sts" VARCHAR(4),
	"plan_repay_date" VARCHAR(12),
	"plan_start_date" VARCHAR(12),
	"plan_rate" VARCHAR(16),
    "prin_bal" DEC(20,4),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_repay_plan_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_repay_plan_his_bizdate ON REC_LOAN_LAST."rec_xwbank_repay_plan_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_repay_plan_his IS '新网银行还款计划表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.term IS '借据总期数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.last_repay_date IS '还款截至日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.tran_date IS '交易日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.total_repay_amt IS '应还金额  该订单本金总额+利息总额+罚息总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.plan_principal_amt IS '计划本金-该订单本金总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.plan_interest_amt IS '计划利息-该订单利息总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.now_term_sts IS '状态 0-新建
    1-已抛帐；
    2-正常结清；
    3 逾期；
    9-已取消、已失效
    10-已回购结清
    11-已代偿结清
  本期次还款计划状态；已抛账为当前贷款正常期次计息中';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.term_no IS '期数-还款计划中本期所处第几
         期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.now_term_due_day IS '本期延滞天数-本期逾期天数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.now_total_amt IS '当期总金额:当期总金额=当期本金
    +当期利息+当期罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.now_prin_amt IS '当期本金';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.now_curr_int_amt IS '当期利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.now_due_total_amt IS '当期逾期金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.curr_pnlt_amt IS '当期罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.paid_prin_amt IS '本期实还本金';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.paid_int_amt IS '本期实还利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.real_repay_date IS '本期实际还款日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.paid_pnlt_amt IS '本期实还罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.payoff_sts IS '本期结清标记 0-否；1-是';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.plan_repay_date IS '本期计划还款日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.plan_start_date IS '本期开始日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.plan_rate IS '本期利率';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_plan_his.prin_bal IS '剩余本金-扣除本期本金后贷款剩余本金';





CREATE TABLE REC_LOAN_LAST."rec_xwbank_repay_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"repay_date" VARCHAR(12),
	"repay_prin_amt" DEC(20,4),
	"repay_int_amt" DEC(20,4),
	"repay_fee_amt" DEC(20,4),
	"paid_pnlt_amt" DEC(20,4),
    "in_date" VARCHAR(24),
    "in_amt" DEC(20,4),
    "term_no" INT,
    "auto_repay_type" VARCHAR(4),
    "ser_no" VARCHAR(32),
    "hexiao_type" VARCHAR(4),
    "prin_int_charging_date" varchar(24),
    "liquidation_no" varchar(64),
    "repay_account_type" varchar(12),
    "repay_card_no" VARCHAR(32),



	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_repay_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_repay_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_repay_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_repay_tmp IS '新网银行还款计划表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.repay_date IS '还款日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.repay_prin_amt IS '交易本金';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.repay_int_amt IS '交易利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.repay_fee_amt IS '交易费用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.paid_pnlt_amt IS '交易罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.in_date IS '入账日期-该借据抛账日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.in_amt IS '入账金额=交易本金+交易利息+交易罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.term_no IS '第几期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.auto_repay_type IS '自动还款标识   (0 - 自动扣款 1 - 主动还款)';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.ser_no IS '交易流水号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.hexiao_type IS '核销还款标志01 核销前还款-02 核销后还款';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_tmp.repay_card_no IS '还款卡号';







CREATE TABLE REC_LOAN_LAST."rec_xwbank_repay_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"repay_date" VARCHAR(12),
	"repay_prin_amt" DEC(20,4),
	"repay_int_amt" DEC(20,4),
	"repay_fee_amt" DEC(20,4),
	"paid_pnlt_amt" DEC(20,4),
    "in_date" VARCHAR(24),
    "in_amt" DEC(20,4),
    "term_no" INT,
    "auto_repay_type" VARCHAR(4),
    "ser_no" VARCHAR(32),
    "hexiao_type" VARCHAR(4),
     "prin_int_charging_date" varchar(24),
    "liquidation_no" varchar(64),
    "repay_account_type" varchar(12),

    "repay_card_no" VARCHAR(32),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_repay_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_repay_his_bizdate ON REC_LOAN_LAST."rec_xwbank_repay_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_repay_his IS '新网银行还款计划表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.repay_date IS '还款日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.repay_prin_amt IS '交易本金';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.repay_int_amt IS '交易利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.repay_fee_amt IS '交易费用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.paid_pnlt_amt IS '交易罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.in_date IS '入账日期-该借据抛账日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.in_amt IS '入账金额=交易本金+交易利息+交易罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.term_no IS '第几期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.auto_repay_type IS '自动还款标识   (0 - 自动扣款 1 - 主动还款)';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.ser_no IS '交易流水号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.hexiao_type IS '核销还款标志01 核销前还款-02 核销后还款';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_repay_his.repay_card_no IS '还款卡号';







CREATE TABLE REC_LOAN_LAST."rec_xwbank_specialbusiness_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"happen_date" VARCHAR(12),
	"special_type" VARCHAR(4),
	"special_amt" DEC(20,4),
    "special_term" INT,
    "detail_info" VARCHAR(800),
    "repay_plan_chg_flag" VARCHAR(4),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_specialbusiness_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_specialbusiness_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp IS '新网银行特殊交易接表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.happen_date IS '发生日期-特殊交易发生日期。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.special_type IS '特殊交易类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.special_amt IS '特殊交易金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.special_term IS '变更期次';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.detail_info IS '明细信息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.repay_plan_chg_flag IS '还款计划变更标识-此次特殊交易是否引起还款
计划变更。代码表：
1-是；
2-否。
';






CREATE TABLE REC_LOAN_LAST."rec_xwbank_specialbusiness_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"happen_date" VARCHAR(12),
	"special_type" VARCHAR(4),
	"special_amt" DEC(20,4),
    "special_term" INT,
    "detail_info" VARCHAR(800),
    "repay_plan_chg_flag" VARCHAR(4),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_specialbusiness_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_specialbusiness_his_bizdate ON REC_LOAN_LAST."rec_xwbank_specialbusiness_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_specialbusiness_his IS '新网银行特殊交易接表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.happen_date IS '发生日期-特殊交易发生日期。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.special_type IS '特殊交易类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.special_amt IS '特殊交易金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.special_term IS '变更期次';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.detail_info IS '明细信息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_specialbusiness_tmp.repay_plan_chg_flag IS '还款计划变更标识-此次特殊交易是否引起还款
计划变更。代码表：
1-是；
2-否。
';






CREATE TABLE REC_LOAN_LAST."rec_xwbank_acctflow_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"happen_date" VARCHAR(12),
	"ccy" VARCHAR(12),
	"tran_code" VARCHAR(10),
	"tran_desc" VARCHAR(600),
	"loan_code" VARCHAR(4),
	"in_amt" DEC(20,4),
	"bank_no"  VARCHAR(32),
	"prd_no"  VARCHAR(32),
	"class_no"  VARCHAR(10),
	"xw_id"  VARCHAR(10),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_acctflow_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_acctflow_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_acctflow_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_acctflow_tmp IS '新网银行会计分录日报表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.happen_date IS '交易发生日期。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.ccy IS '币种';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.tran_code IS '交易码：50099 贷款发放
50111 罚息计提
50110 利息计提
20150 利息收回
20050 本金回收
20354 本金回收
（退货）
20059 本金回收
（单期代偿）
20155 利息回收
（贴息）
20355 利息回收
（退货）
20151 罚息回收
20158 罚息回收
（单期代偿）
20159 利息回收
（单期代偿）
20350 本金回收
（整笔回购）
20351 利息回收
（整笔回购）
20353 罚息回收
（整笔回购）
50211 手续费计提
50212 延滞手续费
计提
20261 扣收手续费
20262
扣收延滞手
续费
59100 已结利息
及累计利息从表内转 出
59101 累计罚息
从表内转出
90110 表外利息
计提
90111 表外罚息
计提
57101 已转出的
罚息转回表内
57111 在表外累
计的罚息转回表内
57100 已转出的
利息转回表内
57110 在表外累
计的利息转回表内
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.tran_desc IS '交易描述';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.loan_code IS '借贷标记 代码表：
 D-借；
 C-贷。
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.in_amt IS '入账金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.bank_no IS '分支行号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.prd_no IS '产品号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.class_no IS '科目 1301 个人贷款
         1501 应收利息
         2111 同业存放
        2311 储蓄活期
        存款
        6001 贷款利息
        收入
        2705 服务费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_tmp.xw_id IS '新网数据主键 ID';







CREATE TABLE REC_LOAN_LAST."rec_xwbank_acctflow_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"happen_date" VARCHAR(12),
	"ccy" VARCHAR(12),
	"tran_code" VARCHAR(10),
	"tran_desc" VARCHAR(600),
	"loan_code" VARCHAR(4),
	"in_amt" DEC(20,4),
	"bank_no"  VARCHAR(32),
	"prd_no"  VARCHAR(32),
	"class_no"  VARCHAR(10),
	"xw_id"  VARCHAR(10),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_acctflow_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_acctflow_his_bizdate ON REC_LOAN_LAST."rec_xwbank_acctflow_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_acctflow_his IS '新网银行会计分录日报表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.happen_date IS '交易发生日期。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.ccy IS '币种';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.tran_code IS '交易码：50099 贷款发放
50111 罚息计提
50110 利息计提
20150 利息收回
20050 本金回收
20354 本金回收
（退货）
20059 本金回收
（单期代偿）
20155 利息回收
（贴息）
20355 利息回收
（退货）
20151 罚息回收
20158 罚息回收
（单期代偿）
20159 利息回收
（单期代偿）
20350 本金回收
（整笔回购）
20351 利息回收
（整笔回购）
20353 罚息回收
（整笔回购）
50211 手续费计提
50212 延滞手续费
计提
20261 扣收手续费
20262
扣收延滞手
续费
59100 已结利息
及累计利息从表内转 出
59101 累计罚息
从表内转出
90110 表外利息
计提
90111 表外罚息
计提
57101 已转出的
罚息转回表内
57111 在表外累
计的罚息转回表内
57100 已转出的
利息转回表内
57110 在表外累
计的利息转回表内
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.tran_desc IS '交易描述';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.loan_code IS '借贷标记 代码表：
 D-借；
 C-贷。
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.in_amt IS '入账金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.bank_no IS '分支行号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.prd_no IS '产品号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.class_no IS '科目 1301 个人贷款
         1501 应收利息
         2111 同业存放
        2311 储蓄活期
        存款
        6001 贷款利息
        收入
        2705 服务费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acctflow_his.xw_id IS '新网数据主键 ID';






CREATE TABLE REC_LOAN_LAST."rec_xwbank_bfjflow_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"bfj_account" VARCHAR(64),
	"happen_date" VARCHAR(12),
	"class_name" VARCHAR(12),
	"tran_amt" DEC(20,4),
	"tran_desc" VARCHAR(800),
	"loan_code" VARCHAR(4),
	"loan_no" VARCHAR(64),
	"ser_no" VARCHAR(64),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_bfjflow_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_bfjflow_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_bfjflow_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_bfjflow_tmp IS '新网银行备付金流水表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_tmp.bfj_account IS '备付金账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_tmp.happen_date IS '日期。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_tmp.tran_amt IS '交易金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_tmp.tran_desc IS '交易描述。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_tmp.loan_code IS '借贷标记
代码表：
D-借；
C-贷。。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_tmp.class_name IS '科目1301-贷款科目
1501-应收利息
2111-还款科目
2705-应付手续费';




CREATE TABLE REC_LOAN_LAST."rec_xwbank_bfjflow_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"bfj_account" VARCHAR(64),
	"happen_date" VARCHAR(12),
	"class_name" VARCHAR(12),
	"tran_amt" DEC(20,4),
	"tran_desc" VARCHAR(800),
	"loan_code" VARCHAR(4),
	"loan_no" VARCHAR(64),
	"ser_no" VARCHAR(64),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_bfjflow_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_bfjflow_his_bizdate ON REC_LOAN_LAST."rec_xwbank_bfjflow_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_bfjflow_his IS '新网银行备付金流水表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_his.bfj_account IS '备付金账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_his.happen_date IS '日期。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_his.tran_amt IS '交易金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_his.tran_desc IS '交易描述。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_his.loan_code IS '借贷标记
代码表：
D-借；
C-贷。。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjflow_his.class_name IS '科目1301-贷款科目
1501-应收利息
2111-还款科目
2705-应付手续费';


CREATE TABLE REC_LOAN_LAST."rec_xwbank_bfjsum_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"bfj_account" VARCHAR(64),
	"happen_date" VARCHAR(12),
	"account_amt" DEC(20,4),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_bfjsum_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_bfjsum_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_bfjsum_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_bfjsum_tmp IS '新网银行备付金总额表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjsum_tmp.bfj_account IS '备付金账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjsum_tmp.happen_date IS '日期。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjsum_tmp.account_amt IS '账号金额';






CREATE TABLE REC_LOAN_LAST."rec_xwbank_bfjsum_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"bfj_account" VARCHAR(64),
	"happen_date" VARCHAR(12),
	"account_amt" DEC(20,4),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_bfjsum_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_bfjsum_his_bizdate ON REC_LOAN_LAST."rec_xwbank_bfjsum_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_bfjsum_his IS '新网银行备付金总额表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjsum_his.bfj_account IS '备付金账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjsum_his.happen_date IS '日期。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_bfjsum_his.account_amt IS '账号金额';







CREATE TABLE REC_LOAN_LAST."rec_xwbank_acct_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"rec_date" VARCHAR(12),
	"pre_day_loan_amt" DEC(20,4),
	"same_day_pay_amt" DEC(20,4),
	"same_day_retrieve_amt" DEC(20,4),
	"same_day_loan_amt" DEC(20,4),
	"pre_day_int_amt" DEC(20,4),
	"same_day_bnjt_int_amt" DEC(20,4),
	"same_day_retrieve_int_amt" DEC(20,4),
	"same_day_bnys_int_bln_amt" DEC(20,4),
	"pre_day_bnys_pnlt_bln_amt" DEC(20,4),
	"same_day_bnjt_pnlt_amt" DEC(20,4),
	"same_day_bn_retrieve_pnlt_amt" DEC(20,4),
	"same_day_bnys_pnlt_bln_amt" DEC(20,4),
	"same_day_charge_off_amt" DEC(20,4),
	"same_day_charge_off_int_amt" DEC(20,4),
	"same_day_charge_off_pnlt_amt" DEC(20,4),
	"pre_day_pay_fee_bln_amt" DEC(20,4),
	"same_day_pay_fee_amt" DEC(20,4),
	"same_day_deducts_fee_amt" DEC(20,4),
	"same_day_pay_fee_bln_amt" DEC(20,4),
	"same_day_charge_off_fee_amt" DEC(20,4),
	"pre_day_overdue_fee_amt" DEC(20,4),
	"same_day_overdue_fee_amt" DEC(20,4),
	"same_day_deducts_overdue_fee_amt" DEC(20,4),
	"same_day_overdue_fee_bln_amt" DEC(20,4),
	"same_day_charge_off_overdue_fee_amt" DEC(20,4),
	"pre_day_bwys_int_bln_amt" DEC(20,4),
	"same_day_bwjt_int_amt" DEC(20,4),
    "same_day_bwys_int_bln_amt" DEC(20,4),
    "same_day_bwys_charge_off_int_amt" DEC(20,4),
    "pre_day_bw_pnlt_bln_amt" DEC(20,4),
    "same_day_bwjt_pnlt_amt" DEC(20,4),
    "same_day_bwys_pnlt_bln_amt" DEC(20,4),
    "same_day_bw_charge_off_pnlt_amt" DEC(20,4),
    "bn_to_bw_overdue_int_amt" DEC(20,4),
    "bn_to_bw_plnt_amt" DEC(20,4),
    "bw_to_bn_overdue_int_amt" DEC(20,4),
    "bw_to_bn_plnt_amt" DEC(20,4),
    "pre_day_fyj_loan_amt" DEC(20,4),
    "same_day_fyj_add_loan_amt" DEC(20,4),
    "same_day_fyj_sub_loan_amt" DEC(20,4),
    "same_day_fyj_loan_amt" DEC(20,4),
    "pre_day_bw_write_off_loan_bln_amt" DEC(20,4),
    "same_day_bw_write_off_loan_amt" DEC(20,4),
    "total_bw_write_off_loan_bln_amt" DEC(20,4),
    "pre_day_bw_write_off_int_bln_amt" DEC(20,4),
    "same_day_bw_write_off_int_amt" DEC(20,4),
    "total_bw_write_off_int_bln_amt" DEC(20,4),
    "pre_day_bw_write_off_pnlt_bln_amt" DEC(20,4),
    "same_day_bw_write_off_pnlt_amt" DEC(20,4),
    "total_bw_write_off_pnlt_bln_amt" DEC(20,4),
    "same_day_retrieve_write_off_loan_amt" DEC(20,4),
    "same_day_retrieve_write_off_int_amt" DEC(20,4),
    "same_day_retrieve_write_off_pnlt_amt" DEC(20,4),
    "same_day_bwbj_write_off_int_amt" DEC(20,4),
    "same_day_bwbj_write_off_pnlt_amt" DEC(20,4),
    "pre_day_short_term_loan_prin_bln" dec(20,4),
    "pre_day_midlong_term_loan_prin_bln" dec(20,4),
    "same_day_short_term_loan_prin_amt" dec(20,4),
    "same_day_midlong_term_loan_prin_amt" dec(20,4),
    "same_day_retrieve_short_term_loan_prin_amt" dec(20,4),
    "same_day_retrieve_midlong_term_loan_prin_amt" dec(20,4),
    "same_day_short_term_loan_prin_bln" dec(20,4),
    "same_day_midlong_term_loan_prin_bln" dec(20,4),
    "same_day_write_off_short_term_loan_prin_amt" dec(20,4),
    "same_day_write_off_midlong_term_loan_prin_amt" dec(20,4),
    "same_day_bw_write_off_short_term_loan_prin_amt" dec(20,4),
    "same_day_bw_write_off_midlong_term_loan_prin_amt" dec(20,4),


	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_acct_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_acct_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_acct_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_acct_tmp IS '新网银行日总额核对台账表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.rec_date IS '对账日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_loan_amt IS '上日贷款本金余额 T 日前贷款总余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_pay_amt IS '当日发放本金总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_retrieve_amt IS '当日回收本金总额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_loan_amt IS '当日贷款本金余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_int_amt IS '上日应收利息余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bnjt_int_amt IS '当日表内计提应收利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_retrieve_int_amt IS '当日回收利息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bnys_int_bln_amt IS '当日表内应收利息余额 变动后计算公式=上日表内应收利息余额+当日转回表内逾期利息总额+当日表内计提应收利息-当日回收利息-当日转至表外逾期利息总额-当日表内冲销利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_bnys_pnlt_bln_amt IS '上日表内应收罚息余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bnjt_pnlt_amt IS '当日表内计提应收罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bn_retrieve_pnlt_amt IS '当日表内回收罚息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bnys_pnlt_bln_amt IS '当日表内应收罚息余额:变动后计算公式=上日表
内应收罚息余额+当日转
回表内逾期罚息总额+当
日表内计提应收罚息-当
日回收罚息-当日转至表
外逾期罚息总额-当日表
内冲销罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_charge_off_amt IS '当日冲销本金总额-特殊场景下，对本金冲
     销当日总和。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_charge_off_int_amt IS '当日表内冲销利息-特殊场景下，对利息冲
         销当日总和';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_charge_off_pnlt_amt IS '当日表内冲销罚息-特殊场景下，对罚息冲
销当日总和';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_pay_fee_bln_amt IS '上日应付正常费用余额-目前新网系统是每日扣
       收合作行约定回收利息
       手续费，如果当日扣费
       账户资金不足，则会在
       下一日扣收，该字段会
       累加未扣收部分金额，
       一旦扣收则减去
。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_pay_fee_amt IS '当日应付正常费用-当日合作行利息回收新
  网应扣合作行费用
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_deducts_fee_amt IS '当日扣收正常费用-当日合作行利息回收新
      网实扣合作行费用。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_pay_fee_bln_amt IS '当日应付正常费用余额-当日合作行利息回收新
        网应扣合作行费用未扣
        收部分金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_charge_off_fee_amt IS '当日冲销正常费用-当日因扣费计提多计提
         而冲销的金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_overdue_fee_amt IS '上日应付延滞费用余额-上一日新网应扣合作行逾期罚息费用而未扣金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_overdue_fee_amt IS '当日应付延滞费用-当日新网应扣合作行逾
      期罚息费用金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_deducts_overdue_fee_amt IS '当日扣收延滞费用-当日新网实扣合作行逾
    期罚息费用金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_overdue_fee_bln_amt IS '当日应付延滞费用余额-当日新网应扣合作行逾
  期罚息费用而未扣金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_charge_off_overdue_fee_amt IS '当日冲销延滞费用-当日因逾期扣费计提多
       计提而冲销的金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_bwys_int_bln_amt IS '上日表外应收利息余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bwjt_int_amt IS '当日表外计提应收利息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bwys_int_bln_amt IS '当日表外应收利息余额-公式=上日表外应收利息
         余额+当日转至表外逾期
         利息总额+当日表外计提
         应收利息-当日转回表内
         逾期利息总额-当日表外
         冲销利息
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bwys_charge_off_int_amt IS '当日表外冲销利息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_bw_pnlt_bln_amt IS '上日表外应收罚息余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bwjt_pnlt_amt IS '当日表外计提应收罚息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bwys_pnlt_bln_amt IS '当日表外应收罚息余额-公式=上日表外应收罚息
余额+当日转至表外罚息
总额+当日表外计提应收
罚息-当日转回表内罚息
总额-当日表外冲销罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bw_charge_off_pnlt_amt IS '当日表外冲销罚息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.bn_to_bw_overdue_int_amt IS '转至表外逾期利息总额-包括表内已经逾期的利
        息以及在表内已计提的
        正常利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.bn_to_bw_plnt_amt IS '转至表外罚息总额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.bw_to_bn_overdue_int_amt IS '转回表内逾期利息总额-包括原表内转入表外的
        逾期利息以及此后在表
        外继续计提的利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.bw_to_bn_plnt_amt IS '转回表内罚息总额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_fyj_loan_amt IS '昨日非应计贷款本金余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_fyj_add_loan_amt IS '当日新增非应计贷款本金总额-当天新增的逾期超过 90天的借据的贷款本金总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_fyj_sub_loan_amt IS '当日减少非应计贷款本金
        总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_fyj_loan_amt IS '今日非应计贷款本金余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_bw_write_off_loan_bln_amt IS '上日表外核销贷款本金余
      额 ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bw_write_off_loan_amt IS '当日表外核销贷款本金。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.total_bw_write_off_loan_bln_amt IS '累计表外核销贷款本金余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_bw_write_off_int_bln_amt IS '上日表外核销贷款利息余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bw_write_off_int_amt IS '当日表外核销贷款利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.total_bw_write_off_int_bln_amt IS '累计表外核销贷款利息余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_bw_write_off_pnlt_bln_amt IS '上日表外核销贷款罚息余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bw_write_off_pnlt_amt IS '当日表外核销贷款罚息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.total_bw_write_off_pnlt_bln_amt IS '累计表外核销贷款罚息余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_retrieve_write_off_loan_amt IS '当日收回已核销贷款本金。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_retrieve_write_off_int_amt IS '当日收回已核销贷款利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_retrieve_write_off_pnlt_amt IS '当日收回已核销贷款罚息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bwbj_write_off_int_amt IS '当日表外补计核销贷款利息 ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bwbj_write_off_pnlt_amt IS '当日表外补计核销贷款罚息。';




CREATE TABLE REC_LOAN_LAST."rec_xwbank_acct_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"rec_date" VARCHAR(12),
	"pre_day_loan_amt" DEC(20,4),
	"same_day_pay_amt" DEC(20,4),
	"same_day_retrieve_amt" DEC(20,4),
	"same_day_loan_amt" DEC(20,4),
	"pre_day_int_amt" DEC(20,4),
	"same_day_bnjt_int_amt" DEC(20,4),
	"same_day_retrieve_int_amt" DEC(20,4),
	"same_day_bnys_int_bln_amt" DEC(20,4),
	"pre_day_bnys_pnlt_bln_amt" DEC(20,4),
	"same_day_bnjt_pnlt_amt" DEC(20,4),
	"same_day_bn_retrieve_pnlt_amt" DEC(20,4),
	"same_day_bnys_pnlt_bln_amt" DEC(20,4),
	"same_day_charge_off_amt" DEC(20,4),
	"same_day_charge_off_int_amt" DEC(20,4),
	"same_day_charge_off_pnlt_amt" DEC(20,4),
	"pre_day_pay_fee_bln_amt" DEC(20,4),
	"same_day_pay_fee_amt" DEC(20,4),
	"same_day_deducts_fee_amt" DEC(20,4),
	"same_day_pay_fee_bln_amt" DEC(20,4),
	"same_day_charge_off_fee_amt" DEC(20,4),
	"pre_day_overdue_fee_amt" DEC(20,4),
	"same_day_overdue_fee_amt" DEC(20,4),
	"same_day_deducts_overdue_fee_amt" DEC(20,4),
	"same_day_overdue_fee_bln_amt" DEC(20,4),
	"same_day_charge_off_overdue_fee_amt" DEC(20,4),
	"pre_day_bwys_int_bln_amt" DEC(20,4),
	"same_day_bwjt_int_amt" DEC(20,4),
    "same_day_bwys_int_bln_amt" DEC(20,4),
    "same_day_bwys_charge_off_int_amt" DEC(20,4),
    "pre_day_bw_pnlt_bln_amt" DEC(20,4),
    "same_day_bwjt_pnlt_amt" DEC(20,4),
    "same_day_bwys_pnlt_bln_amt" DEC(20,4),
    "same_day_bw_charge_off_pnlt_amt" DEC(20,4),
    "bn_to_bw_overdue_int_amt" DEC(20,4),
    "bn_to_bw_plnt_amt" DEC(20,4),
    "bw_to_bn_overdue_int_amt" DEC(20,4),
    "bw_to_bn_plnt_amt" DEC(20,4),
    "pre_day_fyj_loan_amt" DEC(20,4),
    "same_day_fyj_add_loan_amt" DEC(20,4),
    "same_day_fyj_sub_loan_amt" DEC(20,4),
    "same_day_fyj_loan_amt" DEC(20,4),
    "pre_day_bw_write_off_loan_bln_amt" DEC(20,4),
    "same_day_bw_write_off_loan_amt" DEC(20,4),
    "total_bw_write_off_loan_bln_amt" DEC(20,4),
    "pre_day_bw_write_off_int_bln_amt" DEC(20,4),
    "same_day_bw_write_off_int_amt" DEC(20,4),
    "total_bw_write_off_int_bln_amt" DEC(20,4),
    "pre_day_bw_write_off_pnlt_bln_amt" DEC(20,4),
    "same_day_bw_write_off_pnlt_amt" DEC(20,4),
    "total_bw_write_off_pnlt_bln_amt" DEC(20,4),
    "same_day_retrieve_write_off_loan_amt" DEC(20,4),
    "same_day_retrieve_write_off_int_amt" DEC(20,4),
    "same_day_retrieve_write_off_pnlt_amt" DEC(20,4),
    "same_day_bwbj_write_off_int_amt" DEC(20,4),
    "same_day_bwbj_write_off_pnlt_amt" DEC(20,4),
    "pre_day_short_term_loan_prin_bln" dec(20,4),
    "pre_day_midlong_term_loan_prin_bln" dec(20,4),
    "same_day_short_term_loan_prin_amt" dec(20,4),
    "same_day_midlong_term_loan_prin_amt" dec(20,4),
    "same_day_retrieve_short_term_loan_prin_amt" dec(20,4),
    "same_day_retrieve_midlong_term_loan_prin_amt" dec(20,4),
    "same_day_short_term_loan_prin_bln" dec(20,4),
    "same_day_midlong_term_loan_prin_bln" dec(20,4),
    "same_day_write_off_short_term_loan_prin_amt" dec(20,4),
    "same_day_write_off_midlong_term_loan_prin_amt" dec(20,4),
    "same_day_bw_write_off_short_term_loan_prin_amt" dec(20,4),
    "same_day_bw_write_off_midlong_term_loan_prin_amt" dec(20,4),


	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_acct_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_acct_his_bizdate ON REC_LOAN_LAST."rec_xwbank_acct_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_acct_his IS '新网银行日总额核对台账表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.rec_date IS '对账日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_loan_amt IS '上日贷款本金余额 T 日前贷款总余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_pay_amt IS '当日发放本金总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_retrieve_amt IS '当日回收本金总额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_loan_amt IS '当日贷款本金余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_int_amt IS '上日应收利息余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bnjt_int_amt IS '当日表内计提应收利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_retrieve_int_amt IS '当日回收利息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bnys_int_bln_amt IS '当日表内应收利息余额 变动后计算公式=上日表内应收利息余额+当日转回表内逾期利息总额+当日表内计提应收利息-当日回收利息-当日转至表外逾期利息总额-当日表内冲销利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_bnys_pnlt_bln_amt IS '上日表内应收罚息余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bnjt_pnlt_amt IS '当日表内计提应收罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bn_retrieve_pnlt_amt IS '当日表内回收罚息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bnys_pnlt_bln_amt IS '当日表内应收罚息余额:变动后计算公式=上日表
内应收罚息余额+当日转
回表内逾期罚息总额+当
日表内计提应收罚息-当
日回收罚息-当日转至表
外逾期罚息总额-当日表
内冲销罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_charge_off_amt IS '当日冲销本金总额-特殊场景下，对本金冲
     销当日总和。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_charge_off_int_amt IS '当日表内冲销利息-特殊场景下，对利息冲
         销当日总和';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_charge_off_pnlt_amt IS '当日表内冲销罚息-特殊场景下，对罚息冲
销当日总和';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_pay_fee_bln_amt IS '上日应付正常费用余额-目前新网系统是每日扣
       收合作行约定回收利息
       手续费，如果当日扣费
       账户资金不足，则会在
       下一日扣收，该字段会
       累加未扣收部分金额，
       一旦扣收则减去
。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_pay_fee_amt IS '当日应付正常费用-当日合作行利息回收新
  网应扣合作行费用
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_deducts_fee_amt IS '当日扣收正常费用-当日合作行利息回收新
      网实扣合作行费用。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_pay_fee_bln_amt IS '当日应付正常费用余额-当日合作行利息回收新
        网应扣合作行费用未扣
        收部分金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_charge_off_fee_amt IS '当日冲销正常费用-当日因扣费计提多计提
         而冲销的金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_overdue_fee_amt IS '上日应付延滞费用余额-上一日新网应扣合作行逾期罚息费用而未扣金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_overdue_fee_amt IS '当日应付延滞费用-当日新网应扣合作行逾
      期罚息费用金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_deducts_overdue_fee_amt IS '当日扣收延滞费用-当日新网实扣合作行逾
    期罚息费用金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_overdue_fee_bln_amt IS '当日应付延滞费用余额-当日新网应扣合作行逾
  期罚息费用而未扣金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_charge_off_overdue_fee_amt IS '当日冲销延滞费用-当日因逾期扣费计提多
       计提而冲销的金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_bwys_int_bln_amt IS '上日表外应收利息余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bwjt_int_amt IS '当日表外计提应收利息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bwys_int_bln_amt IS '当日表外应收利息余额-公式=上日表外应收利息
         余额+当日转至表外逾期
         利息总额+当日表外计提
         应收利息-当日转回表内
         逾期利息总额-当日表外
         冲销利息
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bwys_charge_off_int_amt IS '当日表外冲销利息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_bw_pnlt_bln_amt IS '上日表外应收罚息余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bwjt_pnlt_amt IS '当日表外计提应收罚息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bwys_pnlt_bln_amt IS '当日表外应收罚息余额-公式=上日表外应收罚息
余额+当日转至表外罚息
总额+当日表外计提应收
罚息-当日转回表内罚息
总额-当日表外冲销罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bw_charge_off_pnlt_amt IS '当日表外冲销罚息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.bn_to_bw_overdue_int_amt IS '转至表外逾期利息总额-包括表内已经逾期的利
        息以及在表内已计提的
        正常利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.bn_to_bw_plnt_amt IS '转至表外罚息总额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.bw_to_bn_overdue_int_amt IS '转回表内逾期利息总额-包括原表内转入表外的
        逾期利息以及此后在表
        外继续计提的利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.bw_to_bn_plnt_amt IS '转回表内罚息总额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_fyj_loan_amt IS '昨日非应计贷款本金余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_fyj_add_loan_amt IS '当日新增非应计贷款本金总额-当天新增的逾期超过 90天的借据的贷款本金总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_fyj_sub_loan_amt IS '当日减少非应计贷款本金
        总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_fyj_loan_amt IS '今日非应计贷款本金余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_bw_write_off_loan_bln_amt IS '上日表外核销贷款本金余
      额 ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bw_write_off_loan_amt IS '当日表外核销贷款本金。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.total_bw_write_off_loan_bln_amt IS '累计表外核销贷款本金余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_bw_write_off_int_bln_amt IS '上日表外核销贷款利息余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bw_write_off_int_amt IS '当日表外核销贷款利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.total_bw_write_off_int_bln_amt IS '累计表外核销贷款利息余额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_bw_write_off_pnlt_bln_amt IS '上日表外核销贷款罚息余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bw_write_off_pnlt_amt IS '当日表外核销贷款罚息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.total_bw_write_off_pnlt_bln_amt IS '累计表外核销贷款罚息余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_retrieve_write_off_loan_amt IS '当日收回已核销贷款本金。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_retrieve_write_off_int_amt IS '当日收回已核销贷款利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_retrieve_write_off_pnlt_amt IS '当日收回已核销贷款罚息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bwbj_write_off_int_amt IS '当日表外补计核销贷款利息 ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bwbj_write_off_pnlt_amt IS '当日表外补计核销贷款罚息。';





CREATE TABLE REC_LOAN_LAST."rec_xwbank_file_num_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"file_date" VARCHAR(12),
	"cus_info_total" INT,
	"cus_credit_total" INT,
	"loan_detail_total" INT,
	"repay_plan_total" INT,
	"repay_detail_total" INT,
	"specialbusiness_total" INT,
	"acctflow_total" INT,
	"bfjflow_total" INT,
	"bfjsum_total" INT,
	"fee_stmt_total" INT,
	"rev_trans_total" INT,
	"car_info_total" INT,
	"fee_rel_total" INT,
	"buis_info_total" INT,
	"fee_detail_total" INT,
	"intr_trans_total" INT,
	"contract_rel_total" INT,
	"lhd22_total" INT,
	"attach_com_total" INT,
	"lhd23_total" INT,
	"enterpriseinfo_total" INT,
	"billinfo_total" INT,
	"coborrower_total" INT,
	"houseinfo_total" INT,




	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_file_num_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_file_num_his_bizdate ON REC_LOAN_LAST."rec_xwbank_file_num_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_file_num_his IS '新网银行备付金总额表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.file_date IS '日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.cus_info_total IS '客户信息总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.cus_credit_total IS '客户授信信息总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.loan_detail_total IS '贷款明细文件总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.repay_plan_total IS '还款计划总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.repay_detail_total IS '还款明细总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.specialbusiness_total IS '特殊交易总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.acctflow_total IS '会计分录日报总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.bfjflow_total IS '备付金流水总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.bfjsum_total IS '备付金总额总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.fee_stmt_total IS '扣费情况表总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.rev_trans_total IS '冲正类交易总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.car_info_total IS '车贷分级 2 文件总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.fee_rel_total IS '借据费用关系表总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.buis_info_total IS '企业经营信息总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.fee_detail_total IS '费用明细总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.intr_trans_total IS '逾期 90 天以上贷款利息结转总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.contract_rel_total IS '借据与贷款合同关系总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.lhd22_total IS '核销明细文件数据总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.attach_com_total IS '挂靠公司信息文件数据总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_his.lhd23_total IS '待核销文件数据总数。';



CREATE TABLE REC_LOAN_LAST."rec_xwbank_file_num_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"file_date" VARCHAR(12),
	"cus_info_total" INT,
	"cus_credit_total" INT,
	"loan_detail_total" INT,
	"repay_plan_total" INT,
	"repay_detail_total" INT,
	"specialbusiness_total" INT,
	"acctflow_total" INT,
	"bfjflow_total" INT,
	"bfjsum_total" INT,
	"fee_stmt_total" INT,
	"rev_trans_total" INT,
	"car_info_total" INT,
	"fee_rel_total" INT,
	"buis_info_total" INT,
	"fee_detail_total" INT,
	"intr_trans_total" INT,
	"contract_rel_total" INT,
	"lhd22_total" INT,
	"attach_com_total" INT,
	"lhd23_total" INT,
	"enterpriseinfo_total" INT,
	"billinfo_total" INT,
	"coborrower_total" INT,
	"houseinfo_total" INT,



	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_file_num_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_file_num_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_file_num_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_file_num_tmp IS '新网银行备付金总额表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.file_date IS '日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.cus_info_total IS '客户信息总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.cus_credit_total IS '客户授信信息总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.loan_detail_total IS '贷款明细文件总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.repay_plan_total IS '还款计划总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.repay_detail_total IS '还款明细总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.specialbusiness_total IS '特殊交易总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.acctflow_total IS '会计分录日报总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.bfjflow_total IS '备付金流水总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.bfjsum_total IS '备付金总额总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.fee_stmt_total IS '扣费情况表总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.rev_trans_total IS '冲正类交易总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.car_info_total IS '车贷分级 2 文件总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.fee_rel_total IS '借据费用关系表总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.buis_info_total IS '企业经营信息总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.fee_detail_total IS '费用明细总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.intr_trans_total IS '逾期 90 天以上贷款利息结转总数。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.contract_rel_total IS '借据与贷款合同关系总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.lhd22_total IS '核销明细文件数据总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.attach_com_total IS '挂靠公司信息文件数据总数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_file_num_tmp.lhd23_total IS '待核销文件数据总数。';





CREATE TABLE REC_LOAN_LAST."rec_xwbank_fee_stmt_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"account_no" VARCHAR(32),
	"tran_date" VARCHAR(12),
	"deduction_frequency" VARCHAR(4),
	"should_deduction_date" VARCHAR(12),
	"fee_start_date" VARCHAR(12),
	"fee_end_date" VARCHAR(12),
	"should_deduction_amt" DEC(18,4),
    "real_deduction_date" VARCHAR(12),
    "real_deduction_amt" DEC(18,4),
    "deduction_sts" VARCHAR(4),
    "ser_no" VARCHAR(32),
    "fee_type" VARCHAR(4),
    "deduction_id" VARCHAR(32),
    "deduction_name" VARCHAR(128),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_fee_stmt_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_fee_stmt_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp IS '新网银行扣费情况表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.account_no IS '账单号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.tran_date IS '交易日期 yyyy/MM/dd';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.deduction_frequency IS '扣费频率,0-按日扣费 1-按月扣费。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.should_deduction_date IS '应扣费日期 yyyy/MM/dd';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.fee_start_date IS '费用起始日期 费用明细的业务起始日期 （对应 1706）。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.fee_end_date IS '费用截止日期 （对应 1706）、例如，当“扣费频率”为0 时，费用起始日期同费用截止日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.should_deduction_amt IS '应扣费金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.real_deduction_date IS '实际扣费日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.real_deduction_amt IS '实际扣费金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.deduction_sts IS '扣费状态';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.fee_type IS '费用类型,1-正常费用 2-延滞费用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.deduction_id IS '扣费规则 ID';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_tmp.deduction_name IS '扣费规则名称';



CREATE TABLE REC_LOAN_LAST."rec_xwbank_fee_stmt_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"account_no" VARCHAR(32),
	"tran_date" VARCHAR(12),
	"deduction_frequency" VARCHAR(4),
	"should_deduction_date" VARCHAR(12),
	"fee_start_date" VARCHAR(12),
	"fee_end_date" VARCHAR(12),
	"should_deduction_amt" DEC(18,4),
    "real_deduction_date" VARCHAR(12),
    "real_deduction_amt" DEC(18,4),
    "deduction_sts" VARCHAR(4),
    "ser_no" VARCHAR(32),
    "fee_type" VARCHAR(4),
    "deduction_id" VARCHAR(32),
    "deduction_name" VARCHAR(32),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_fee_stmt_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_fee_stmt_his_bizdate ON REC_LOAN_LAST."rec_xwbank_fee_stmt_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_fee_stmt_his IS '新网银行扣费情况表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.account_no IS '账单号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.tran_date IS '交易日期 yyyy/MM/dd';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.deduction_frequency IS '扣费频率,0-按日扣费 1-按月扣费。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.should_deduction_date IS '应扣费日期 yyyy/MM/dd';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.fee_start_date IS '费用起始日期 费用明细的业务起始日期 （对应 1706）。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.fee_end_date IS '费用截止日期 （对应 1706）、例如，当“扣费频率”为0 时，费用起始日期同费用截止日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.should_deduction_amt IS '应扣费金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.real_deduction_date IS '实际扣费日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.real_deduction_amt IS '实际扣费金额。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.deduction_sts IS '扣费状态';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.ser_no IS '交易流水号。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.fee_type IS '费用类型。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.deduction_id IS '扣费规则 ID';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_stmt_his.deduction_name IS '扣费规则名称';




CREATE TABLE REC_LOAN_LAST."rec_xwbank_rev_trans_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"rev_reason" VARCHAR(4),
	"old_tran_date" VARCHAR(12),
	"rev_date" VARCHAR(12),
	"rev_amt" DEC(18,4),
	"rev_prin_amt" DEC(18,4),
	"rev_int_amt" DEC(18,4),
	"rev_pnlt_amt" DEC(18,4),
	"rev_fee_amt" DEC(18,4),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_rev_trans_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_rev_trans_his_bizdate ON REC_LOAN_LAST."rec_xwbank_rev_trans_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_rev_trans_his IS '新网银行冲正类交易表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_his.rev_reason IS '冲正原因 1- 放款冲销
   2- 还款冲销
   3- 免息冲销';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_his.old_tran_date IS '原交易日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_his.rev_date IS '冲正日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_his.rev_amt IS '冲正金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_his.rev_prin_amt IS '冲正本金';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_his.rev_int_amt IS '冲正利息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_his.rev_pnlt_amt IS '冲正罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_his.rev_fee_amt IS '冲销费用。';






CREATE TABLE REC_LOAN_LAST."rec_xwbank_rev_trans_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"rev_reason" VARCHAR(4),
	"old_tran_date" VARCHAR(12),
	"rev_date" VARCHAR(12),
	"rev_amt" DEC(18,4),
	"rev_prin_amt" DEC(18,4),
	"rev_int_amt" DEC(18,4),
	"rev_pnlt_amt" DEC(18,4),
	"rev_fee_amt" DEC(18,4),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_rev_trans_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_rev_trans_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_rev_trans_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_rev_trans_tmp IS '新网银行冲正类交易表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_tmp.rev_reason IS '冲正原因 1- 放款冲销
   2- 还款冲销
   3- 免息冲销';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_tmp.old_tran_date IS '原交易日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_tmp.rev_date IS '冲正日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_tmp.rev_amt IS '冲正金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_tmp.rev_prin_amt IS '冲正本金';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_tmp.rev_int_amt IS '冲正利息。';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_tmp.rev_pnlt_amt IS '冲正罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_rev_trans_tmp.rev_fee_amt IS '冲销费用。';





CREATE TABLE REC_LOAN_LAST."rec_xwbank_fee_rel_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"deduction_id" VARCHAR(32),
	"deduction_name" VARCHAR(32),
	"deduction_no" VARCHAR(32),
	"fee_rate" VARCHAR(20),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_fee_rel_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_fee_rel_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_fee_rel_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_fee_rel_tmp IS '新网银行借据费用关系表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_rel_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_rel_tmp.deduction_id IS '扣费规则 ID';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_rel_tmp.deduction_name IS '扣费规则名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_rel_tmp.deduction_no IS '扣费规则编码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_rel_tmp.fee_rate IS '费率,费用收取比例。';





CREATE TABLE REC_LOAN_LAST."rec_xwbank_fee_rel_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"deduction_id" VARCHAR(32),
	"deduction_name" VARCHAR(32),
	"deduction_no" VARCHAR(32),
	"fee_rate" VARCHAR(20),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_fee_rel_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_fee_rel_his_bizdate ON REC_LOAN_LAST."rec_xwbank_fee_rel_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_fee_rel_his IS '新网银行借据费用关系表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_rel_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_rel_his.deduction_id IS '扣费规则 ID';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_rel_his.deduction_name IS '扣费规则名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_rel_his.deduction_no IS '扣费规则编码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_rel_his.fee_rate IS '费率,费用收取比例。';







CREATE TABLE REC_LOAN_LAST."rec_xwbank_car_info_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"car_evaluate" DEC(18,4),
	"car_instalment_amt" DEC(18,4),
	"chaorong_instalment_amt" DEC(18,4),
	"down_payment_amt" DEC(18,4),
	"rest_amt" DEC(18,4),
	"chaorong_rate" VARCHAR(15),
	"car_type" VARCHAR(120),
	"vehicle_no" VARCHAR(60),
	"license_plate" VARCHAR(60),
	"car_model" VARCHAR(60),
	"car_colour" VARCHAR(60),
	"car_max_load" VARCHAR(20),
	"car_age" INT,
	"car_brand" VARCHAR(60),
	"output_volume" VARCHAR(20),
	"car_mileage" VARCHAR(20),
	"city" VARCHAR(40),
	"car_owner" VARCHAR(40),
	"car_issuance_certificate" VARCHAR(12),
	"mortgagee_name" VARCHAR(40),
	"mortgage_city" VARCHAR(40),
	"mortgage_reg_date" VARCHAR(20),
	"gps_install_sts" VARCHAR(20),
	"purchase_tax_amt" VARCHAR(20),
	"seller_phone" VARCHAR(20),
	"seller_name" VARCHAR(40),
	"seller_addr" VARCHAR(220),
	"spouse_cert_no" VARCHAR(24),
	"chaorong_amt" DEC(18,4),
	"ornament_amt" DEC(18,4),
	"insurance_financing" DEC(18,4),
	"purchase_tax_financing" DEC(18,4),
	"maintenance_amt" DEC(18,4),
	"financial_leasing_service_fee" DEC(18,4),
	"registration_service_fee" DEC(18,4),
	"gps_fee" DEC(18,4),
	"platform_management_fee" DEC(18,4),
	"dealer_service_fee" DEC(18,4),
	"other_fee" DEC(18,4),




	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_car_info_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_car_info_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_car_info_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_car_info_tmp IS '新网银行新网车贷分级审批 2 任务完成后交易信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_evaluate IS '车辆结算价';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_instalment_amt IS '车款融资分期部分';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.chaorong_instalment_amt IS '超融分期金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.down_payment_amt IS '首付车款金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.rest_amt IS '车款融资尾款部分';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.chaorong_rate IS '超融比例';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_type IS '车辆车型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_model IS '车辆类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.vehicle_no IS '车架号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.license_plate IS '车牌号码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_colour IS '车身颜色';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_max_load IS '车辆准载';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_age IS '车龄';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_brand IS '车辆品牌';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.output_volume IS '汽车排量';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_mileage IS '车辆里程数(公里)';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.city IS '城市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_owner IS '机动车所有人';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.car_issuance_certificate IS '机动车合格证发证日期
 （仅新车）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.mortgagee_name IS '抵押权利人';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.mortgage_city IS '抵押登记城市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.mortgage_reg_date IS '抵押登记时间';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.gps_install_sts IS 'GPS 是否安装';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.purchase_tax_amt IS '购置税发票金额（仅新
   车） ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.seller_phone IS '卖家手机';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.seller_name IS '卖家名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.seller_addr IS '卖家地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.spouse_cert_no IS '配偶身份证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.chaorong_amt IS '超融总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.ornament_amt IS '装饰费用（增配） ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.insurance_financing IS '保险融资金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.purchase_tax_financing IS '购置税融资金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.maintenance_amt IS '保养费用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.financial_leasing_service_fee IS '融资租赁服务费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.registration_service_fee IS '上牌服务费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.gps_fee IS 'GPS 费用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.platform_management_fee IS '平台管理费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.dealer_service_fee IS '经销商服务费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_tmp.other_fee IS '其他费用';




CREATE TABLE REC_LOAN_LAST."rec_xwbank_car_info_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"car_evaluate" DEC(18,4),
	"car_instalment_amt" DEC(18,4),
	"chaorong_instalment_amt" DEC(18,4),
	"down_payment_amt" DEC(18,4),
	"rest_amt" DEC(18,4),
	"chaorong_rate" VARCHAR(15),
	"car_type" VARCHAR(120),
	"vehicle_no" VARCHAR(60),
	"license_plate" VARCHAR(60),
	"car_model" VARCHAR(60),
	"car_colour" VARCHAR(60),
	"car_max_load" VARCHAR(20),
	"car_age" INT,
	"car_brand" VARCHAR(60),
	"output_volume" VARCHAR(20),
	"car_mileage" VARCHAR(20),
	"city" VARCHAR(40),
	"car_owner" VARCHAR(40),
	"car_issuance_certificate" VARCHAR(12),
	"mortgagee_name" VARCHAR(40),
	"mortgage_city" VARCHAR(40),
	"mortgage_reg_date" VARCHAR(20),
	"gps_install_sts" VARCHAR(20),
	"purchase_tax_amt" VARCHAR(20),
	"seller_phone" VARCHAR(20),
	"seller_name" VARCHAR(40),
	"seller_addr" VARCHAR(220),
	"spouse_cert_no" VARCHAR(24),
	"chaorong_amt" DEC(18,4),
	"ornament_amt" DEC(18,4),
	"insurance_financing" DEC(18,4),
	"purchase_tax_financing" DEC(18,4),
	"maintenance_amt" DEC(18,4),
	"financial_leasing_service_fee" DEC(18,4),
	"registration_service_fee" DEC(18,4),
	"gps_fee" DEC(18,4),
	"platform_management_fee" DEC(18,4),
	"dealer_service_fee" DEC(18,4),
	"other_fee" DEC(18,4),




	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_car_info_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_car_info_his_bizdate ON REC_LOAN_LAST."rec_xwbank_car_info_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_car_info_his IS '新网银行新网车贷分级审批 2 任务完成后交易信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_evaluate IS '车辆结算价';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_instalment_amt IS '车款融资分期部分';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.chaorong_instalment_amt IS '超融分期金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.down_payment_amt IS '首付车款金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.rest_amt IS '车款融资尾款部分';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.chaorong_rate IS '超融比例';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_type IS '车辆车型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_model IS '车辆类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.vehicle_no IS '车架号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.license_plate IS '车牌号码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_colour IS '车身颜色';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_max_load IS '车辆准载';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_age IS '车龄';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_brand IS '车辆品牌';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.output_volume IS '汽车排量';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_mileage IS '车辆里程数(公里)';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.city IS '城市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_owner IS '机动车所有人';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.car_issuance_certificate IS '机动车合格证发证日期
 （仅新车）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.mortgagee_name IS '抵押权利人';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.mortgage_city IS '抵押登记城市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.mortgage_reg_date IS '抵押登记时间';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.gps_install_sts IS 'GPS 是否安装';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.purchase_tax_amt IS '购置税发票金额（仅新
   车） ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.seller_phone IS '卖家手机';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.seller_name IS '卖家名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.seller_addr IS '卖家地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.spouse_cert_no IS '配偶身份证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.chaorong_amt IS '超融总额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.ornament_amt IS '装饰费用（增配） ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.insurance_financing IS '保险融资金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.purchase_tax_financing IS '购置税融资金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.maintenance_amt IS '保养费用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.financial_leasing_service_fee IS '融资租赁服务费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.registration_service_fee IS '上牌服务费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.gps_fee IS 'GPS 费用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.platform_management_fee IS '平台管理费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.dealer_service_fee IS '经销商服务费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_car_info_his.other_fee IS '其他费用';




CREATE TABLE REC_LOAN_LAST."rec_xwbank_fee_detail_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"xw_id" VARCHAR(32),
	"loan_no" VARCHAR(32),
	"cust_no" VARCHAR(32),
	"cust_name" VARCHAR(32),
	"tran_date" VARCHAR(12),
	"fee_date" VARCHAR(12),
	"fee_flag" VARCHAR(12),
	"trem_no" INT,
	"billing_base" DEC(20,4),
	"fee_type" VARCHAR(4),
	"deduction_id" VARCHAR(32),
    "deduction_name" VARCHAR(32),
    "fee_rate" VARCHAR(32),
    "should_deduction_amt" DEC(20,4),





	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_fee_detail_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_fee_detail_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_fee_detail_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_fee_detail_tmp IS '新网银行费用明细表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.xw_id IS '新网id';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.cust_no IS '客户编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.cust_name IS '客户姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.tran_date IS '交易日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.fee_date IS '费用日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.fee_flag IS '停费标识 0-未停止计费 1-停止计费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.trem_no IS '第几期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.billing_base IS '计费基数 费用计算基数  该订单的实还利息、罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.fee_type IS '费用类型  1-正常费用 2-延滞费用  以利息为计费基数计算为正常费用，以罚息为计费基数计算为延滞费用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.deduction_id IS '扣费规则 ID';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.deduction_name IS '扣费规则名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.fee_rate IS '费率';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_tmp.should_deduction_amt IS '应扣费金额';




CREATE TABLE REC_LOAN_LAST."rec_xwbank_fee_detail_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"xw_id" VARCHAR(32),
	"loan_no" VARCHAR(32),
	"cust_no" VARCHAR(32),
	"cust_name" VARCHAR(32),
	"tran_date" VARCHAR(12),
	"fee_date" VARCHAR(12),
	"fee_flag" VARCHAR(12),
	"trem_no" INT,
	"billing_base" DEC(20,4),
	"fee_type" VARCHAR(4),
	"deduction_id" VARCHAR(32),
    "deduction_name" VARCHAR(32),
    "fee_rate" VARCHAR(32),
    "should_deduction_amt" DEC(20,4),





	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_fee_detail_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_fee_detail_his_bizdate ON REC_LOAN_LAST."rec_xwbank_fee_detail_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_fee_detail_his IS '新网银行费用明细表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.xw_id IS '新网id';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.cust_no IS '客户编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.cust_name IS '客户姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.tran_date IS '交易日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.fee_date IS '费用日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.fee_flag IS '停费标识 0-未停止计费 1-停止计费';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.trem_no IS '第几期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.billing_base IS '计费基数 费用计算基数  该订单的实还利息、罚息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.fee_type IS '费用类型  1-正常费用 2-延滞费用  以利息为计费基数计算为正常费用，以罚息为计费基数计算为延滞费用';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.deduction_id IS '扣费规则 ID';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.deduction_name IS '扣费规则名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.fee_rate IS '费率';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_fee_detail_his.should_deduction_amt IS '应扣费金额';






CREATE TABLE REC_LOAN_LAST."rec_xwbank_intr_trans_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"cust_no" VARCHAR(32),
	"cust_name" VARCHAR(32),
	"tran_date" VARCHAR(12),
	"overdue_start_date" VARCHAR(12),
	"to_bw_overdue_int" DEC(20,4),
	"to_bw_pnlt" DEC(20,4),
	"back_bn_overdue_int" DEC(20,4),
	"to_bwjt_overdue_int" DEC(20,4),
	"back_bn_overdue_pnlt" DEC(20,4),
	"to_bwjt_overdue_pnlt" DEC(20,4),
	"bw_overdue_int_bln" DEC(20,4),
	"bw_overdue_pnlt_bln" DEC(20,4),
	"loan_bln_amt" DEC(20,4),
	"overdue_loan_amt" DEC(20,4),
	"max_overdue_day" INT,
	"prin_max_overdue_day" INT,
	"int_max_overdue_day" INT,






	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_intr_trans_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_intr_trans_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_intr_trans_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_intr_trans_tmp IS '新网银行逾期 90 天以上贷款利息结转交易表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.cust_no IS '客户编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.cust_name IS '客户姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.tran_date IS '交易日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.overdue_start_date IS '逾期起始日期  ①贷款逾期超过 90 天转表外计息，距离最远的状态为逾期的还款计划的还款日为逾期起始日；
     ②客户发生还款时，表外向表内结转，距离最远的状态为逾期的还款计划的还款日为逾期起始日；
     （如贷款有两期逾期： 2
     月 1 号的，3 月 1 号的，
     然后客户还掉了 2 月 1 号
     那期， 此时逾期起始日期
     就是 3 月 1 号）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.to_bw_overdue_int IS '转至表外逾期利息 ①当该笔借据逾期超过 90
     天，计息状态由应计变更
     为非应计时，取值规则为
     逾期利息+当期已在表内计
     提的正常利息
     ②当该笔借据处理核销
     时，计息状态由应计变更
     为非应计时，取值规则为
     逾期利息+当期已在表内计
     提的正常利息
     ③客户还款及其他非应计
     转应计情况，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.to_bw_pnlt IS '转至表外罚息  ①当该笔借据逾期超过 90
       天，计息状态由应计变更
       为非应计时，将表内产生
       的罚息结转到表外，取值
       为结转的罚息金额
       ②当该笔借据处理核销
       时，计息状态由应计变更
       为非应计时，将表内产生
       的罚息结转到表外，取值
       为结转的罚息金额
       ③客户还款及其他非应计
       转应计情况，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.back_bn_overdue_int IS '转回原表内逾期利息  ①客户进行逾期还款时，
         通过交易码 57100 从表外
         转回表内的逾期利息金额
         ②逾期超过 90 天，转表外
         计息时，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.to_bwjt_overdue_int IS '转回表外计提逾期利息  ①客户进行逾期还款时，
通过交易码 57110 从表外
转回表内的逾期利息金额
②逾期超过 90 天，转表外
计息时，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.back_bn_overdue_pnlt IS '转回原表内逾期罚息  ①客户进行逾期还款时，
通过交易码 57101 从表外
转回表内的罚息金额
②逾期超过 90 天，转表外
计息时，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.to_bwjt_overdue_pnlt IS '转回表外计提逾期罚息  ①客户进行逾期还款时，
 通过交易码 57111 从表外
 转回表内的罚息金额
 ②逾期超过 90 天，转表外
 计息时，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.bw_overdue_int_bln IS '表外逾期利息余额 发生本次表内外结转交易
      后，当前的表外逾期利息
      余额，针对每次交易更新
      数据：①当客户还款为逾
      期结清时，结转后余额为
      0；
      ②当客户还款为逾期部分
      还款时，结转后逾期利息
      余额为未还款的逾期利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.bw_overdue_pnlt_bln IS '表外逾期罚息余额  发生本次表内外结转交易
        后，当前的表外逾期利息
        余额，针对每次交易更新
        数据：
        ①当客户还款为逾期结清
        时，结转后余额为 0；
        ②当客户还款为逾期部分
        还款时，结转后罚息余额
        为未还款的罚息
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.loan_bln_amt IS '贷款剩余本金总额  本次结转交易后，贷款剩
 余的本金总额，包括已逾
 期本金与未逾期本金';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.overdue_loan_amt IS '贷款逾期本金  ①贷款逾期超过 90 天结转
   表外时，贷款逾期本金为
   逾期本金总额；
   ②客户发生逾期部分还款
   时，贷款逾期本金为还款
   后客户仍逾期的本金总额
   ③客户发生逾期结清还款
   时，贷款逾期本金为 0';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.max_overdue_day IS '最大逾期天数  本次结转交易后，距离最
  远的仍为逾期状态的还款
  计划的还款日距离当前的
  天数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.prin_max_overdue_day IS '本金最大逾期天数  本次结转交易后，本金仍
         为逾期的还款计划的还款
         日距离当前的天数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_tmp.int_max_overdue_day IS '利息最大逾期天数  本次结转交易后，利息仍
        为逾期的还款计划的还款
        日距离当前的天数';








CREATE TABLE REC_LOAN_LAST."rec_xwbank_intr_trans_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"cust_no" VARCHAR(32),
	"cust_name" VARCHAR(32),
	"tran_date" VARCHAR(12),
	"overdue_start_date" VARCHAR(12),
	"to_bw_overdue_int" DEC(20,4),
	"to_bw_pnlt" DEC(20,4),
	"back_bn_overdue_int" DEC(20,4),
	"to_bwjt_overdue_int" DEC(20,4),
	"back_bn_overdue_pnlt" DEC(20,4),
	"to_bwjt_overdue_pnlt" DEC(20,4),
	"bw_overdue_int_bln" DEC(20,4),
	"bw_overdue_pnlt_bln" DEC(20,4),
	"loan_bln_amt" DEC(20,4),
	"overdue_loan_amt" DEC(20,4),
	"max_overdue_day" INT,
	"prin_max_overdue_day" INT,
	"int_max_overdue_day" INT,






	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_intr_trans_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_intr_trans_his_bizdate ON REC_LOAN_LAST."rec_xwbank_intr_trans_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_intr_trans_his IS '新网银行逾期 90 天以上贷款利息结转交易表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.cust_no IS '客户编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.cust_name IS '客户姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.tran_date IS '交易日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.overdue_start_date IS '逾期起始日期  ①贷款逾期超过 90 天转表
     外计息，距离最远的状态
     为逾期的还款计划的还款
     日为逾期起始日；
     ②客户发生还款时，表外
     向表内结转，距离最远的
     状态为逾期的还款计划的
     还款日为逾期起始日；
     （如贷款有两期逾期： 2
     月 1 号的，3 月 1 号的，
     然后客户还掉了 2 月 1 号
     那期， 此时逾期起始日期
     就是 3 月 1 号）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.to_bw_overdue_int IS '转至表外逾期利息 ①当该笔借据逾期超过 90
     天，计息状态由应计变更
     为非应计时，取值规则为
     逾期利息+当期已在表内计
     提的正常利息
     ②当该笔借据处理核销
     时，计息状态由应计变更
     为非应计时，取值规则为
     逾期利息+当期已在表内计
     提的正常利息
     ③客户还款及其他非应计
     转应计情况，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.to_bw_pnlt IS '转至表外罚息  ①当该笔借据逾期超过 90
       天，计息状态由应计变更
       为非应计时，将表内产生
       的罚息结转到表外，取值
       为结转的罚息金额
       ②当该笔借据处理核销
       时，计息状态由应计变更
       为非应计时，将表内产生
       的罚息结转到表外，取值
       为结转的罚息金额
       ③客户还款及其他非应计
       转应计情况，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.back_bn_overdue_int IS '转回原表内逾期利息  ①客户进行逾期还款时，
         通过交易码 57100 从表外
         转回表内的逾期利息金额
         ②逾期超过 90 天，转表外
         计息时，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.to_bwjt_overdue_int IS '转回表外计提逾期利息  ①客户进行逾期还款时，
通过交易码 57110 从表外
转回表内的逾期利息金额
②逾期超过 90 天，转表外
计息时，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.back_bn_overdue_pnlt IS '转回原表内逾期罚息  ①客户进行逾期还款时，
通过交易码 57101 从表外
转回表内的罚息金额
②逾期超过 90 天，转表外
计息时，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.to_bwjt_overdue_pnlt IS '转回表外计提逾期罚息  ①客户进行逾期还款时，
 通过交易码 57111 从表外
 转回表内的罚息金额
 ②逾期超过 90 天，转表外
 计息时，此处为空';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.bw_overdue_int_bln IS '表外逾期利息余额 发生本次表内外结转交易
      后，当前的表外逾期利息
      余额，针对每次交易更新
      数据：①当客户还款为逾
      期结清时，结转后余额为
      0；
      ②当客户还款为逾期部分
      还款时，结转后逾期利息
      余额为未还款的逾期利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.bw_overdue_pnlt_bln IS '表外逾期罚息余额  发生本次表内外结转交易
        后，当前的表外逾期利息
        余额，针对每次交易更新
        数据：
        ①当客户还款为逾期结清
        时，结转后余额为 0；
        ②当客户还款为逾期部分
        还款时，结转后罚息余额
        为未还款的罚息
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.loan_bln_amt IS '贷款剩余本金总额  本次结转交易后，贷款剩
 余的本金总额，包括已逾
 期本金与未逾期本金';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.overdue_loan_amt IS '贷款逾期本金  ①贷款逾期超过 90 天结转
   表外时，贷款逾期本金为
   逾期本金总额；
   ②客户发生逾期部分还款
   时，贷款逾期本金为还款
   后客户仍逾期的本金总额
   ③客户发生逾期结清还款
   时，贷款逾期本金为 0';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.max_overdue_day IS '最大逾期天数  本次结转交易后，距离最
  远的仍为逾期状态的还款
  计划的还款日距离当前的
  天数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.prin_max_overdue_day IS '本金最大逾期天数  本次结转交易后，本金仍
         为逾期的还款计划的还款
         日距离当前的天数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_intr_trans_his.int_max_overdue_day IS '利息最大逾期天数  本次结转交易后，利息仍
        为逾期的还款计划的还款
        日距离当前的天数';









CREATE TABLE REC_LOAN_LAST."rec_xwbank_buis_info_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"cust_no" VARCHAR(32),
	"business_license_no" VARCHAR(32),
	"business_license_reg_addr" VARCHAR(600),
	"registered_capital" VARCHAR(24),
	"last_6m_busi_sales" VARCHAR(24),
	"last_6m_order_count" VARCHAR(24),
	"annual_operating_income" VARCHAR(24),
	"annual_gross_profit" VARCHAR(24),
	"repay_resource" VARCHAR(24),
	"operating_life" VARCHAR(24),
	"loan_usage" VARCHAR(10),
	"cust_type" VARCHAR(10),
	"busi_rel" VARCHAR(10),
	"shareholding_ratio" VARCHAR(10),
	"busi_name" VARCHAR(600),
	"busi_type" VARCHAR(20),
	"org_no" VARCHAR(40),
	"tax_reg_no" VARCHAR(40),
	"enterprises_num" INT,
	"main_business" VARCHAR(600),
	"farmers_flag" VARCHAR(6),
	"busi_province" VARCHAR(12),
	"busi_city" VARCHAR(12),
	"busi_area" VARCHAR(12),
	"busi_address" VARCHAR(256),
	"paicl_up_capital" VARCHAR(32),
	"tax_credit_level" VARCHAR(32),
	"taxable_sales_revenue" VARCHAR(32),
	"value_added_tax_paid" VARCHAR(32),
	"corporate_income_tax_paid" VARCHAR(32),




	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_buis_info_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_buis_info_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_buis_info_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_buis_info_tmp IS '新网银行企业经营信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.cust_no IS '客户编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.business_license_no IS '营业执照编码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.business_license_reg_addr IS '营业执照注册地';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.registered_capital IS '注册资本';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.last_6m_busi_sales IS '近 6 个月总营业额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.last_6m_order_count IS '近 6 个月销售订单量';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.annual_operating_income IS '年度营业收入';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.annual_gross_profit IS '年度毛利润';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.repay_resource IS '还款来源';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.operating_life IS '经营年限';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.loan_usage IS '贷款投向';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.cust_type IS '客户类型码值：
 101（普通自然人）
 104（个体经营户）
 105（小微企业主）
 106（农户）
 107（港澳台个人）
 108（外国个人）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.busi_rel IS '企业关系码值：
6001（法定代表人(借款
人)）
6002（法定代表人配偶(借
款人)）
6003（企业重要股东(借款
人)）
6004（实际控制人(借款
人)）
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.shareholding_ratio IS '持股比例';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.busi_name IS '经营单位名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.busi_type IS '经营单位所属行业';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.org_no IS '组织机构代码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.tax_reg_no IS '税务登记证编码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.enterprises_num IS '企业员工人数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.main_business IS '主营业务';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_tmp.farmers_flag IS '是否农户标记码值：
      1 是
      0 否
      2 未知';




CREATE TABLE REC_LOAN_LAST."rec_xwbank_buis_info_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"cust_no" VARCHAR(32),
	"business_license_no" VARCHAR(32),
	"business_license_reg_addr" VARCHAR(600),
	"registered_capital" VARCHAR(24),
	"last_6m_busi_sales" VARCHAR(24),
	"last_6m_order_count" VARCHAR(24),
	"annual_operating_income" VARCHAR(24),
	"annual_gross_profit" VARCHAR(24),
	"repay_resource" VARCHAR(24),
	"operating_life" VARCHAR(24),
	"loan_usage" VARCHAR(10),
	"cust_type" VARCHAR(10),
	"busi_rel" VARCHAR(10),
	"shareholding_ratio" VARCHAR(10),
	"busi_name" VARCHAR(600),
	"busi_type" VARCHAR(20),
	"org_no" VARCHAR(40),
	"tax_reg_no" VARCHAR(40),
	"enterprises_num" INT,
	"main_business" VARCHAR(600),
	"farmers_flag" VARCHAR(6),
	"busi_province" VARCHAR(12),
	"busi_city" VARCHAR(12),
	"busi_area" VARCHAR(12),
	"busi_address" VARCHAR(256),
	"paicl_up_capital" VARCHAR(32),
	"tax_credit_level" VARCHAR(32),
	"taxable_sales_revenue" VARCHAR(32),
	"value_added_tax_paid" VARCHAR(32),
	"corporate_income_tax_paid" VARCHAR(32),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_buis_info_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_buis_info_his_bizdate ON REC_LOAN_LAST."rec_xwbank_buis_info_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_buis_info_his IS '新网银行企业经营信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.cust_no IS '客户编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.business_license_no IS '营业执照编码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.business_license_reg_addr IS '营业执照注册地';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.registered_capital IS '注册资本';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.last_6m_busi_sales IS '近 6 个月总营业额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.last_6m_order_count IS '近 6 个月销售订单量';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.annual_operating_income IS '年度营业收入';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.annual_gross_profit IS '年度毛利润';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.repay_resource IS '还款来源';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.operating_life IS '经营年限';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.loan_usage IS '贷款投向';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.cust_type IS '客户类型码值：
 101（普通自然人）
 104（个体经营户）
 105（小微企业主）
 106（农户）
 107（港澳台个人）
 108（外国个人）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.busi_rel IS '企业关系码值：
6001（法定代表人(借款
人)）
6002（法定代表人配偶(借
款人)）
6003（企业重要股东(借款
人)）
6004（实际控制人(借款
人)）
';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.shareholding_ratio IS '持股比例';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.busi_name IS '经营单位名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.busi_type IS '经营单位所属行业';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.org_no IS '组织机构代码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.tax_reg_no IS '税务登记证编码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.enterprises_num IS '企业员工人数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.main_business IS '主营业务';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_buis_info_his.farmers_flag IS '是否农户标记码值：
      1 是
      0 否
      2 未知';







CREATE TABLE REC_LOAN_LAST."rec_xwbank_contract_rel_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"loan_cont_filename" VARCHAR(200),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_contract_rel_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_contract_rel_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_contract_rel_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_contract_rel_tmp IS '新网银行借据与贷款合同文件名关系表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_contract_rel_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_contract_rel_tmp.loan_cont_filename IS '贷款合同文件名影像文件中贷款合同文件名';





CREATE TABLE REC_LOAN_LAST."rec_xwbank_contract_rel_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"loan_cont_filename" VARCHAR(200),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_contract_rel_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_contract_rel_his_bizdate ON REC_LOAN_LAST."rec_xwbank_contract_rel_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_contract_rel_his IS '新网银行借据与贷款合同文件名关系表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_contract_rel_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_contract_rel_his.loan_cont_filename IS '贷款合同文件名影像文件中贷款合同文件名';







CREATE TABLE REC_LOAN_LAST."rec_xwbank_lhd22_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"cust_name" VARCHAR(60),
	"pay_date" VARCHAR(12),
	"overdue_date" VARCHAR(12),
	"overdue_day" INT,
    "write_off_date" VARCHAR(12),
    "loan_bln_amt" DEC(18,4),
    "should_int_amt" DEC(18,4),
    "should_pnlt_amt" DEC(18,4),


	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_lhd22_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_lhd22_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_lhd22_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_lhd22_tmp IS '新网银行核销贷款明细文件表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_tmp.pay_date IS '发放日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_tmp.overdue_date IS '逾期日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_tmp.overdue_day IS '逾期天数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_tmp.write_off_date IS '核销日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_tmp.loan_bln_amt IS '贷款余额-核销时间点贷款余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_tmp.should_int_amt IS '应收利息-核销时间点表外全部应收未收利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_tmp.should_pnlt_amt IS '应收罚息-核销时间点表外全部应收未收罚息';







CREATE TABLE REC_LOAN_LAST."rec_xwbank_lhd22_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"cust_name" VARCHAR(60),
	"pay_date" VARCHAR(12),
	"overdue_date" VARCHAR(12),
	"overdue_day" INT,
    "write_off_date" VARCHAR(12),
    "loan_bln_amt" DEC(18,4),
    "should_int_amt" DEC(18,4),
    "should_pnlt_amt" DEC(18,4),


	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_lhd22_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_lhd22_his_bizdate ON REC_LOAN_LAST."rec_xwbank_lhd22_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_lhd22_his IS '新网银行核销贷款明细文件表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_his.pay_date IS '发放日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_his.overdue_date IS '逾期日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_his.overdue_day IS '逾期天数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_his.write_off_date IS '核销日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_his.loan_bln_amt IS '贷款余额-核销时间点贷款余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_his.should_int_amt IS '应收利息-核销时间点表外全部应收未收利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd22_his.should_pnlt_amt IS '应收罚息-核销时间点表外全部应收未收罚息';





CREATE TABLE REC_LOAN_LAST."rec_xwbank_attach_com_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"social_credit_code" VARCHAR(60),
	"com_name" VARCHAR(180),
	"com_legal_person" VARCHAR(64),
	"com_legal_person_cert_no" VARCHAR(24),



	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_attach_com_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_attach_com_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_attach_com_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_attach_com_tmp IS '新网银行借据挂靠公司信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_attach_com_tmp.social_credit_code IS '挂靠公司统一社会信用代码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_attach_com_tmp.com_name IS '挂靠公司名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_attach_com_tmp.com_legal_person IS '挂靠公司法人姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_attach_com_tmp.com_legal_person_cert_no IS '挂靠公司法人姓名身份证号码';







CREATE TABLE REC_LOAN_LAST."rec_xwbank_attach_com_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"social_credit_code" VARCHAR(60),
	"com_name" VARCHAR(180),
	"com_legal_person" VARCHAR(64),
	"com_legal_person_cert_no" VARCHAR(24),



	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_attach_com_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_attach_com_his_bizdate ON REC_LOAN_LAST."rec_xwbank_attach_com_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_attach_com_his IS '新网银行借据挂靠公司信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_attach_com_his.social_credit_code IS '挂靠公司统一社会信用代码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_attach_com_his.com_name IS '挂靠公司名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_attach_com_his.com_legal_person IS '挂靠公司法人姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_attach_com_his.com_legal_person_cert_no IS '挂靠公司法人姓名身份证号码';












CREATE TABLE REC_LOAN_LAST."rec_xwbank_lhd23_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"cust_name" VARCHAR(60),
	"pay_date" VARCHAR(12),
	"overdue_date" VARCHAR(12),
	"overdue_day" INT,
    "write_off_date" VARCHAR(12),
    "loan_bln_amt" DEC(18,4),
    "should_int_amt" DEC(18,4),
    "should_pnlt_amt" DEC(18,4),


	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_lhd23_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_lhd23_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_lhd23_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_lhd23_tmp IS '新网银行待核销贷款明细文件文件表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_tmp.pay_date IS '发放日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_tmp.overdue_date IS '逾期日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_tmp.overdue_day IS '逾期天数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_tmp.write_off_date IS '转待核销日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_tmp.loan_bln_amt IS '贷款余额-';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_tmp.should_int_amt IS '应收利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_tmp.should_pnlt_amt IS '应收罚息';







CREATE TABLE REC_LOAN_LAST."rec_xwbank_lhd23_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"cust_name" VARCHAR(60),
	"pay_date" VARCHAR(12),
	"overdue_date" VARCHAR(12),
	"overdue_day" INT,
    "write_off_date" VARCHAR(12),
    "loan_bln_amt" DEC(18,4),
    "should_int_amt" DEC(18,4),
    "should_pnlt_amt" DEC(18,4),


	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_lhd23_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_lhd23_his_bizdate ON REC_LOAN_LAST."rec_xwbank_lhd23_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_lhd23_his IS '新网银行待核销贷款明细文件文件表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_his.pay_date IS '发放日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_his.overdue_date IS '逾期日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_his.overdue_day IS '逾期天数';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_his.write_off_date IS '转待核销日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_his.loan_bln_amt IS '贷款余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_his.should_int_amt IS '应收利息';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_lhd23_his.should_pnlt_amt IS '应收罚息';




COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_his.credit_order_no IS '授信订单编号';


COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_credit_tmp.credit_order_no IS '授信订单编号';




comment on column REC_LOAN_LAST.rec_xwbank_repay_tmp.prin_int_charging_date is '本息回收时间-本息从借款人账户划出时间';
comment on column REC_LOAN_LAST.rec_xwbank_repay_tmp.liquidation_no is '清算交易编号-按照清算机构统一规则形成的每笔交易编号(付款机构、清算机构、收款机构可核对交易明细）';
comment on column REC_LOAN_LAST.rec_xwbank_repay_tmp.repay_account_type is '还款账户类型-支付账户(含支付机构名称)或银行卡 ( 含 开 户 行 名称)';





comment on column REC_LOAN_LAST.rec_xwbank_repay_his.prin_int_charging_date is '本息回收时间-本息从借款人账户划出时间';
comment on column REC_LOAN_LAST.rec_xwbank_repay_his.liquidation_no is '清算交易编号-按照清算机构统一规则形成的每笔交易编号(付款机构、清算机构、收款机构可核对交易明细）';
comment on column REC_LOAN_LAST.rec_xwbank_repay_his.repay_account_type is '还款账户类型-支付账户(含支付机构名称)或银行卡 ( 含 开 户 行 名称)';


comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_short_term_loan_prin_bln is '上日短期贷款本金余额 ';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.pre_day_midlong_term_loan_prin_bln is '上日中长贷款本金余额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_short_term_loan_prin_amt is '当日发放短期贷款本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_midlong_term_loan_prin_amt is '当日发放中长期贷款本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_retrieve_short_term_loan_prin_amt is '当日回收短期贷款本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_retrieve_midlong_term_loan_prin_amt is '当日回收中长期贷款本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_short_term_loan_prin_bln is '当日短期贷款本金余额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_midlong_term_loan_prin_bln is '当日中长期贷款本金余额 ';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_write_off_short_term_loan_prin_amt is '当日冲销短期本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_write_off_midlong_term_loan_prin_amt is '当日冲销中长期本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bw_write_off_short_term_loan_prin_amt is '当日表外核销短期本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_tmp.same_day_bw_write_off_midlong_term_loan_prin_amt is '当日表外核销中长期本金总额';



comment on column REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_short_term_loan_prin_bln is '上日短期贷款本金余额 ';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.pre_day_midlong_term_loan_prin_bln is '上日中长贷款本金余额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.same_day_short_term_loan_prin_amt is '当日发放短期贷款本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.same_day_midlong_term_loan_prin_amt is '当日发放中长期贷款本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.same_day_retrieve_short_term_loan_prin_amt is '当日回收短期贷款本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.same_day_retrieve_midlong_term_loan_prin_amt is '当日回收中长期贷款本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.same_day_short_term_loan_prin_bln is '当日短期贷款本金余额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.same_day_midlong_term_loan_prin_bln is '当日中长期贷款本金余额 ';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.same_day_write_off_short_term_loan_prin_amt is '当日冲销短期本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.same_day_write_off_midlong_term_loan_prin_amt is '当日冲销中长期本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bw_write_off_short_term_loan_prin_amt is '当日表外核销短期本金总额';
comment on column REC_LOAN_LAST.rec_xwbank_acct_his.same_day_bw_write_off_midlong_term_loan_prin_amt is '当日表外核销中长期本金总额';

comment on column REC_LOAN_LAST.rec_xwbank_file_num_tmp.enterpriseinfo_total is '企业客户信息数据总数';
comment on column REC_LOAN_LAST.rec_xwbank_file_num_tmp.billinfo_total is '票据信息数据总数';
comment on column REC_LOAN_LAST.rec_xwbank_file_num_tmp.coborrower_total is '共借人信息数据总数';
comment on column REC_LOAN_LAST.rec_xwbank_file_num_tmp.houseinfo_total is '房产信息数总数';

comment on column REC_LOAN_LAST.rec_xwbank_file_num_his.enterpriseinfo_total is '企业客户信息数据总数';
comment on column REC_LOAN_LAST.rec_xwbank_file_num_his.billinfo_total is '票据信息数据总数';
comment on column REC_LOAN_LAST.rec_xwbank_file_num_his.coborrower_total is '共借人信息数据总数';
comment on column REC_LOAN_LAST.rec_xwbank_file_num_his.houseinfo_total is '房产信息数总数';


comment on column REC_LOAN_LAST.rec_xwbank_buis_info_his.busi_province is '省-经营单位';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_his.busi_city is '市-经营单位';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_his.busi_area is '区-经营单位';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_his.busi_address is '地址-经营单位';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_his.paicl_up_capital is '实收资本 A32 单位:万元，无数据来源时为 0，必输';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_his.tax_credit_level is '纳税征信等级';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_his.taxable_sales_revenue is '应税销售收入(年汇总) A32 单位:万元，无数据来源时为 0，必输';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_his.value_added_tax_paid is '增值税已缴税款(年汇总) A32 单位:万元，无数据来源时为 0，必输';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_his.corporate_income_tax_paid is '企业所得税已缴税款(年汇总) A32 单位:万元，无数据来源时为 0，必输';


comment on column REC_LOAN_LAST.rec_xwbank_buis_info_tmp.busi_province is '省-经营单位';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_tmp.busi_city is '市-经营单位';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_tmp.busi_area is '区-经营单位';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_tmp.busi_address is '地址-经营单位';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_tmp.paicl_up_capital is '实收资本 A32 单位:万元，无数据来源时为 0，必输';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_tmp.tax_credit_level is '纳税征信等级';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_tmp.taxable_sales_revenue is '应税销售收入(年汇总) A32 单位:万元，无数据来源时为 0，必输';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_tmp.value_added_tax_paid is '增值税已缴税款(年汇总) A32 单位:万元，无数据来源时为 0，必输';
comment on column REC_LOAN_LAST.rec_xwbank_buis_info_tmp.corporate_income_tax_paid is '企业所得税已缴税款(年汇总) A32 单位:万元，无数据来源时为 0，必输';






-- 2023-04-19新增表


CREATE TABLE REC_LOAN_LAST."rec_xwbank_enterpriseinfo_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"cust_no" VARCHAR(32),
	"corporate_cust_type" VARCHAR(12),
	"corporate_cust_detail" VARCHAR(12),
	"regd_cert_type" VARCHAR(12),
	"uniform_social_credit_code" VARCHAR(64),
	"issuing_authority" VARCHAR(256),
	"busi_status" VARCHAR(12),
	"busi_range" VARCHAR(600),
	"busi_start_date" VARCHAR(12),
	"busi_end_date" VARCHAR(12),
	"busi_industry" VARCHAR(12),
	"regd_ccy" VARCHAR(12),
	"regd_capital" VARCHAR(20),
	"paid_in_capital" VARCHAR(20),
	"four_ministries_and_industries" VARCHAR(32),
	"annual_income" VARCHAR(32),
	"total_assets" VARCHAR(32),
	"total_employees" VARCHAR(32),
	"company_scale" VARCHAR(32),
	"zhongzheng_code" VARCHAR(600),
	"comp_regd_addr" VARCHAR(600),
	"comp_regd_addr_prov" VARCHAR(12),
	"comp_regd_addr_city" VARCHAR(12),
	"comp_regd_addr_area" VARCHAR(12),
	"actual_business_address" VARCHAR(12),
	"actual_business_address_prov" VARCHAR(12),
	"actual_business_address_city" VARCHAR(12),
	"actual_business_address_area" VARCHAR(12),
	"cust_name" VARCHAR(64),
	"cert_type" VARCHAR(6),
	"cert_no" VARCHAR(64),
	"phone_no" VARCHAR(14),
	"treasurer_name" VARCHAR(64),
	"treasurer_cert_no" VARCHAR(32),
	"treasurer_phone" VARCHAR(32),
    "beneficiary_name" VARCHAR(64),
	"beneficiary_cert_no" VARCHAR(32),
	"beneficiary_type" VARCHAR(32),
	"beneficiary_addr" VARCHAR(600),
	"beneficiary_account_name" VARCHAR(256),
	"beneficiary_account_no" VARCHAR(128),
	"beneficiary_account_bank_name" VARCHAR(256),
	"beneficiary_account_bank_point" VARCHAR(256),
	"beneficiary_account_bank_no" VARCHAR(256),




	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_enterpriseinfo_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_enterpriseinfo_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp IS '企业客户信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.cust_no IS '客户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.corporate_cust_type IS '对公客户类型 : 100-个人;200-企业;300-同业;400-事业、机关;500-社会团体、部队及其他;600-内部';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.corporate_cust_detail IS '对公客户细类';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.regd_cert_type IS '登记注册证照类型:A01:组织机构代码;A02:企业法人营业执照;A03:企业营业执照;A04:个体工商户营业执照;A05:事业单位登记证书;A06 社会团体登记证书;A07:民办非企业登记证书;默认“A03-企业营业执照”';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.uniform_social_credit_code IS '统一社会信用代码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.issuing_authority IS '发证机关名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.busi_status IS '经营状态:  01：正常运营;02：停业（歇业）;03：筹建;04：当年关闭;05：当年破产;06：当年注销;07：当年吊销;99：其他';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.busi_range IS '经营范围';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.busi_start_date IS '经营期限自';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.busi_end_date IS '经营期限至';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.busi_industry IS '所属行业';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.regd_ccy IS '注册资本币种';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.regd_capital IS '注册资本(万元) ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.paid_in_capital IS '实收资本(万元)';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.four_ministries_and_industries IS '四部委行业分类';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.annual_income IS '年营业收入(万元) ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.total_assets IS '资产总额（万元）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.total_employees IS '企业员工人数（人）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.company_scale IS '企业规模 CS01-大型;CS02-中型;CS03-小型;CS04-微型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.zhongzheng_code IS '中征码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.comp_regd_addr IS '企业注册地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.comp_regd_addr_prov IS '省-注册地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.comp_regd_addr_city IS '市-注册地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.comp_regd_addr_area IS '区-注册地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.actual_business_address IS '实际经营地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.actual_business_address_prov IS '省-办公/经营地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.actual_business_address_city IS '市-办公/经营地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.actual_business_address_area IS '区-办公/经营地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.cust_name IS '姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.cert_type IS '证件类型  代码表：B01-身份证';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.cert_no IS '证件号码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.phone_no IS '手机号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.treasurer_name IS '财务主管姓名   ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.treasurer_cert_no IS '财务主管身份证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.treasurer_phone IS '财务主管手机号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.beneficiary_name IS '受益人姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.beneficiary_cert_no IS '受益人身份证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.beneficiary_type IS '受益人类型  A01 直接或间接控股 25%（含）以上;A02 通过人事、财务等其他方式对公司进行控制;A03 高级管理人员;A04 法人或公司负责人;A05 其他';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.beneficiary_addr IS '受益人地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.beneficiary_account_name IS '企业基本账户名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.beneficiary_account_no IS '企业基本账户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.beneficiary_account_bank_name IS '企业基本账户开户银行';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.beneficiary_account_bank_point IS '企业基本账户开户网点';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_tmp.beneficiary_account_bank_no IS '企业基本账户开户行号';



CREATE TABLE REC_LOAN_LAST."rec_xwbank_enterpriseinfo_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"cust_no" VARCHAR(32),
	"corporate_cust_type" VARCHAR(12),
	"corporate_cust_detail" VARCHAR(12),
	"regd_cert_type" VARCHAR(12),
	"uniform_social_credit_code" VARCHAR(64),
	"issuing_authority" VARCHAR(256),
	"busi_status" VARCHAR(12),
	"busi_range" VARCHAR(600),
	"busi_start_date" VARCHAR(12),
	"busi_end_date" VARCHAR(12),
	"busi_industry" VARCHAR(12),
	"regd_ccy" VARCHAR(12),
	"regd_capital" VARCHAR(20),
	"paid_in_capital" VARCHAR(20),
	"four_ministries_and_industries" VARCHAR(32),
	"annual_income" VARCHAR(32),
	"total_assets" VARCHAR(32),
	"total_employees" VARCHAR(32),
	"company_scale" VARCHAR(32),
	"zhongzheng_code" VARCHAR(600),
	"comp_regd_addr" VARCHAR(600),
	"comp_regd_addr_prov" VARCHAR(12),
	"comp_regd_addr_city" VARCHAR(12),
	"comp_regd_addr_area" VARCHAR(12),
	"actual_business_address" VARCHAR(12),
	"actual_business_address_prov" VARCHAR(12),
	"actual_business_address_city" VARCHAR(12),
	"actual_business_address_area" VARCHAR(12),
	"cust_name" VARCHAR(64),
	"cert_type" VARCHAR(6),
	"cert_no" VARCHAR(64),
	"phone_no" VARCHAR(14),
	"treasurer_name" VARCHAR(64),
	"treasurer_cert_no" VARCHAR(32),
	"treasurer_phone" VARCHAR(32),
    "beneficiary_name" VARCHAR(64),
	"beneficiary_cert_no" VARCHAR(32),
	"beneficiary_type" VARCHAR(32),
	"beneficiary_addr" VARCHAR(600),
	"beneficiary_account_name" VARCHAR(256),
	"beneficiary_account_no" VARCHAR(128),
	"beneficiary_account_bank_name" VARCHAR(256),
	"beneficiary_account_bank_point" VARCHAR(256),
	"beneficiary_account_bank_no" VARCHAR(256),




	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_enterpriseinfo_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his_bizdate ON REC_LOAN_LAST."rec_xwbank_enterpriseinfo_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his IS '企业客户信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.cust_no IS '客户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.corporate_cust_type IS '对公客户类型 : 100-个人;200-企业;300-同业;400-事业、机关;500-社会团体、部队及其他;600-内部';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.corporate_cust_detail IS '对公客户细类';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.regd_cert_type IS '登记注册证照类型:A01:组织机构代码;A02:企业法人营业执照;A03:企业营业执照;A04:个体工商户营业执照;A05:事业单位登记证书;A06 社会团体登记证书;A07:民办非企业登记证书;默认“A03-企业营业执照”';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.uniform_social_credit_code IS '统一社会信用代码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.issuing_authority IS '发证机关名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.busi_status IS '经营状态:  01：正常运营;02：停业（歇业）;03：筹建;04：当年关闭;05：当年破产;06：当年注销;07：当年吊销;99：其他';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.busi_range IS '经营范围';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.busi_start_date IS '经营期限自';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.busi_end_date IS '经营期限至';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.busi_industry IS '所属行业';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.regd_ccy IS '注册资本币种';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.regd_capital IS '注册资本(万元) ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.paid_in_capital IS '实收资本(万元)';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.four_ministries_and_industries IS '四部委行业分类';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.annual_income IS '年营业收入(万元) ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.total_assets IS '资产总额（万元）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.total_employees IS '企业员工人数（人）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.company_scale IS '企业规模 CS01-大型;CS02-中型;CS03-小型;CS04-微型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.zhongzheng_code IS '中征码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.comp_regd_addr IS '企业注册地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.comp_regd_addr_prov IS '省-注册地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.comp_regd_addr_city IS '市-注册地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.comp_regd_addr_area IS '区-注册地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.actual_business_address IS '实际经营地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.actual_business_address_prov IS '省-办公/经营地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.actual_business_address_city IS '市-办公/经营地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.actual_business_address_area IS '区-办公/经营地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.cust_name IS '姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.cert_type IS '证件类型  代码表：B01-身份证';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.cert_no IS '证件号码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.phone_no IS '手机号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.treasurer_name IS '财务主管姓名   ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.treasurer_cert_no IS '财务主管身份证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.treasurer_phone IS '财务主管手机号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.beneficiary_name IS '受益人姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.beneficiary_cert_no IS '受益人身份证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.beneficiary_type IS '受益人类型  A01 直接或间接控股 25%（含）以上;A02 通过人事、财务等其他方式对公司进行控制;A03 高级管理人员;A04 法人或公司负责人;A05 其他';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.beneficiary_addr IS '受益人地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.beneficiary_account_name IS '企业基本账户名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.beneficiary_account_no IS '企业基本账户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.beneficiary_account_bank_name IS '企业基本账户开户银行';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.beneficiary_account_bank_point IS '企业基本账户开户网点';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_enterpriseinfo_his.beneficiary_account_bank_no IS '企业基本账户开户行号';









CREATE TABLE REC_LOAN_LAST."rec_xwbank_billinfo_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"drawer_name" VARCHAR(64),
	"drawer_account" VARCHAR(128),
	"drawer_regd_bank" VARCHAR(256),
	"payee_regd_bank_all_name" VARCHAR(256),
	"payee_account" VARCHAR(256),
	"payee_regd_bank_name" VARCHAR(256),
	"guarantor_name" VARCHAR(128),
	"guarantor_addr" VARCHAR(256),
	"guarant_date" VARCHAR(12),
	"bill_amt" dec(18,4),
	"invoicing_date" VARCHAR(12),
	"bill_end_date" VARCHAR(12),
	"bill_mortgage_to_xw_date" VARCHAR(12),
	"bill_mortgage_status" VARCHAR(12),
	"acceptor_all_name" VARCHAR(128),
	"acceptor_regd_bank_no" VARCHAR(128),
	"acceptor_account" VARCHAR(128),
	"acceptor_regd_bank_name" VARCHAR(128),
	"bill_no" VARCHAR(128),
	"transfer_type" VARCHAR(12),
	"drawer_promise" VARCHAR(512),
	"acceptor_promise" VARCHAR(512),
	"guarantor_name_o" VARCHAR(128),
	"guarantor_addr_o" VARCHAR(512),
	"guarant_date_o" VARCHAR(512),
	"bill_remark" VARCHAR(512),




	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_billinfo_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_billinfo_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_billinfo_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_billinfo_tmp IS '票据信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.drawer_name IS '出票人全称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.drawer_account IS '出票人账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.drawer_regd_bank IS '出票人开户银行';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.payee_regd_bank_all_name IS '收票人全称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.payee_account IS '收票人账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.payee_regd_bank_name IS '收票人开户银行';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.guarantor_name IS '保证人姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.guarantor_addr IS '保证人地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.guarant_date IS '保证日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.bill_amt IS '票面金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.invoicing_date IS '开票日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.bill_end_date IS '票据到期日';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.bill_mortgage_to_xw_date IS '票据质押新网日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.bill_mortgage_status IS '票据质押状态';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.acceptor_all_name IS '承兑人全称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.acceptor_regd_bank_no IS '承兑人开户行行号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.acceptor_account IS '承兑人账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.acceptor_regd_bank_name IS '承兑人开户行名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.bill_no IS '编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.transfer_type IS '能否转让0- 否；1- 能';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.drawer_promise IS '出票人承诺';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.acceptor_promise IS '承兑人承诺';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.guarantor_name_o IS '保证人姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.guarantor_addr_o IS '保证人地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.guarant_date_o IS '保证日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_tmp.bill_remark IS '票面备注信息';




CREATE TABLE REC_LOAN_LAST."rec_xwbank_billinfo_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"drawer_name" VARCHAR(64),
	"drawer_account" VARCHAR(128),
	"drawer_regd_bank" VARCHAR(256),
	"payee_regd_bank_all_name" VARCHAR(256),
	"payee_account" VARCHAR(256),
	"payee_regd_bank_name" VARCHAR(256),
	"guarantor_name" VARCHAR(128),
	"guarantor_addr" VARCHAR(256),
	"guarant_date" VARCHAR(12),
	"bill_amt" dec(18,4),
	"invoicing_date" VARCHAR(12),
	"bill_end_date" VARCHAR(12),
	"bill_mortgage_to_xw_date" VARCHAR(12),
	"bill_mortgage_status" VARCHAR(12),
	"acceptor_all_name" VARCHAR(128),
	"acceptor_regd_bank_no" VARCHAR(128),
	"acceptor_account" VARCHAR(128),
	"acceptor_regd_bank_name" VARCHAR(128),
	"bill_no" VARCHAR(128),
	"transfer_type" VARCHAR(12),
	"drawer_promise" VARCHAR(512),
	"acceptor_promise" VARCHAR(512),
	"guarantor_name_o" VARCHAR(128),
	"guarantor_addr_o" VARCHAR(512),
	"guarant_date_o" VARCHAR(512),
	"bill_remark" VARCHAR(512),




	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_billinfo_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_billinfo_his_bizdate ON REC_LOAN_LAST."rec_xwbank_billinfo_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_billinfo_his IS '票据信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.drawer_name IS '出票人全称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.drawer_account IS '出票人账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.drawer_regd_bank IS '出票人开户银行';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.payee_regd_bank_all_name IS '收票人全称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.payee_account IS '收票人账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.payee_regd_bank_name IS '收票人开户银行';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.guarantor_name IS '保证人姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.guarantor_addr IS '保证人地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.guarant_date IS '保证日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.bill_amt IS '票面金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.invoicing_date IS '开票日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.bill_end_date IS '票据到期日';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.bill_mortgage_to_xw_date IS '票据质押新网日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.bill_mortgage_status IS '票据质押状态';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.acceptor_all_name IS '承兑人全称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.acceptor_regd_bank_no IS '承兑人开户行行号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.acceptor_account IS '承兑人账号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.acceptor_regd_bank_name IS '承兑人开户行名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.bill_no IS '编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.transfer_type IS '能否转让0- 否；1- 能';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.drawer_promise IS '出票人承诺';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.acceptor_promise IS '承兑人承诺';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.guarantor_name_o IS '保证人姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.guarantor_addr_o IS '保证人地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.guarant_date_o IS '保证日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_billinfo_his.bill_remark IS '票面备注信息';










CREATE TABLE REC_LOAN_LAST."rec_xwbank_coborrower_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"coborrower_type" VARCHAR(64),
	"coborrower_name" VARCHAR(64),
	"coborrower_cert_no" VARCHAR(64),
	"coborrower_gender" VARCHAR(4),
	"coborrower_reserve" VARCHAR(4),
	"coborrower_cert_start_date" VARCHAR(12),
	"coborrower_cert_end_date" VARCHAR(12),
	"coborrower_cert_addr" VARCHAR(256),
	"coborrower_cert_prov" VARCHAR(12),
	"coborrower_cert_city" VARCHAR(12),
	"coborrower_cert_area" VARCHAR(12),
	"coborrower_birthday" VARCHAR(12),
	"issue_cert_org" VARCHAR(256),
	"cert_type" VARCHAR(12),
	"cert_addr_post" VARCHAR(12),
	"occupation_type" VARCHAR(12),





	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_coborrower_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_coborrower_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_coborrower_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_coborrower_tmp IS '共借人信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_type IS '共借人类别';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_name IS '姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_cert_no IS '身份证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_gender IS '性别';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_reserve IS '民族';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_cert_start_date IS '身份证有效期开始日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_cert_end_date IS '身份证有效期截止日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_cert_addr IS '证件地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_cert_prov IS '身份证省';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_cert_city IS '身份证市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_cert_area IS '身份证区';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.coborrower_birthday IS '出生日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.issue_cert_org IS '发证机关';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.cert_type IS '证件类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.cert_addr_post IS '证件地址邮政编码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_tmp.occupation_type IS '职业类型';



























CREATE TABLE REC_LOAN_LAST."rec_xwbank_coborrower_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"coborrower_type" VARCHAR(64),
	"coborrower_name" VARCHAR(64),
	"coborrower_cert_no" VARCHAR(64),
	"coborrower_gender" VARCHAR(4),
	"coborrower_reserve" VARCHAR(4),
	"coborrower_cert_start_date" VARCHAR(12),
	"coborrower_cert_end_date" VARCHAR(12),
	"coborrower_cert_addr" VARCHAR(256),
	"coborrower_cert_prov" VARCHAR(12),
	"coborrower_cert_city" VARCHAR(12),
	"coborrower_cert_area" VARCHAR(12),
	"coborrower_birthday" VARCHAR(12),
	"issue_cert_org" VARCHAR(256),
	"cert_type" VARCHAR(12),
	"cert_addr_post" VARCHAR(12),
	"occupation_type" VARCHAR(12),





	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_coborrower_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_coborrower_his_bizdate ON REC_LOAN_LAST."rec_xwbank_coborrower_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_coborrower_his IS '共借人信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_type IS '共借人类别';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_name IS '姓名';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_cert_no IS '身份证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_gender IS '性别';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_reserve IS '民族';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_cert_start_date IS '身份证有效期开始日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_cert_end_date IS '身份证有效期截止日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_cert_addr IS '证件地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_cert_prov IS '身份证省';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_cert_city IS '身份证市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_cert_area IS '身份证区';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.coborrower_birthday IS '出生日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.issue_cert_org IS '发证机关';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.cert_type IS '证件类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.cert_addr_post IS '证件地址邮政编码';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_coborrower_his.occupation_type IS '职业类型';






































CREATE TABLE REC_LOAN_LAST."rec_xwbank_houseinfo_tmp" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"cust_no" VARCHAR(64),
	"province" VARCHAR(12),
	"city" VARCHAR(12),
	"area" VARCHAR(12),
	"apartment_name" VARCHAR(256),
	"address" VARCHAR(512),
	"real_estate_unit_number" VARCHAR(64),
	"building_no" VARCHAR(16),
	"floor" VARCHAR(16),
	"home_no" VARCHAR(16),
	"build_year" VARCHAR(16),
	"housing_area" VARCHAR(16),
	"property_type" VARCHAR(16),
	"property_nature" VARCHAR(16),
	"land_use_type" VARCHAR(16),
	"ownership" VARCHAR(16),
	"owner_name" VARCHAR(32),
	"co_owner_rel_one" VARCHAR(32),
	"co_owner_name_one" VARCHAR(32),
	"co_owner_phone_one" VARCHAR(32),
	"co_owner_cert_no_one" VARCHAR(32),
	"co_owner_rel_two" VARCHAR(32),
	"co_owner_name_two" VARCHAR(32),
	"co_owner_phone_two" VARCHAR(32),
	"co_owner_cert_no_two" VARCHAR(32),
    "co_owner_rel_three" VARCHAR(32),
	"co_owner_name_three" VARCHAR(32),
	"co_owner_phone_three" VARCHAR(32),
	"co_owner_cert_no_three" VARCHAR(32),
	"tc_card_no" VARCHAR(64),
	"owner_tc_card_no" VARCHAR(64),
	"apply_mortgage_order" VARCHAR(64),
	"one_mortgage_start_date" VARCHAR(12),
	"one_mortgage_end_date" VARCHAR(12),
	"one_mortgage_debt_amount" VARCHAR(18),
	"one_mortgage_name" VARCHAR(64),
	"one_mortgage_type" VARCHAR(8),
	"one_mortgage_amt_bln" VARCHAR(18),
	"one_mortgage_date_from_now" VARCHAR(18),
	"xw_evaluation_price" VARCHAR(18),
	"comprehensive_evaluation_price" VARCHAR(18),
	"collateral_level" VARCHAR(18),
	"maximum_mortgage_rate" VARCHAR(18),
	"comprehensive_mortgage_rate" VARCHAR(18),





	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_houseinfo_tmp_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_houseinfo_tmp_bizdate ON REC_LOAN_LAST."rec_xwbank_houseinfo_tmp" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_houseinfo_tmp IS '房产信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.cust_no IS '新网客户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.province IS '所在省';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.city IS '所在市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.area IS '所在区';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.apartment_name IS '小区名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.address IS '详细地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.real_estate_unit_number IS '不动产单元号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.building_no IS '楼栋';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.floor IS '楼层';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.home_no IS '房号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.build_year IS '建成年代';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.housing_area IS '房屋面积';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.property_type IS '房产类型  01-住宅;02-公寓;03-别墅;04-办公;05-商业街商铺;06-市场类商铺;07-社区商铺;08-住宅底商;09-百货商场;10-购物中心商铺;11-商务楼/写字楼商铺;12-交通设施商铺;99-其他';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.property_nature IS '房产性质  01-商品房;02-经济适用房;03-军改房;04-公有住房;05-房改房;06-拆迁安置;99-未知';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.land_use_type IS '土地使用权类型  01-出让;02-划拨;03-转让;99-其它';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.ownership IS '产权归属 1-本人独有;2-本人与他人共有;3-非本人所有;9-其它';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.owner_name IS '权属人';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_rel_one IS '共有权属人关系 1 ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_name_one IS '共有权属人姓名 1';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_phone_one IS '共有权属人电话 1';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_cert_no_one IS '共有权属人身份证号 1 ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_rel_two IS '共有权属人关系 2';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_name_two IS '共有权属人姓名 2';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_phone_two IS '共有权属人电话 2';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_cert_no_two IS '共有权属人身份证号 2';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_rel_three IS '共有权属人关系 3';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_name_three IS '共有权属人姓名 3';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_phone_three IS '共有权属人电话 3';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.co_owner_cert_no_three IS '共有权属人身份证号 3';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.tc_card_no IS '不动产权证号/房产证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.owner_tc_card_no IS '权属人不动产权证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.apply_mortgage_order IS '申请抵押顺序';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.one_mortgage_start_date IS '一抵起始日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.one_mortgage_end_date IS '一抵终止日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.one_mortgage_debt_amount IS '一抵抵押债权金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.one_mortgage_name IS '一抵抵押权人';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.one_mortgage_type IS '一抵抵押类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.one_mortgage_amt_bln IS '一抵债权在贷余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.one_mortgage_date_from_now IS '一押距今期限';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.xw_evaluation_price IS '新网认定评估价';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.comprehensive_evaluation_price IS '综合认定评估(万元)';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.collateral_level IS '抵押物等级';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.maximum_mortgage_rate IS '最高抵押率（%）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_tmp.comprehensive_mortgage_rate IS '综合抵押率(%) ';






CREATE TABLE REC_LOAN_LAST."rec_xwbank_houseinfo_his" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"cust_no" VARCHAR(64),
	"province" VARCHAR(12),
	"city" VARCHAR(12),
	"area" VARCHAR(12),
	"apartment_name" VARCHAR(256),
	"address" VARCHAR(512),
	"real_estate_unit_number" VARCHAR(64),
	"building_no" VARCHAR(16),
	"floor" VARCHAR(16),
	"home_no" VARCHAR(16),
	"build_year" VARCHAR(16),
	"housing_area" VARCHAR(16),
	"property_type" VARCHAR(16),
	"property_nature" VARCHAR(16),
	"land_use_type" VARCHAR(16),
	"ownership" VARCHAR(16),
	"owner_name" VARCHAR(32),
	"co_owner_rel_one" VARCHAR(32),
	"co_owner_name_one" VARCHAR(32),
	"co_owner_phone_one" VARCHAR(32),
	"co_owner_cert_no_one" VARCHAR(32),
	"co_owner_rel_two" VARCHAR(32),
	"co_owner_name_two" VARCHAR(32),
	"co_owner_phone_two" VARCHAR(32),
	"co_owner_cert_no_two" VARCHAR(32),
    "co_owner_rel_three" VARCHAR(32),
	"co_owner_name_three" VARCHAR(32),
	"co_owner_phone_three" VARCHAR(32),
	"co_owner_cert_no_three" VARCHAR(32),
	"tc_card_no" VARCHAR(64),
	"owner_tc_card_no" VARCHAR(64),
	"apply_mortgage_order" VARCHAR(64),
	"one_mortgage_start_date" VARCHAR(12),
	"one_mortgage_end_date" VARCHAR(12),
	"one_mortgage_debt_amount" VARCHAR(18),
	"one_mortgage_name" VARCHAR(64),
	"one_mortgage_type" VARCHAR(8),
	"one_mortgage_amt_bln" VARCHAR(18),
	"one_mortgage_date_from_now" VARCHAR(18),
	"xw_evaluation_price" VARCHAR(18),
	"comprehensive_evaluation_price" VARCHAR(18),
	"collateral_level" VARCHAR(18),
	"maximum_mortgage_rate" VARCHAR(18),
	"comprehensive_mortgage_rate" VARCHAR(18),





	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  rec_xwbank_houseinfo_his_id PRIMARY KEY ("id")
);
CREATE INDEX index_REC_LOAN_LAST.rec_xwbank_houseinfo_his_bizdate ON REC_LOAN_LAST."rec_xwbank_houseinfo_his" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.rec_xwbank_houseinfo_his IS '房产信息表';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.cust_no IS '新网客户号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.province IS '所在省';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.city IS '所在市';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.area IS '所在区';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.apartment_name IS '小区名称';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.address IS '详细地址';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.real_estate_unit_number IS '不动产单元号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.building_no IS '楼栋';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.floor IS '楼层';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.home_no IS '房号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.build_year IS '建成年代';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.housing_area IS '房屋面积';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.property_type IS '房产类型  01-住宅;02-公寓;03-别墅;04-办公;05-商业街商铺;06-市场类商铺;07-社区商铺;08-住宅底商;09-百货商场;10-购物中心商铺;11-商务楼/写字楼商铺;12-交通设施商铺;99-其他';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.property_nature IS '房产性质  01-商品房;02-经济适用房;03-军改房;04-公有住房;05-房改房;06-拆迁安置;99-未知';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.land_use_type IS '土地使用权类型  01-出让;02-划拨;03-转让;99-其它';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.ownership IS '产权归属 1-本人独有;2-本人与他人共有;3-非本人所有;9-其它';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.owner_name IS '权属人';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_rel_one IS '共有权属人关系 1 ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_name_one IS '共有权属人姓名 1';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_phone_one IS '共有权属人电话 1';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_cert_no_one IS '共有权属人身份证号 1 ';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_rel_two IS '共有权属人关系 2';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_name_two IS '共有权属人姓名 2';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_phone_two IS '共有权属人电话 2';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_cert_no_two IS '共有权属人身份证号 2';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_rel_three IS '共有权属人关系 3';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_name_three IS '共有权属人姓名 3';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_phone_three IS '共有权属人电话 3';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.co_owner_cert_no_three IS '共有权属人身份证号 3';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.tc_card_no IS '不动产权证号/房产证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.owner_tc_card_no IS '权属人不动产权证号';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.apply_mortgage_order IS '申请抵押顺序';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.one_mortgage_start_date IS '一抵起始日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.one_mortgage_end_date IS '一抵终止日期';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.one_mortgage_debt_amount IS '一抵抵押债权金额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.one_mortgage_name IS '一抵抵押权人';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.one_mortgage_type IS '一抵抵押类型';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.one_mortgage_amt_bln IS '一抵债权在贷余额';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.one_mortgage_date_from_now IS '一押距今期限';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.xw_evaluation_price IS '新网认定评估价';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.comprehensive_evaluation_price IS '综合认定评估(万元)';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.collateral_level IS '抵押物等级';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.maximum_mortgage_rate IS '最高抵押率（%）';
COMMENT ON COLUMN REC_LOAN_LAST.rec_xwbank_houseinfo_his.comprehensive_mortgage_rate IS '综合抵押率(%) ';







CREATE TABLE REC_LOAN_LAST."fac_rev_trans" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(32),
	"rev_reason" VARCHAR(4),
	"old_tran_date" VARCHAR(12),
	"rev_date" VARCHAR(12),
	"rev_amt" DEC(18,4),
	"rev_prin_amt" DEC(18,4),
	"rev_int_amt" DEC(18,4),
	"rev_pnlt_amt" DEC(18,4),
	"rev_fee_amt" DEC(18,4),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT fac_rev_trans_id PRIMARY KEY ("id")
);
CREATE INDEX index_fac_rev_trans_bizdate ON REC_LOAN_LAST."fac_rev_trans" ("biz_date");


COMMENT ON TABLE REC_LOAN_LAST.fac_rev_trans IS '新网银行冲正类交易表';
COMMENT ON COLUMN REC_LOAN_LAST.fac_rev_trans.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.fac_rev_trans.rev_reason IS '冲正原因 1- 放款冲销 2- 还款冲销 3- 免息冲销';
COMMENT ON COLUMN REC_LOAN_LAST.fac_rev_trans.old_tran_date IS '原交易日期';
COMMENT ON COLUMN REC_LOAN_LAST.fac_rev_trans.rev_date IS '冲正日期';
COMMENT ON COLUMN REC_LOAN_LAST.fac_rev_trans.rev_amt IS '冲正金额';
COMMENT ON COLUMN REC_LOAN_LAST.fac_rev_trans.rev_prin_amt IS '冲正本金';
COMMENT ON COLUMN REC_LOAN_LAST.fac_rev_trans.rev_int_amt IS '冲正利息。';
COMMENT ON COLUMN REC_LOAN_LAST.fac_rev_trans.rev_pnlt_amt IS '冲正罚息';
COMMENT ON COLUMN REC_LOAN_LAST.fac_rev_trans.rev_fee_amt IS '冲销费用。';










   alter table REC_LOAN_LAST.fac_loan_repay_plan
Add column should_repay_total_amt DEC(18,4);
   alter table REC_LOAN_LAST.fac_loan_repay_plan
Add column show_print_total_amt DEC(18,4);
   alter table REC_LOAN_LAST.fac_loan_repay_plan
Add column show_int_total_amt DEC(18,4);

COMMENT ON COLUMN REC_LOAN_LAST.fac_loan_repay_plan.should_repay_total_amt IS '应还总金额';
COMMENT ON COLUMN REC_LOAN_LAST.fac_loan_repay_plan.show_print_total_amt IS '计划本金，该笔订单本金总额';
COMMENT ON COLUMN REC_LOAN_LAST.fac_loan_repay_plan.show_int_total_amt IS '计划利息，该笔订单利息总额';





CREATE TABLE REC_LOAN_LAST."fac_loan_special_business" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"happen_date" VARCHAR(12),
	"special_type" VARCHAR(4),
	"special_amt" DEC(20,4),
    "special_term" INT,
    "detail_info" VARCHAR(800),
    "repay_plan_chg_flag" VARCHAR(4),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT fac_loan_special_business_id PRIMARY KEY ("id")
);
CREATE INDEX index_fac_loan_special_business_bizdate ON REC_LOAN_LAST."fac_loan_special_business" ("biz_date");


COMMENT ON TABLE  REC_LOAN_LAST.fac_loan_special_business IS '新网银行特殊交易接表';
COMMENT ON COLUMN REC_LOAN_LAST.fac_loan_special_business.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.fac_loan_special_business.happen_date IS '发生日期-特殊交易发生日期。';
COMMENT ON COLUMN REC_LOAN_LAST.fac_loan_special_business.special_type IS '特殊交易类型3-提前还款（摊薄：期限不变，期供变少）；5-提前还款（结清，不会新增还款计划）；';
COMMENT ON COLUMN REC_LOAN_LAST.fac_loan_special_business.special_amt IS '特殊交易金额';
COMMENT ON COLUMN REC_LOAN_LAST.fac_loan_special_business.special_term IS '变更期次';
COMMENT ON COLUMN REC_LOAN_LAST.fac_loan_special_business.detail_info IS '明细信息';
COMMENT ON COLUMN REC_LOAN_LAST.fac_loan_special_business.repay_plan_chg_flag IS '还款计划变更标识-此次特殊交易是否引起还款计划变更。代码表：1-是；2-否。';


CREATE TABLE "fac_acct_flow" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"loan_no" VARCHAR(64),
	"happen_date" VARCHAR(12),
	"ccy" VARCHAR(12),
	"tran_code" VARCHAR(10),
	"tran_desc" VARCHAR(600),
	"loan_code" VARCHAR(4),
	"in_amt" DEC(20,4),
	"bank_no"  VARCHAR(32),
	"prd_no"  VARCHAR(32),
	"class_no"  VARCHAR(10),
	"xw_id"  VARCHAR(10),
	"create_date" DATE,
	"create_time" TIMESTAMP,
	"update_date" DATE,
	"update_time" TIMESTAMP,
	CONSTRAINT  fac_acct_flow_id PRIMARY KEY ("id")
);
CREATE INDEX index_fac_acct_flow_bizdate ON REC_LOAN_LAST."fac_acct_flow" ("biz_date");


COMMENT ON TABLE  REC_LOAN_LAST.fac_acct_flow IS '新网银行会计分录日报表';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.loan_no IS '借款编号';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.happen_date IS '交易发生日期。';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.ccy IS '币种';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.tran_code IS '交易码：50099 贷款发放
50111 罚息计提
50110 利息计提
20150 利息收回
20050 本金回收
20354 本金回收
（退货）
20059 本金回收
（单期代偿）
20155 利息回收
（贴息）
20355 利息回收
（退货）
20151 罚息回收
20158 罚息回收
（单期代偿）
20159 利息回收
（单期代偿）
20350 本金回收
（整笔回购）
20351 利息回收
（整笔回购）
20353 罚息回收
（整笔回购）
50211 手续费计提
50212 延滞手续费
计提
20261 扣收手续费
20262
扣收延滞手
续费
59100 已结利息
及累计利息从表内转 出
59101 累计罚息
从表内转出
90110 表外利息
计提
90111 表外罚息
计提
57101 已转出的
罚息转回表内
57111 在表外累
计的罚息转回表内
57100 已转出的
利息转回表内
57110 在表外累
计的利息转回表内
';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.tran_desc IS '交易描述';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.loan_code IS '借贷标记 代码表：
 D-借；
 C-贷。
';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.in_amt IS '入账金额';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.bank_no IS '分支行号';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.prd_no IS '产品号';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.class_no IS '科目 1301 个人贷款
         1501 应收利息
         2111 同业存放
        2311 储蓄活期
        存款
        6001 贷款利息
        收入
        2705 服务费';
COMMENT ON COLUMN REC_LOAN_LAST.fac_acct_flow.xw_id IS '新网数据主键 ID';



CREATE TABLE REC_LOAN_LAST."bth_job_pre_status" (
	"id" VARCHAR(64) NOT NULL,
	"biz_date" VARCHAR(12),
	"job_info" VARCHAR(256),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	CONSTRAINT bth_job_pre_status_id PRIMARY KEY ("id")
);
CREATE INDEX bth_job_pre_status_bizdate ON REC_LOAN_LAST."bth_job_pre_status" ("biz_date");


COMMENT ON TABLE  REC_LOAN_LAST.bth_job_pre_status IS '批量任务详细任务执行状态';
COMMENT ON COLUMN REC_LOAN_LAST.bth_job_pre_status.job_info IS 'job明细';
COMMENT ON COLUMN REC_LOAN_LAST.bth_job_pre_status.biz_date IS '业务日期';





CREATE TABLE REC_LOAN_LAST."bth_job_pre_rel" (
	"id" VARCHAR(64) NOT NULL,
	"job_info" VARCHAR(256),
	"pre_job" VARCHAR(256),

	"create_date" DATE,
	"create_time" TIMESTAMP,
	CONSTRAINT bth_job_pre_rel_id PRIMARY KEY ("id")
);
CREATE INDEX bth_job_pre_rel_job_info ON REC_LOAN_LAST."bth_job_pre_rel" ("job_info");


COMMENT ON TABLE  REC_LOAN_LAST.bth_job_pre_rel IS '批量任务详细任务执行状态';
COMMENT ON COLUMN REC_LOAN_LAST.bth_job_pre_rel.job_info IS 'job明细';
COMMENT ON COLUMN REC_LOAN_LAST.bth_job_pre_rel.pre_job IS '前置任务';






 alter table REC_LOAN_LAST.biz_cchxbank_loancheck
Add column coop_no varchar(32 );

CREATE INDEX biz_cchxbank_loancheck_coop_no ON REC_LOAN_LAST."biz_cchxbank_loancheck" ("coop_no");



 alter table REC_LOAN_LAST.biz_hxdata_correct_accrual_info
Add column coop_no varchar(32 );
 alter table REC_LOAN_LAST.biz_hxdata_correct_repay_info
Add column coop_no varchar(32 );
