You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RuoYi-Vue/sql_refacor0120/t_industry_basic.sql

18 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

-- 行业基础数据表:存储行业基础信息
CREATE TABLE `t_industry_basic` (
`industry_code` VARCHAR(20) NOT NULL COMMENT '行业代码如802089.EI',
`industry_name` VARCHAR(50) NOT NULL COMMENT '行业名称(如"银行"',
`industry_level` TINYINT NOT NULL DEFAULT 2 COMMENT '行业级别1=一级行业2=二级行业3=三级行业等)',
`parent_industry_code` VARCHAR(20) NULL COMMENT '父级行业代码',
`description` TEXT NULL COMMENT '行业描述',
`status` TINYINT NOT NULL DEFAULT 1 COMMENT '状态1=正常0=禁用)',
`sort_order` INT NOT NULL DEFAULT 0 COMMENT '排序',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
-- 主键:行业代码
PRIMARY KEY (`industry_code`),
-- 索引:按行业级别查询优化
INDEX `idx_t_industry_basic_level` (`industry_level`),
-- 索引:按状态查询优化
INDEX `idx_t_industry_basic_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='行业基础数据表';