Files
ycc-proxy-server/deploy/sql/query_subject_index_migration.sql
2026-05-09 12:15:25 +08:00

27 lines
1.4 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- ============================================
-- 被查询人密文索引表:用于管理后台按姓名/手机/身份证筛选订单(字段均为 AES-ECB 确定性密文)
-- ============================================
CREATE TABLE IF NOT EXISTS `query_subject_index` (
`id` CHAR(36) NOT NULL COMMENT 'UUID主键',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`delete_time` datetime DEFAULT NULL COMMENT '删除时间',
`del_state` tinyint NOT NULL DEFAULT '0' COMMENT '删除状态0=未删除1=已删除',
`version` bigint NOT NULL DEFAULT '0' COMMENT '版本号',
`query_id` CHAR(36) NOT NULL COMMENT 'query 表主键',
`order_id` CHAR(36) NOT NULL COMMENT '订单ID',
`enc_real_name` varchar(768) DEFAULT NULL COMMENT '被查询人姓名密文(Base64)',
`enc_mobile` varchar(768) DEFAULT NULL COMMENT '手机号密文(Base64)',
`enc_id_card` varchar(768) DEFAULT NULL COMMENT '身份证密文(Base64)',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_query_id` (`query_id`),
KEY `idx_order_id` (`order_id`),
KEY `idx_enc_mobile` (`enc_mobile`),
KEY `idx_enc_id_card` (`enc_id_card`),
KEY `idx_enc_real_name` (`enc_real_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='被查询人密文索引(仅用于后台筛选)';