
-- ----------------------------
-- Table structure for fin_three_part_pay_call_back
-- ----------------------------
DROP TABLE IF EXISTS "fin_three_part_pay_call_back";
CREATE TABLE "fin_three_part_pay_call_back" (
  "id" "pg_catalog"."numeric" NOT NULL,
  "resp_code" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "resp_msg" "pg_catalog"."text" COLLATE "pg_catalog"."default",
  "tran_type" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "txn_amt" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "pay_type" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "trace_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "txn_time" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "trade_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "trans_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "mid" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "mer_name" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "tid" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "mer_trade_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "vf_trade_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "discount_amt" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "qr_valid_time" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "scan_code" "pg_catalog"."text" COLLATE "pg_catalog"."default",
  "org_tran_type" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "org_txn_name" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "pay_data" "pg_catalog"."text" COLLATE "pg_catalog"."default",
  "pos_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "payment_id" "pg_catalog"."int8",
  "pay_index" "pg_catalog"."int8",
  "pay_time" "pg_catalog"."int8",
  "delete_flag" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" DEFAULT '0'::character varying,
  "create_time" "pg_catalog"."timestamp" DEFAULT CURRENT_TIMESTAMP,
  "create_by" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "update_time" "pg_catalog"."timestamp" DEFAULT CURRENT_TIMESTAMP,
  "update_by" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "tenant_id" "pg_catalog"."int4",
  "settle_date" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "settle_time" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "clear_date" "pg_catalog"."varchar" COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "secret_key" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "card_type" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "other_msg" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "other_platform" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "pay_method" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "query_result" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "query_result_msg" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "execute_result" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "pay_result" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "account_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "receipt_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "err_msg" "pg_catalog"."varchar" COLLATE "pg_catalog"."default",
  "lot_no" "pg_catalog"."varchar" COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "fin_three_part_pay_call_back"."resp_code" IS '响应码：00 表示成功，其它表示失败';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."resp_msg" IS '响应码解释信息（需要Base64解密）';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."tran_type" IS '交易类型';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."txn_amt" IS '交易金额';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."trace_no" IS '终端流水号：终端号系统跟踪号';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."txn_time" IS '交易时间：（yyyyMMddHHmmss）';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."trade_no" IS '支付订单号：银行返回系统订单号';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."mer_trade_no" IS '商户系统订单号';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."pos_no" IS 'POS机号';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."settle_date" IS '交易日';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."settle_time" IS '交易时间';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."clear_date" IS '清算时间';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."secret_key" IS '校验密钥';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."card_type" IS '卡类型';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."other_msg" IS '第三方优惠说明';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."other_platform" IS '第三方平台';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."pay_method" IS '支付方式';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."query_result" IS '查询结果';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."query_result_msg" IS '查询结果说明';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."execute_result" IS '请求结果';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."pay_result" IS '支付结果';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."account_no" IS '卡号';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."receipt_no" IS '凭证号';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."err_msg" IS '错误信息';
COMMENT ON COLUMN "fin_three_part_pay_call_back"."lot_no" IS '批次号';
COMMENT ON TABLE "fin_three_part_pay_call_back" IS '第三方支付回调表';

-- ----------------------------
-- Indexes structure for table fin_three_part_pay_call_back
-- ----------------------------
CREATE INDEX "idx_fin_three_part_mer_trade_no" ON "fin_three_part_pay_call_back" USING btree (
  "mer_trade_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "idx_fin_three_part_mid_tid" ON "fin_three_part_pay_call_back" USING btree (
  "mid" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tid" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "idx_fin_three_part_payment_id" ON "fin_three_part_pay_call_back" USING btree (
  "payment_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_fin_three_part_trade_no" ON "fin_three_part_pay_call_back" USING btree (
  "trade_no" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "idx_fin_three_part_txn_time" ON "fin_three_part_pay_call_back" USING btree (
  "txn_time" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table fin_three_part_pay_call_back
-- ----------------------------
ALTER TABLE "fin_three_part_pay_call_back" ADD CONSTRAINT "fin_three_part_pay_call_back_pkey" PRIMARY KEY ("id");

   -- Insert migration record
INSERT INTO __MigrationsHistory (MigrationId, ProductVersion)
VALUES ('202512041212 add_table fin_three_part_pay_call_back', '1.0.0');