Files
agent-skills/skills/g3fo-db-ops/references/full_cleanup_init.sql
T

266 lines
43 KiB
SQL
Raw Normal View History

2026-02-04 17:19:57 +08:00
-- ------------------------------------------------------------
-- Hing Wai AP 清理与初始化脚本
-- 将原先分散的脚本合并,按模块分组执行
-- ------------------------------------------------------------
-- ===============================
-- g3fo_trade 历史与当日数据清理
-- ===============================
TRUNCATE TABLE `g3fo_trade`.`h_order`;
TRUNCATE TABLE `g3fo_trade`.`h_order_actions`;
TRUNCATE TABLE `g3fo_trade`.`h_strategy_daily_profit`;
TRUNCATE TABLE `g3fo_trade`.`h_trade`;
TRUNCATE TABLE `g3fo_trade`.`m_order`;
TRUNCATE TABLE `g3fo_trade`.`m_order_actions`;
TRUNCATE TABLE `g3fo_trade`.`m_order_approve_detail`;
TRUNCATE TABLE `g3fo_trade`.`m_strategy_daily_profit`;
TRUNCATE TABLE `g3fo_trade`.`m_trade`;
TRUNCATE TABLE `g3fo_trade`.`m_trading_planned_order`;
TRUNCATE TABLE `g3fo_trade`.`m_user_account_chunk`;
-- TRUNCATE TABLE `g3fo_trade`.`m_user_account_map`;
TRUNCATE TABLE `g3fo_trade`.`m_user_api_binding`;
TRUNCATE TABLE `g3fo_trade`.`m_user_approve_order_record`;
TRUNCATE TABLE `g3fo_trade`.`m_user_credit_usage_sum`;
-- ===============================
-- g3fo_dx 相关表清理
-- ===============================
TRUNCATE TABLE `g3fo_dx`.`m_async_task`;
TRUNCATE TABLE `g3fo_dx`.`m_async_task_history`;
TRUNCATE TABLE `g3fo_dx`.`m_dx_message_in_history`;
TRUNCATE TABLE `g3fo_dx`.`m_dx_message_out_history`;
TRUNCATE TABLE `g3fo_dx`.`m_dx_session`;
TRUNCATE TABLE `g3fo_dx`.`m_import_history`;
-- ===============================
-- 日志表清理
-- ===============================
TRUNCATE TABLE `g3fo_admin`.`m_report_export_record`;
TRUNCATE TABLE `g3fo_admin`.`m_table_data_change_log`;
TRUNCATE TABLE `g3fo_base`.`m_fix_message_log`;
TRUNCATE TABLE `nacos`.`his_config_info`;
-- ===============================
-- g3fo_user 账户、客户与用户相关表清理
-- ===============================
TRUNCATE TABLE `g3fo_user`.`m_account`;
TRUNCATE TABLE `g3fo_user`.`m_account_bank`;
TRUNCATE TABLE `g3fo_user`.`m_account_bcan_history`;
TRUNCATE TABLE `g3fo_user`.`m_account_black_white_list`;
TRUNCATE TABLE `g3fo_user`.`m_account_cash_hold`;
TRUNCATE TABLE `g3fo_user`.`m_account_cash_movement`;
TRUNCATE TABLE `g3fo_user`.`m_account_cash_open`;
TRUNCATE TABLE `g3fo_user`.`m_account_company_charge`;
TRUNCATE TABLE `g3fo_user`.`m_account_order_hold`;
TRUNCATE TABLE `g3fo_user`.`m_account_product_hold`;
TRUNCATE TABLE `g3fo_user`.`m_account_product_margin`;
TRUNCATE TABLE `g3fo_user`.`m_account_product_movement`;
TRUNCATE TABLE `g3fo_user`.`m_account_product_open`;
TRUNCATE TABLE `g3fo_user`.`m_account_trade_license`;
TRUNCATE TABLE `g3fo_user`.`m_alert_message`;
TRUNCATE TABLE `g3fo_user`.`m_aml`;
TRUNCATE TABLE `g3fo_user`.`m_authorized_person`;
TRUNCATE TABLE `g3fo_user`.`m_black_white_list`;
TRUNCATE TABLE `g3fo_user`.`m_broker_mapping`;
TRUNCATE TABLE `g3fo_user`.`m_client`;
TRUNCATE TABLE `g3fo_user`.`m_client_account_relations`;
TRUNCATE TABLE `g3fo_user`.`m_client_hot_list`;
TRUNCATE TABLE `g3fo_user`.`m_group`;
TRUNCATE TABLE `g3fo_user`.`m_group_item`;
TRUNCATE TABLE `g3fo_user`.`m_settled_trade`;
TRUNCATE TABLE `g3fo_user`.`m_settled_trade_charge`;
TRUNCATE TABLE `g3fo_user`.`m_settled_trade_dtl`;
TRUNCATE TABLE `g3fo_user`.`m_settled_trade_qty`;
TRUNCATE TABLE `g3fo_user`.`m_settled_trade_rebate`;
TRUNCATE TABLE `g3fo_user`.`m_user`;
TRUNCATE TABLE `g3fo_user`.`m_user_change_password`;
TRUNCATE TABLE `g3fo_user`.`m_user_client_relations`;
TRUNCATE TABLE `g3fo_user`.`m_user_login`;
TRUNCATE TABLE `g3fo_user`.`m_user_login_history`;
TRUNCATE TABLE `g3fo_user`.`m_user_role_relation_def`;
TRUNCATE TABLE `g3fo_user`.`m_user_trade_license`;
TRUNCATE TABLE `g3fo_user`.`t_user_account_ref`;
TRUNCATE TABLE `g3fo_user`.`t_user_child_user_ref`;
TRUNCATE TABLE `g3fo_user`.`t_user_client_ref`;
-- ===============================
-- g3fo_admin 管理员相关表清理
-- ===============================
TRUNCATE TABLE `g3fo_admin`.`m_admin`;
TRUNCATE TABLE `g3fo_admin`.`m_admin_login`;
TRUNCATE TABLE `g3fo_admin`.`m_admin_role_relation_def`;
-- ===============================
-- 初始化 g3fo_user 账户与客户数据
-- ===============================
REPLACE INTO `g3fo_user`.`m_account` (`id`, `account_type`, `account_code`, `account_class`, `account_status`, `local_name`, `eng_name`, `single_order_limit`, `daily_limit`, `cny_single_order_limit`, `cny_daily_limit`, `margin_pct`, `cover_pct`, `margin_limit`, `risk_agree`, `professional_investor_flag`, `aml_risk_level`, `client_risk_level`, `ae_id`, `parent_id`, `staff_account_flag`, `black_white_list_code`, `alert_pro_account`, `promotion_flag`, `hkidr_consent_flag`, `hkidr_consent_date`, `tel_no_home`, `tel_no_office`, `tel_no_mobile`, `tel_no_sms`, `fax_no_home`, `fax_no_office`, `address1_home`, `address2_home`, `address3_home`, `address4_home`, `address1_office`, `address2_office`, `address3_office`, `address4_office`, `area_code`, `birth_date`, `sex`, `occupation`, `referee`, `nationality`, `country_code`, `email`, `remark`, `buy_side_id`, `attention`, `id_card`, `virtual_asset_assessment_date`, `by_pass_check`, `create_by`, `create_on`, `update_by`, `update_on`, `member_type`, `default_ap_id`, `bank_gateway`, `bg_cia_flg`, `bg_offline_flg`, `online_cia_flg`, `online_monthly_rpt_flg`, `online_rights_sub_flg`, `online_stock_transfer_flg`, `online_trade_status`, `online_withdrawal`, `oct_flg`, `acct_grp`, `cash_limit`, `credit_limit`, `margin_call_pct`, `max_daily_transfer_limit`, `max_margin_flg`, `mdar`, `used_allocated_credit`, `used_credit`, `allocated_credit`, `bfld`, `bfld_discount`, `over_limit_proc`, `stop_buy_pct`, `stop_withdrawal_pct`, `concentration_risk`, `confidential`, `force_sell_flg`, `force_sell_note`, `force_sell_pct`, `force_sell_period`, `day_to_force_sell`, `t_plus_flg`, `t_plus_term`, `email_statement`, `close_date`, `phone_code`)
VALUES (1, 'CASH', 'afe', 'CASH', 'OPEN', 'AFE', 'afe.hk', 999999999.99, 999999999.99, 999999999.99, 999999999.99, 5.000000, 6.000000, 7.00, 'EQUY,BOND,WART', '1', NULL, NULL, NULL, '', '1', '', '', 1, 1, '2024-06-12 00:00:00', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, NULL, '', '', '', '', 'afe@afe.hk', '', '', '', '', NULL, 0, 'sys', '2024-05-15 11:32:52', 'sys', '2025-02-24 17:48:02', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_account` (`id`, `account_type`, `account_code`, `account_class`, `account_status`, `local_name`, `eng_name`, `single_order_limit`, `daily_limit`, `cny_single_order_limit`, `cny_daily_limit`, `margin_pct`, `cover_pct`, `margin_limit`, `risk_agree`, `professional_investor_flag`, `aml_risk_level`, `client_risk_level`, `ae_id`, `parent_id`, `staff_account_flag`, `black_white_list_code`, `alert_pro_account`, `promotion_flag`, `hkidr_consent_flag`, `hkidr_consent_date`, `tel_no_home`, `tel_no_office`, `tel_no_mobile`, `tel_no_sms`, `fax_no_home`, `fax_no_office`, `address1_home`, `address2_home`, `address3_home`, `address4_home`, `address1_office`, `address2_office`, `address3_office`, `address4_office`, `area_code`, `birth_date`, `sex`, `occupation`, `referee`, `nationality`, `country_code`, `email`, `remark`, `buy_side_id`, `attention`, `id_card`, `virtual_asset_assessment_date`, `by_pass_check`, `create_by`, `create_on`, `update_by`, `update_on`, `member_type`, `default_ap_id`, `bank_gateway`, `bg_cia_flg`, `bg_offline_flg`, `online_cia_flg`, `online_monthly_rpt_flg`, `online_rights_sub_flg`, `online_stock_transfer_flg`, `online_trade_status`, `online_withdrawal`, `oct_flg`, `acct_grp`, `cash_limit`, `credit_limit`, `margin_call_pct`, `max_daily_transfer_limit`, `max_margin_flg`, `mdar`, `used_allocated_credit`, `used_credit`, `allocated_credit`, `bfld`, `bfld_discount`, `over_limit_proc`, `stop_buy_pct`, `stop_withdrawal_pct`, `concentration_risk`, `confidential`, `force_sell_flg`, `force_sell_note`, `force_sell_pct`, `force_sell_period`, `day_to_force_sell`, `t_plus_flg`, `t_plus_term`, `email_statement`, `close_date`, `phone_code`)
VALUES (1943513637545185280, 'CASH', 'APPSTORE1', 'CUST', 'OPEN', 'APPSTORE1', 'APPSTORE1', 0.00, 0.00, 0.00, 0.00, 0.000000, 0.000000, 999999999999999.99, 'EQUY,BOND,TRUT', '0', NULL, NULL, 'C05', '', '0', '', '', 0, 1, '2025-04-03 00:00:00', '', '', '', '', '', '', '紅磡德豐街 18 號海濱廣場一期19樓1907B-1910A室', '', '', '', '', '', '', '', '', NULL, NULL, '', '', 'HK', '', '', '', '', '', '', NULL, 0, 'sys', '2025-07-11 11:32:15', 'DX', '2025-08-22 13:52:44', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_account` (`id`, `account_type`, `account_code`, `account_class`, `account_status`, `local_name`, `eng_name`, `single_order_limit`, `daily_limit`, `cny_single_order_limit`, `cny_daily_limit`, `margin_pct`, `cover_pct`, `margin_limit`, `risk_agree`, `professional_investor_flag`, `aml_risk_level`, `client_risk_level`, `ae_id`, `parent_id`, `staff_account_flag`, `black_white_list_code`, `alert_pro_account`, `promotion_flag`, `hkidr_consent_flag`, `hkidr_consent_date`, `tel_no_home`, `tel_no_office`, `tel_no_mobile`, `tel_no_sms`, `fax_no_home`, `fax_no_office`, `address1_home`, `address2_home`, `address3_home`, `address4_home`, `address1_office`, `address2_office`, `address3_office`, `address4_office`, `area_code`, `birth_date`, `sex`, `occupation`, `referee`, `nationality`, `country_code`, `email`, `remark`, `buy_side_id`, `attention`, `id_card`, `virtual_asset_assessment_date`, `by_pass_check`, `create_by`, `create_on`, `update_by`, `update_on`, `member_type`, `default_ap_id`, `bank_gateway`, `bg_cia_flg`, `bg_offline_flg`, `online_cia_flg`, `online_monthly_rpt_flg`, `online_rights_sub_flg`, `online_stock_transfer_flg`, `online_trade_status`, `online_withdrawal`, `oct_flg`, `acct_grp`, `cash_limit`, `credit_limit`, `margin_call_pct`, `max_daily_transfer_limit`, `max_margin_flg`, `mdar`, `used_allocated_credit`, `used_credit`, `allocated_credit`, `bfld`, `bfld_discount`, `over_limit_proc`, `stop_buy_pct`, `stop_withdrawal_pct`, `concentration_risk`, `confidential`, `force_sell_flg`, `force_sell_note`, `force_sell_pct`, `force_sell_period`, `day_to_force_sell`, `t_plus_flg`, `t_plus_term`, `email_statement`, `close_date`, `phone_code`) VALUES (1980186019865169920, 'CASH', 'HOUSE_ACCOUNT', 'CASH', 'OPEN', '', 'HOUSE_ACCOUNT', 99999999999.00, 99999999999.00, 99999999999.00, 99999999999.00, 5.000000, 6.000000, 7.00, 'WART,BOND,EQUY,TRUT', '1', NULL, NULL, NULL, '', '0', '', '', 0, 1, '2025-10-20 00:00:00', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, NULL, '', '', '', '', '', '', '', '', '', NULL, 0, 'afe', '2025-10-20 16:15:12', 'afe', '2025-10-20 16:27:38', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_account_trade_license` (`id`, `account_id`, `account_code`, `exchange_code`, `market_ids`, `account_status`, `risk_rule_group_code`, `over_limit_proc`, `clear_type`, `base_currency_code`, `clear_currency_code`, `payee`, `beneficiary`, `last_txn_date`, `last_trader_id`, `acct_terminated_date`, `single_order_limit`, `daily_limit`, `margin_pct`, `multiplier`, `recall_time`, `investor_id`, `bcan`, `bcan_validated_flag`, `ttep_flag`, `bcan_range_from`, `bcan_range_to`, `bcan_range_validated_list`, `create_by`, `create_on`, `update_by`, `update_on`, `smp_id`, `short_sell_flag`, `broker_ids`, `risk_class`, `acct_class`)
VALUES (1943513736174243840, 1943513637545185280, 'APPSTORE1', 'SEHK', '1,7,8,9', 'OPEN', 'CASH', 'OVER', 'T', 'HKD', 'HKD', '', '', NULL, '', NULL, 0.00, 0.00, 0.000000, NULL, NULL, '', 'ABL962.2266', 0, 0, '', '', '', 'sys', '2025-07-11 11:32:38', 'DX', '2025-08-22 13:47:50', '', 0, NULL, NULL, NULL);
INSERT INTO `g3fo_user`.`m_account_trade_license` (`id`, `account_id`, `account_code`, `exchange_code`, `market_ids`, `account_status`, `risk_rule_group_code`, `over_limit_proc`, `clear_type`, `base_currency_code`, `clear_currency_code`, `payee`, `beneficiary`, `last_txn_date`, `last_trader_id`, `acct_terminated_date`, `single_order_limit`, `daily_limit`, `margin_pct`, `multiplier`, `recall_time`, `investor_id`, `bcan`, `bcan_validated_flag`, `ttep_flag`, `bcan_range_from`, `bcan_range_to`, `bcan_range_validated_list`, `create_by`, `create_on`, `update_by`, `update_on`, `smp_id`, `short_sell_flag`, `broker_ids`, `risk_class`, `acct_class`) VALUES (1980186084428091392, 1980186019865169920, 'HOUSE_ACCOUNT', 'SEHK', '1,7,8,9', 'OPEN', 'CASH', 'OVER', 'T', 'HKD', 'HKD', '', '', NULL, '', NULL, 0.00, 0.00, 0.000000, NULL, NULL, '', '', 0, 0, '', '', '', 'afe', '2025-10-20 16:15:27', 'afe', '2025-10-20 21:36:47', '', 1, NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_client` (`id`, `client_code`, `local_name`, `eng_name`, `group_code`, `branch_code`, `single_order_limit`, `daily_limit`, `cny_single_order_limit`, `cny_daily_limit`, `tel_no_home`, `tel_no_office`, `tel_no_mobile`, `tel_no_sms`, `notify_lang`, `trade_notify_method`, `price_alert_notify_method`, `system_msg_notify_method`, `news_notify_method`, `fax_no_home`, `fax_no_office`, `address1_home`, `address2_home`, `address3_home`, `address4_home`, `address1_office`, `address2_office`, `address3_office`, `address4_office`, `area_code`, `birth_date`, `sex`, `occupation`, `referee`, `nationality`, `country_code`, `email`, `remark`, `buy_side_id`, `attention`, `id_card`, `owner_user_id`, `create_by`, `create_on`, `update_by`, `update_on`, `custody_id`, `bank_gateway`, `client_signature`, `omnibus_acc_flg`, `sms_flg`, `id_issue_date`, `id_issue_place`, `id_type`, `trading_code`, `trading_code_issue_date`, `residence_expiry_date`)
VALUES (1943513539612381184, 'APPSTORE1', 'APPSTORE1', 'APPSTORE1', 'COMPANY-GROUP', 'DEF', 0.00, 0.00, 0.00, 0.00, '', '', '', NULL, NULL, 'MOBI', '', '', '', '', '', '紅磡德豐街 18 號海濱廣場一期19樓1907B-1910A室', '', '', '', '', '', '', '', '', NULL, 'M', '', '', 'Hong Kong', 'HK', '', '', NULL, NULL, NULL, NULL, 'sys', '2025-07-11 11:31:51', 'sys', '2025-08-22 13:58:02', 'APPSTORE1', NULL, '', 0, NULL, NULL, 'HK', 'I', NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_client` (`id`, `client_code`, `local_name`, `eng_name`, `group_code`, `branch_code`, `single_order_limit`, `daily_limit`, `cny_single_order_limit`, `cny_daily_limit`, `tel_no_home`, `tel_no_office`, `tel_no_mobile`, `tel_no_sms`, `notify_lang`, `trade_notify_method`, `price_alert_notify_method`, `system_msg_notify_method`, `news_notify_method`, `fax_no_home`, `fax_no_office`, `address1_home`, `address2_home`, `address3_home`, `address4_home`, `address1_office`, `address2_office`, `address3_office`, `address4_office`, `area_code`, `birth_date`, `sex`, `occupation`, `referee`, `nationality`, `country_code`, `email`, `remark`, `buy_side_id`, `attention`, `id_card`, `owner_user_id`, `create_by`, `create_on`, `update_by`, `update_on`, `custody_id`, `bank_gateway`, `client_signature`, `omnibus_acc_flg`, `sms_flg`, `id_issue_date`, `id_issue_place`, `id_type`, `trading_code`, `trading_code_issue_date`, `residence_expiry_date`)
VALUES (1, 'afe', 'AFE', 'afe.hk', NULL, '001', 0.00, 0.00, 0.00, 0.00, '1111', '2222', '3333', '4444', NULL, 'EMAL', NULL, NULL, NULL, '888888888', '999999999', 'j11111111', 'j22222222', 'j333333333', 'j4444444', 'b11111111', 'b2222222', 'b333333333', 'b44444444', '11111111', NULL, NULL, '', '', '', '', 'man.zhong@afe.hk', '', '', '', '', NULL, 'admin', '2023-09-12 14:53:46', 'sys', '2025-03-19 15:51:22', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_client` (`id`, `client_code`, `local_name`, `eng_name`, `group_code`, `branch_code`, `single_order_limit`, `daily_limit`, `cny_single_order_limit`, `cny_daily_limit`, `tel_no_home`, `tel_no_office`, `tel_no_mobile`, `tel_no_sms`, `notify_lang`, `trade_notify_method`, `price_alert_notify_method`, `system_msg_notify_method`, `news_notify_method`, `fax_no_home`, `fax_no_office`, `address1_home`, `address2_home`, `address3_home`, `address4_home`, `address1_office`, `address2_office`, `address3_office`, `address4_office`, `area_code`, `birth_date`, `sex`, `occupation`, `referee`, `nationality`, `country_code`, `email`, `remark`, `buy_side_id`, `attention`, `id_card`, `owner_user_id`, `create_by`, `create_on`, `update_by`, `update_on`, `custody_id`, `bank_gateway`, `client_signature`, `omnibus_acc_flg`, `sms_flg`, `id_issue_date`, `id_issue_place`, `id_type`, `trading_code`, `trading_code_issue_date`, `residence_expiry_date`) VALUES (1980185872708014080, 'HOUSE_ACCOUNT', 'HOUSE_ACCOUNT', 'HOUSE_ACCOUNT', 'COMPANY-GROUP', 'DEFAULT', 0.00, 0.00, 0.00, 0.00, '', '', '', '', NULL, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, 'M', '', '', '', 'AU', 'leon@e-hingwai.com', '', '', '', '', NULL, 'afe', '2025-10-20 16:14:37', 'afe', '2025-10-20 16:26:40', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_client_account_relations` (`id`, `client_id`, `client_code`, `account_id`, `account_code`, `account_type`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1, 1, 'afe', 1, 'afe', 'CASH', 'sys', '2025-02-24 17:52:23', NULL, NULL);
REPLACE INTO `g3fo_user`.`m_client_account_relations` (`id`, `client_id`, `client_code`, `account_id`, `account_code`, `account_type`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1958767774625042432, 1943513539612381184, 'APPSTORE1', 1943513637545185280, 'APPSTORE1', 'CASH', 'DX', '2025-08-22 13:46:44', 'sys', '2025-08-22 13:46:44');
REPLACE INTO `g3fo_user`.`m_client_account_relations` (`id`, `client_id`, `client_code`, `account_id`, `account_code`, `account_type`, `create_by`, `create_on`, `update_by`, `update_on`) VALUES (1980189147855458304, 1980185872708014080, 'HOUSE_ACCOUNT', 1980186019865169920, 'HOUSE_ACCOUNT', 'CASH', 'afe', '2025-10-20 16:27:38', 'afe', '2025-10-20 16:27:38');
REPLACE INTO `g3fo_user`.`m_group` (`id`, `group_code`, `group_type`, `local_name`, `eng_name`, `description`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1, 'COMPANY-GROUP', 'CG', '公司组', 'COMPANY-GROUP', NULL, 'sql', '2025-05-07 10:56:09', NULL, NULL);
REPLACE INTO `g3fo_user`.`m_group_item` (`id`, `group_type`, `group_id`, `group_code`, `child_type`, `child_id`, `child_code`, `enable_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1943513539805319168, 'CG', 1, 'COMPANY-GROUP', 'C', 1943513539612381184, 'APPSTORE1', 1, 'sys', '2025-07-11 11:31:51', 'sys', '2025-07-11 11:31:51');
INSERT INTO `g3fo_user`.`m_group_item` (`id`, `group_type`, `group_id`, `group_code`, `child_type`, `child_id`, `child_code`, `enable_flag`, `create_by`, `create_on`, `update_by`, `update_on`) VALUES (1980188905231749120, 'CG', 1, 'COMPANY-GROUP', 'C', 1980185872708014080, 'HOUSE_ACCOUNT', 1, 'afe', '2025-10-20 16:26:40', 'afe', '2025-10-20 16:26:40');
-- ===============================
-- 初始化 g3fo_user 用户与交易权限
-- ===============================
REPLACE INTO `g3fo_user`.`m_user` (`id`, `user_code`, `local_name`, `eng_name`, `user_type`, `user_status`, `title`, `branch_code`, `department`, `mobile_no`, `email`, `create_by`, `create_on`, `update_by`, `update_on`, `trade_oddlot_flag`, `max_client_pct`, `single_override_limit_pct`, `max_deduct_pct`, `single_order_limit`, `single_override_limit`, `daily_override_limit`, `exposure_limit`, `cny_max_client_pct`, `cny_single_override_limit_pct`, `cny_single_order_limit`, `cny_single_override_limit`, `cny_daily_override_limit`, `otp_logon`, `otp_chgpwd`, `otp_method`, `credit_approval_role`, `effective_date`, `passport_id`, `delete_flag`, `delete_time`, `notification_opt`, `notification_method`, `change_password_flag`, `soft_key`, `reset_pass`, `mobile_device_id`, `mobile_platform_id`, `mobile_push_token`)
VALUES (1943512935934595072, 'APPSTORE1', 'APPSTORE1', 'APPSTORE1', 'CL', '0', '', 'DEFAULT', '5', '', 'man.zhong@afe.hk', 'sys', '2025-07-11 11:29:27', 'sys', '2025-10-14 13:26:59', 0, 20.000000, 100.000000, 0.000000, NULL, NULL, NULL, 0.00000000, 20.000000, 100.000000, NULL, NULL, NULL, 'DISD', 'DISD', 'SMS', 'NONE', '2025-07-11 11:28:46', '', 0, NULL, 'DISD', 'MOBI', 0, NULL, 'DISD', NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_user` (`id`, `user_code`, `local_name`, `eng_name`, `user_type`, `user_status`, `title`, `branch_code`, `department`, `mobile_no`, `email`, `create_by`, `create_on`, `update_by`, `update_on`, `trade_oddlot_flag`, `max_client_pct`, `single_override_limit_pct`, `max_deduct_pct`, `single_order_limit`, `single_override_limit`, `daily_override_limit`, `exposure_limit`, `cny_max_client_pct`, `cny_single_override_limit_pct`, `cny_single_order_limit`, `cny_single_override_limit`, `cny_daily_override_limit`, `otp_logon`, `otp_chgpwd`, `otp_method`, `credit_approval_role`, `effective_date`, `passport_id`, `delete_flag`, `delete_time`, `notification_opt`, `notification_method`, `change_password_flag`, `soft_key`, `reset_pass`, `mobile_device_id`, `mobile_platform_id`, `mobile_push_token`)
VALUES (1925469397361799170, 'afe', 'afe', 'afe', 'AE', '0', '', 'DEFAULT', '1', '', 'john.kong@afe.hk', 'sys', '2025-05-22 16:30:52', 'opr', '2025-10-14 13:26:59', 0, 20.000000, 100.000000, 0.000000, NULL, NULL, NULL, 0.00000000, 20.000000, 100.000000, NULL, NULL, NULL, 'DISD', 'ENG', 'NON', 'NONE', '2025-05-22 16:30:28', '', 0, NULL, 'TCHI', 'EMAL', 0, NULL, 'ENG', NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_user` (`id`, `user_code`, `local_name`, `eng_name`, `user_type`, `user_status`, `title`, `branch_code`, `department`, `mobile_no`, `email`, `create_by`, `create_on`, `update_by`, `update_on`, `trade_oddlot_flag`, `max_client_pct`, `single_override_limit_pct`, `max_deduct_pct`, `single_order_limit`, `single_override_limit`, `daily_override_limit`, `exposure_limit`, `cny_max_client_pct`, `cny_single_override_limit_pct`, `cny_single_order_limit`, `cny_single_override_limit`, `cny_daily_override_limit`, `otp_logon`, `otp_chgpwd`, `otp_method`, `credit_approval_role`, `effective_date`, `passport_id`, `delete_flag`, `delete_time`, `notification_opt`, `notification_method`, `change_password_flag`, `soft_key`, `reset_pass`, `mobile_device_id`, `mobile_platform_id`, `mobile_push_token`) VALUES (1978367120546861056, 'g2sfsupport', 'g2sfsupport', 'g2sfsupport', 'AE', '0', '', 'DEFAULT', '1', '6800-8690', 'g2sfsupport@afe.hk', 'afe', '2025-10-15 15:47:32', 'sys', '2025-10-18 11:20:29', 0, 20.000000, 100.000000, 0.000000, NULL, NULL, NULL, 0.00000000, 20.000000, 100.000000, NULL, NULL, NULL, 'DISD', 'DISD', 'NON', 'NONE', '2025-10-15 15:46:45', '', 0, NULL, 'DISD', 'EMAL', 0, NULL, 'DISD', NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_user` (`id`, `user_code`, `local_name`, `eng_name`, `user_type`, `user_status`, `title`, `branch_code`, `department`, `mobile_no`, `email`, `create_by`, `create_on`, `update_by`, `update_on`, `trade_oddlot_flag`, `max_client_pct`, `single_override_limit_pct`, `max_deduct_pct`, `single_order_limit`, `single_override_limit`, `daily_override_limit`, `exposure_limit`, `cny_max_client_pct`, `cny_single_override_limit_pct`, `cny_single_order_limit`, `cny_single_override_limit`, `cny_daily_override_limit`, `otp_logon`, `otp_chgpwd`, `otp_method`, `credit_approval_role`, `effective_date`, `passport_id`, `delete_flag`, `delete_time`, `notification_opt`, `notification_method`, `change_password_flag`, `soft_key`, `reset_pass`, `mobile_device_id`, `mobile_platform_id`, `mobile_push_token`) VALUES (1980073989309075456, 'g3sfsupport', 'g3sfsupport', 'g3sfsupport', 'AE', '0', NULL, 'DEFAULT', '1', NULL, 'g2sfsupport@afe.hk', 'afe', '2025-10-20 08:50:02', 'afe', '2025-10-20 08:49:12', 0, 20.000000, 100.000000, 0.000000, NULL, NULL, NULL, 0.00000000, 20.000000, 100.000000, NULL, NULL, NULL, 'DISD', 'DISD', 'NON', 'NONE', '2025-10-20 08:49:12', NULL, 0, NULL, 'DISD', NULL, 0, NULL, 'DISD', NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_user` (`id`, `user_code`, `local_name`, `eng_name`, `user_type`, `user_status`, `title`, `branch_code`, `department`, `mobile_no`, `email`, `create_by`, `create_on`, `update_by`, `update_on`, `trade_oddlot_flag`, `max_client_pct`, `single_override_limit_pct`, `max_deduct_pct`, `single_order_limit`, `single_override_limit`, `daily_override_limit`, `exposure_limit`, `cny_max_client_pct`, `cny_single_override_limit_pct`, `cny_single_order_limit`, `cny_single_override_limit`, `cny_daily_override_limit`, `otp_logon`, `otp_chgpwd`, `otp_method`, `credit_approval_role`, `effective_date`, `passport_id`, `delete_flag`, `delete_time`, `notification_opt`, `notification_method`, `change_password_flag`, `soft_key`, `reset_pass`, `mobile_device_id`, `mobile_platform_id`, `mobile_push_token`) VALUES (1980074724268576768, 'szg3sfsupport', 'szg3sfsupport', 'szg3sfsupport', 'AE', '0', NULL, 'DEFAULT', '1', NULL, 'g2sfsupport@afe.hk', 'afe', '2025-10-20 08:52:57', 'afe', '2025-10-20 08:52:22', 0, 20.000000, 100.000000, 0.000000, NULL, NULL, NULL, 0.00000000, 20.000000, 100.000000, NULL, NULL, NULL, 'DISD', 'DISD', 'NON', 'NONE', '2025-10-20 08:52:22', NULL, 0, NULL, 'DISD', 'EMAL', 0, NULL, 'DISD', NULL, NULL, NULL);
REPLACE INTO `g3fo_user`.`m_user_client_relations` (`id`, `parent_type`, `parent_user_id`, `parent_user_code`, `child_type`, `child_id`, `child_code`, `enable_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1925478879873642498, 'U', 1925469397361799170, 'afe', 'C', 1, 'afe', 1, 'sys', '2025-05-22 17:08:33', 'sys', '2025-05-22 17:08:33');
REPLACE INTO `g3fo_user`.`m_user_client_relations` (`id`, `parent_type`, `parent_user_id`, `parent_user_code`, `child_type`, `child_id`, `child_code`, `enable_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1943514529233244160, 'U', 1943512935934595072, 'APPSTORE1', 'C', 1943513539612381184, 'APPSTORE1', 1, 'sys', '2025-07-11 11:35:47', 'sys', '2025-07-11 11:35:47');
REPLACE INTO `g3fo_user`.`m_user_client_relations` (`id`, `parent_type`, `parent_user_id`, `parent_user_code`, `child_type`, `child_id`, `child_code`, `enable_flag`, `create_by`, `create_on`, `update_by`, `update_on`) VALUES (1980091573093928960, 'U', 1980074724268576768, 'szg3sfsupport', 'CG', 1, 'COMPANY-GROUP', 1, 'sys', '2025-10-20 09:59:54', 'sys', '2025-10-20 09:59:54');
REPLACE INTO `g3fo_user`.`m_user_client_relations` (`id`, `parent_type`, `parent_user_id`, `parent_user_code`, `child_type`, `child_id`, `child_code`, `enable_flag`, `create_by`, `create_on`, `update_by`, `update_on`) VALUES (1980116781104238592, 'U', 1980073989309075456, 'g3sfsupport', 'U', 1978367120546861056, 'g2sfsupport', 1, 'opr', '2025-10-20 11:40:04', 'opr', '2025-10-20 11:40:04');
REPLACE INTO `g3fo_user`.`m_user_trade_license` (`id`, `user_id`, `exchange_code`, `market_ids`, `active_flag`, `create_on`, `create_by`, `update_on`, `update_by`)
VALUES (1925469430924619778, 1925469397361799170, 'SEHK', '1,7,8,9', 1, '2025-05-22 16:31:00', 'sys', '2025-05-22 16:31:00', 'sys');
REPLACE INTO `g3fo_user`.`m_user_trade_license` (`id`, `user_id`, `exchange_code`, `market_ids`, `active_flag`, `create_on`, `create_by`, `update_on`, `update_by`)
VALUES (1943512964262924288, 1943512935934595072, 'SEHK', '1,7,8,9', 1, '2025-07-11 11:29:34', 'sys', '2025-07-11 11:29:34', 'sys');
REPLACE INTO `g3fo_user`.`t_user_account_ref` (`user_id`, `account_id`, `create_on`)
VALUES (1925469397361799170, 1, '2025-09-03 16:40:50');
REPLACE INTO `g3fo_user`.`t_user_child_user_ref` (`user_id`, `child_user_id`, `create_on`)
VALUES (1925469397361799170, 1925469397361799170, '2025-09-03 16:40:50');
REPLACE INTO `g3fo_user`.`t_user_client_ref` (`user_id`, `client_id`, `create_on`)
VALUES (1925469397361799170, 1, '2025-09-03 16:40:50');
-- ===============================
-- 初始化 g3fo_user 登录与角色
-- ===============================
REPLACE INTO `g3fo_user`.`m_user_login` (`id`, `user_id`, `user_code`, `channel_code`, `login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`, `suspense_flag`, `enable_dt_info_flag`, `mult_session_flag`, `info_package_id`, `next_remind_date`, `remind_day`, `change_pwd_date`, `token`)
VALUES (1943513267687264256, 1943512935934595072, 'APPSTORE1', 'WS', NULL, 'F877376BAD1A22E67333F299305674CDEC789F2BA2E5BFD074A6B40F0D245CDB', 0, '2026-01-08 14:58:12', NULL, 'sys', '2025-07-11 11:30:46', 'sys', '2025-10-15 09:30:18', 0, NULL, 1, '', '2025-12-09 14:58:12', NULL, '2025-10-10 14:58:12', NULL);
REPLACE INTO `g3fo_user`.`m_user_login` (`id`, `user_id`, `user_code`, `channel_code`, `login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`, `suspense_flag`, `enable_dt_info_flag`, `mult_session_flag`, `info_package_id`, `next_remind_date`, `remind_day`, `change_pwd_date`, `token`)
VALUES (1962711560971489280, 1943512935934595072, 'APPSTORE1', 'IH', NULL, 'F877376BAD1A22E67333F299305674CDEC789F2BA2E5BFD074A6B40F0D245CDB', 0, '2026-01-08 14:58:12', NULL, 'L_TANG', '2025-09-02 10:57:56', 'afe', '2025-10-13 17:29:37', 0, NULL, 1, '443', '2025-12-09 14:58:12', NULL, '2025-10-10 14:58:12', NULL);
REPLACE INTO `g3fo_user`.`m_user_login` (`id`, `user_id`, `user_code`, `channel_code`, `login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`, `suspense_flag`, `enable_dt_info_flag`, `mult_session_flag`, `info_package_id`, `next_remind_date`, `remind_day`, `change_pwd_date`, `token`)
VALUES (1925469490802503681, 1925469397361799170, 'afe', 'IN', NULL, 'F877376BAD1A22E67333F299305674CDEC789F2BA2E5BFD074A6B40F0D245CDB', 0, '2025-11-23 11:38:06', NULL, 'sys', '2025-05-22 16:31:15', 'sys', '2025-08-25 11:38:05', 0, NULL, 1, NULL, '2025-10-24 11:38:06', NULL, '2025-08-25 11:38:06', NULL);
REPLACE INTO `g3fo_user`.`m_user_login` (`id`, `user_id`, `user_code`, `channel_code`, `login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`, `suspense_flag`, `enable_dt_info_flag`, `mult_session_flag`, `info_package_id`, `next_remind_date`, `remind_day`, `change_pwd_date`, `token`)
VALUES (1925470040684146690, 1925469397361799170, 'afe', 'PT', NULL, 'F877376BAD1A22E67333F299305674CDEC789F2BA2E5BFD074A6B40F0D245CDB', 0, '2025-11-23 11:38:06', NULL, 'sys', '2025-05-22 16:33:26', 'afe', '2025-08-25 11:38:05', 0, NULL, 1, '', '2025-10-24 11:38:06', NULL, '2025-08-25 11:38:06', NULL);
REPLACE INTO `g3fo_user`.`m_user_login` (`id`, `user_id`, `user_code`, `channel_code`, `login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`, `suspense_flag`, `enable_dt_info_flag`, `mult_session_flag`, `info_package_id`, `next_remind_date`, `remind_day`, `change_pwd_date`, `token`)
VALUES (1978367310318145536, 1978367120546861056, 'g2sfsupport', 'PT', NULL, '16AFD883D4C47276FB9410E521A1B227DA0D8F5FE02D0C3E54145D9815FCBE11', 0, '2026-01-16 09:57:30', NULL, 'afe', '2025-10-15 15:48:18', 'afe', '2025-11-03 16:16:43', 0, NULL, 1, '', '2025-12-17 09:57:30', NULL, '2025-10-18 09:57:30', NULL);
REPLACE INTO `g3fo_user`.`m_user_login` (`id`, `user_id`, `user_code`, `channel_code`, `login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`, `suspense_flag`, `enable_dt_info_flag`, `mult_session_flag`, `info_package_id`, `next_remind_date`, `remind_day`, `change_pwd_date`, `token`)
VALUES (1980074162877763584, 1980073989309075456, 'g3sfsupport', 'PT', NULL, 'F877376BAD1A22E67333F299305674CDEC789F2BA2E5BFD074A6B40F0D245CDB', 0, '2026-01-18 08:50:43', NULL, 'afe', '2025-10-20 08:50:43', 'afe', '2025-10-21 15:13:28', 0, NULL, 1, '', '2025-12-19 08:50:43', NULL, '2025-10-20 08:50:43', NULL);
REPLACE INTO `g3fo_user`.`m_user_login` (`id`, `user_id`, `user_code`, `channel_code`, `login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`, `suspense_flag`, `enable_dt_info_flag`, `mult_session_flag`, `info_package_id`, `next_remind_date`, `remind_day`, `change_pwd_date`, `token`)
VALUES (1980074798025412608, 1980074724268576768, 'szg3sfsupport', 'PT', NULL, 'F877376BAD1A22E67333F299305674CDEC789F2BA2E5BFD074A6B40F0D245CDB', 0, '2026-01-18 08:53:15', NULL, 'afe', '2025-10-20 08:53:15', 'afe', '2025-10-20 08:53:14', 0, NULL, 1, '', '2025-12-19 08:53:15', NULL, '2025-10-20 08:53:15', NULL);
REPLACE INTO `g3fo_user`.`m_user_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1943512984248782848, 1943512935934595072, 'APPSTORE1', 9, 1, 'sys', '2025-07-11 11:29:39', 'sys', '2025-07-11 11:29:39');
REPLACE INTO `g3fo_user`.`m_user_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1962711775682105344, 1943512935934595072, 'APPSTORE1', 10, 1, 'L_TANG', '2025-09-02 10:58:47', 'L_TANG', '2025-09-02 10:58:47');
REPLACE INTO `g3fo_user`.`m_user_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1925469448863657985, 1925469397361799170, 'afe', 1, 1, 'sys', '2025-05-22 16:31:05', 'sys', '2025-05-22 16:31:05');
REPLACE INTO `g3fo_user`.`m_user_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1959823319108816896, 1925469397361799170, 'afe', 2, 1, 'afe', '2025-08-25 11:41:06', 'afe', '2025-08-25 11:41:06');
REPLACE INTO `g3fo_user`.`m_user_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1978734167583756288, 1978367120546861056, 'g2sfsupport', 1, 1, 'sys', '2025-10-16 16:06:03', 'sys', '2025-10-16 16:06:03');
REPLACE INTO `g3fo_user`.`m_user_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1980074075913064448, 1980073989309075456, 'g3sfsupport', 1, 1, 'afe', '2025-10-20 08:50:22', 'afe', '2025-10-20 08:50:22');
REPLACE INTO `g3fo_user`.`m_user_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1980074746255118336, 1980074724268576768, 'szg3sfsupport', 1, 1, 'afe', '2025-10-20 08:53:02', 'afe', '2025-10-20 08:53:02');
-- ===============================
-- 初始化 g3fo_admin 管理员
-- ===============================
REPLACE INTO `g3fo_admin`.`m_admin` (`id`, `user_code`, `local_name`, `eng_name`, `user_type`, `user_status`, `title`, `branch_code`, `department`, `mobile_no`, `email`, `expiry_date`, `create_by`, `create_on`, `update_by`, `update_on`, `otp_logon`, `otp_method`, `soft_key`, `passport_id`)
VALUES (1, 'sys', 'sys', 'sys', '1', '0', '', '', '4', '', 'man.zhong@afe.hk', '2030-12-31 14:59:32', 'sys', '2023-09-06 14:59:40', '2', '2025-05-22 17:16:47', '', '', '', '');
REPLACE INTO `g3fo_admin`.`m_admin` (`id`, `user_code`, `local_name`, `eng_name`, `user_type`, `user_status`, `title`, `branch_code`, `department`, `mobile_no`, `email`, `expiry_date`, `create_by`, `create_on`, `update_by`, `update_on`, `otp_logon`, `otp_method`, `soft_key`, `passport_id`)
VALUES (1927187036663549954, 'opr', 'opr', 'opr', '0', '0', '', '', '5', '', 'man.zhong@afe.hk', NULL, 'sys', '2025-05-27 10:16:09', 'sys', NULL, 'DISD', 'NON', NULL, '');
REPLACE INTO `g3fo_admin`.`m_admin` (`id`, `user_code`, `local_name`, `eng_name`, `user_type`, `user_status`, `title`, `branch_code`, `department`, `mobile_no`, `email`, `expiry_date`, `create_by`, `create_on`, `update_by`, `update_on`, `otp_logon`, `otp_method`, `soft_key`, `passport_id`)
VALUES (1927187170034028545, 'afe', 'afe', 'afe', '0', '0', '', '', '5', '', 'john.kong@afe.hk', NULL, 'sys', '2025-05-27 10:16:41', 'sys', '2025-05-30 14:13:18', 'ENG', 'NON', 'b99a24f0b2152335c17ec192970335b372a8dc5d', 'A123456');
REPLACE INTO `g3fo_admin`.`m_admin` (`id`, `user_code`, `local_name`, `eng_name`, `user_type`, `user_status`, `title`, `branch_code`, `department`, `mobile_no`, `email`, `expiry_date`, `create_by`, `create_on`, `update_by`, `update_on`, `otp_logon`, `otp_method`, `soft_key`, `passport_id`)
VALUES (1978983781352595458, 'g3bsupport', 'g3bsupport', 'g3bsupport', '0', '0', '', 'DEFAULT', '1', '', '', NULL, 'sys', '2025-10-17 08:37:55', 'sys', NULL, 'DISD', 'NON', NULL, '');
REPLACE INTO `g3fo_admin`.`m_admin_login` (`id`, `user_id`, `user_code`, `channel_code`, `admin_login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1, 1, 'sys', 'OM', '1', 'F877376BAD1A22E67333F299305674CDEC789F2BA2E5BFD074A6B40F0D245CDB', 0, '2023-09-06 15:02:48', '2023-09-06 15:02:51', '1', '2023-09-06 15:02:55', '1', '2023-09-06 15:02:59');
REPLACE INTO `g3fo_admin`.`m_admin_login` (`id`, `user_id`, `user_code`, `channel_code`, `admin_login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1927187036743241729, 1927187036663549954, 'opr', 'OM', '1', 'F877376BAD1A22E67333F299305674CDEC789F2BA2E5BFD074A6B40F0D245CDB', 0, NULL, NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `g3fo_admin`.`m_admin_login` (`id`, `user_id`, `user_code`, `channel_code`, `admin_login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1927187170126303234, 1927187170034028545, 'afe', 'OM', '1', 'F877376BAD1A22E67333F299305674CDEC789F2BA2E5BFD074A6B40F0D245CDB', 0, NULL, NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `g3fo_admin`.`m_admin_login` (`id`, `user_id`, `user_code`, `channel_code`, `admin_login_status`, `password`, `retry_count`, `pwd_expiry_date`, `last_login_date`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1978983781449064449, 1978983781352595458, 'g3bsupport', 'OM', '1', 'F877376BAD1A22E67333F299305674CDEC789F2BA2E5BFD074A6B40F0D245CDB', 0, NULL, NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `g3fo_admin`.`m_admin_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1927187036705492994, 1927187036663549954, 'opr', 4, NULL, 'sys', '2025-05-27 10:16:10', 'sys', '2025-05-27 10:16:10');
REPLACE INTO `g3fo_admin`.`m_admin_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1927187170080165890, 1927187170034028545, 'afe', 4, NULL, 'sys', '2025-05-27 10:16:41', 'opr', '2025-05-30 14:13:19');
REPLACE INTO `g3fo_admin`.`m_admin_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1, 1, 'sys', 4, NULL, 'sys', '2023-11-13 09:37:56', 'sys', '2025-05-22 17:16:47');
REPLACE INTO `g3fo_admin`.`m_admin_role_relation_def` (`id`, `user_id`, `user_code`, `user_role_templates_id`, `active_flag`, `create_by`, `create_on`, `update_by`, `update_on`)
VALUES (1978983781377761282, 1978983781352595458, 'g3bsupport', 4, NULL, 'sys', '2025-10-17 08:37:56', 'sys', '2025-10-17 08:37:56');
-- ===============================
-- 市场 API 会话与系统参数更新
-- ===============================
UPDATE `g3fo_base`.`m_exchange`
SET `market_session_code` = 'OCG';
DELETE FROM `g3fo_base`.`m_market_api_session_info`;
INSERT INTO `g3fo_base`.`m_market_api_session_info` (`id`, `market_api_info_id`, `session_code`, `exchange_code`, `sender_comp_id`, `target_comp_id`, `rsakey`, `username`, `password`, `new_password`, `broker_list`, `auto_sync_seq_num_flag`, `auto_get_broker_id_flag`, `throttle_limit`, `remark`, `create_on`, `create_by`, `update_on`, `update_by`)
VALUES (1, 1, 'OCG', 'SEHK', 'CO01433001', 'HKEXCO', 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3bn6Y9Uz6lmtQZXl3cQnTshv8G3X8F3G35p1gdAD1pphD6FzfYnrwxrzqrbu27x4RQ9MpACi/8ct7OmyKiW06jekCJAGuy5EpHJWLnjYJS0ZcpYEQLfg3dEoY1X8J1S5S8oK0DVfk5gQrtyS9XOhU7D8aJbF6O/rZU5U5Nz/2p7e87sZeWAQigntFYN4pn68TkFzaVcoL7o4RN9AnQtDyXJcxwnP0bZxiOxOft5Jj6UB0I/5SOCZF61c9xxsd8fA3JkSTmudO80bnSwsmJZO7oCvu6R3FlHTWy8lZNwH0Wo5kaMCvKrn1i72fcUVVN5OcdmFIl+Yj3PqRGLIhGzM6wIDAQAB', NULL, 'Hw171025', 'Hw171025', '1399,1390,1391,1398', 0, 1, 0, '', NOW(), NULL, NOW(), 'sys');
INSERT INTO `g3fo_base`.`m_market_api_session_info` (`id`, `market_api_info_id`, `session_code`, `exchange_code`, `sender_comp_id`, `target_comp_id`, `rsakey`, `username`, `password`, `new_password`, `broker_list`, `auto_sync_seq_num_flag`, `auto_get_broker_id_flag`, `throttle_limit`, `remark`, `create_on`, `create_by`, `update_on`, `update_by`)
VALUES (2, 1, 'OCG-DC', 'SEHK', 'CC01433001', 'HKEXCC', 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3bn6Y9Uz6lmtQZXl3cQnTshv8G3X8F3G35p1gdAD1pphD6FzfYnrwxrzqrbu27x4RQ9MpACi/8ct7OmyKiW06jekCJAGuy5EpHJWLnjYJS0ZcpYEQLfg3dEoY1X8J1S5S8oK0DVfk5gQrtyS9XOhU7D8aJbF6O/rZU5U5Nz/2p7e87sZeWAQigntFYN4pn68TkFzaVcoL7o4RN9AnQtDyXJcxwnP0bZxiOxOft5Jj6UB0I/5SOCZF61c9xxsd8fA3JkSTmudO80bnSwsmJZO7oCvu6R3FlHTWy8lZNwH0Wo5kaMCvKrn1i72fcUVVN5OcdmFIl+Yj3PqRGLIhGzM6wIDAQAB', NULL, 'Hw171025', 'Hw171025', '1399,1390,1391,1398', 0, 1, 0, '', NOW(), NULL, NOW(), 'sys');
UPDATE `g3fo_base`.`m_system_setting`
SET `param_value` = '3082014B0201003082012C06072A8648CE3804013082011F02818100FD7F53811D75122952DF4A9C2EECE4E7F611B7523CEF4400C31E3F80B6512669455D402251FB593D8D58FABFC5F5BA30F6CB9B556CD7813B801D346FF26660B76B9950A5A49F9FE8047B1022C24FBBA9D7FEB7C61BF83B57E7C6A8A6150F04FB83F6D3C51EC3023554135A169132F675F3AE2B61D72AEFF22203199DD14801C70215009760508F15230BCCB292B982A2EB840BF0581CF502818100F7E1A085D69B3DDECBBCAB5C36B857B97994AFBBFA3AEA82F9574C0B3D0782675159578EBAD4594FE67107108180B449167123E84C281613B7CF09328CC8A6E13C167A8B547C8D28E0A3AE1E2BB3A675916EA37F0BFA213562F1FB627A01243BCCA4F1BEA8519089A883DFE15AE59F06928B665E807B552564014C3BFECF492A041602141FD4151E4E63E45D0E480CC880E04E0E4746F393',
`description_i18n_id` = NULL,
`remark` = 'Infobase Single Logon Private Key',
`create_by` = 'ken',
`create_on` = '2024-02-22 09:21:43',
`update_by` = 'ken',
`update_on` = NOW()
WHERE `param_name` = 'base.infoBaseLogonKey';
UPDATE `g3fo_base`.`m_system_setting`
SET `param_value` = '683',
`description_i18n_id` = NULL,
`remark` = 'Site ID for Single pass Logon',
`create_by` = 'ken',
`create_on` = '2024-02-22 09:18:26',
`update_by` = 'ken',
`update_on` = NOW()
WHERE `param_name` = 'base.siteId';
UPDATE `g3fo_base`.`m_system_setting`
SET `param_value` = 'hingwai',
`description_i18n_id` = NULL,
`remark` = 'Site Name (group name required)',
`create_by` = 'ken',
`create_on` = '2024-02-22 09:18:06',
`update_by` = 'ken',
`update_on` = NOW()
WHERE `param_name` = 'base.siteName';