-- 农商行网关支付
INSERT INTO "tb_sourcetype" ("sourcetype_id", "sourcetype", "checkable", "paydesc", "enable", "charge_enable", "consume_enable", "anonymous_enable", "reversable", "pay_subjno", "deposite_subjno", "tplusn", "start_chktime", "tenantid")
VALUES ('B837FFDD20C0CA07E05011AC03000113', 'ynrccpay', 't', '农商行网关支付', 't', 'f', 't', 'f', 't', '112235', '-', 1, null, '{tenantid}');
commit;

--新加农商行支付款
INSERT INTO "tb_subject" ("subjid","subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES (33, '112235', 1, 'y', 1, '1122', '20210106', 2, '农商行支付款', 1, '{tenantid}');
commit;

-- ----------------------------
-- Table structure for tb_ynrccpay_sign
-- ----------------------------
CREATE TABLE tb_ynrccpay_sign (
	id varchar(32) NOT NULL,
	bankcardno varchar(32) NOT NULL,
	shopaccno varchar(10) NOT NULL,
	userid varchar(32) NOT NULL,
	status varchar(10) NOT NULL,
	sign_flag bool NOT NULL,
	customer_sign_no varchar(60),
	sign_time varchar(14),
	cancel_time varchar(14),
	remark varchar(600),
	createtime varchar(14)
);
ALTER TABLE tb_ynrccpay_sign ADD CONSTRAINT tb_ynrccpay_sign_pkey PRIMARY KEY (id);
CREATE INDEX idx1_ynrccpay_sign ON tb_ynrccpay_sign(bankcardno,shopaccno,status);

INSERT INTO "tb_transcode" ("transcode_id", "transcode", "transname", "tenantid")
VALUES (4, 3050, '农商行网关快捷支付', '{tenantid}');
commit;


INSERT INTO "public"."tb_sourcetype_config"("id", "config_name", "config_value", "configid", "globalflag", "sourcetype", "tenantid") VALUES ('26', '农商行网关支付商户号', NULL, 'ynrcc.netpay.Mer_Id', 'f', 'ynrccpay', '{tenantid}');
INSERT INTO "public"."tb_sourcetype_config"("id", "config_name", "config_value", "configid", "globalflag", "sourcetype", "tenantid") VALUES ('27', '农商行网关支付商户名', NULL, 'ynrcc.netpay.Mer_IdName', 'f', 'ynrccpay', '{tenantid}');
INSERT INTO "public"."tb_sourcetype_config"("id", "config_name", "config_value", "configid", "globalflag", "sourcetype", "tenantid") VALUES ('28', '农商行网关支付回调地址', NULL, 'ynrcc.netpay.MerURL', 'f', 'ynrccpay', '{tenantid}');
INSERT INTO "public"."tb_sourcetype_config"("id", "config_name", "config_value", "configid", "globalflag", "sourcetype", "tenantid") VALUES ('25', '农商行网关支付地址', 'https://ebank.ynrcc.com/pweb/%s?LoginType=C&_locale=zh_CN&BankId=9999', 'ynrcc.netpay.URL', 't', 'ynrccpay', '{tenantid}');
commit;

CREATE TABLE tb_ynrccpay_thirdapp (
  id varchar(32) NOT NULL,
  mch_id varchar(20) NOT NULL,
  mch_name varchar(200),
  app_id varchar(60) NOT NULL,
  token varchar(20) NOT NULL,
  pubkey varchar(200) NOT NULL,
  enable bool NOT NULL,
  remark varchar(200)
);
ALTER TABLE tb_ynrccpay_thirdapp ADD CONSTRAINT tb_ynrccpay_thirdapp_pkey PRIMARY KEY (id);

-- 测试环境或正式环境插入相应配置
INSERT INTO "public"."tb_ynrccpay_thirdapp"("id", "mch_id", "mch_name", "app_id", "token", "pubkey", "enable", "remark")
VALUES ('test', '1002010472001', '大理市信息化发展有限责任公司', '318D34955996AA035F3047939EA655FF', 'J6upjifWdQfRj3eh', '043AAF09775EC7EEEAAA2C66773F61BF18CE4D2DDDCBFFF43249113D849AD3FF4F8951889E8BF759EC80AF2EEA7473F9FEE97A7DE0B284FFD3312BD5021061F172', 't', '测试环境配置');
--INSERT INTO "public"."tb_ynrccpay_thirdapp"("id", "mch_id", "mch_name", "app_id", "token", "pubkey", "enable", "remark")
--VALUES ('dev', '1002010472001', '大理市信息化发展有限责任公司', '5FE60D156754432BAC1789AF35EEA592', 'Cg3Ue7mdkWv9g5mK', '0484D7043D24F3AC19E3F7CA03A166C2F813BCFE2141CB0E8559214A23E7A8DFDC9B4C1E9D9FBE9456621373652B145DDB91BD6DD484E8F04870560E7A16F5AB2C', 't', '生产环境配置');
commit;