问卷调查相关表

CREATE TABLE `tf_survey` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `title` VARCHAR(255) NOT NULL COMMENT '标题',
    `begin_time` INT(11) NULL COMMENT '开始时间',
    `end_time` INT(11) NULL COMMENT '结束时间',
    `create_time` INT(11) NOT NULL COMMENT '创建时间',
    `is_publish`    TINYINT(4) NOT NULL DEFAULT 0 COMMENT '状态 0未发布 1已发布',
    `deleted` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '0 正常 1删除',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '问卷调查,发布之后不可编辑';

CREATE TABLE `tf_survey_question` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `survey_id` INT(11) NOT NULL COMMENT '问卷id',
    `subject` VARCHAR(255) NOT NULL COMMENT '标题',
    `type` TINYINT(4) NULL COMMENT '类型1单选 2多选 3问答',
    `create_time` INT(11) NOT NULL COMMENT '创建时间',
    `deleted` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '0 正常 1删除',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '问卷题目,发布之后不可编辑';

CREATE TABLE `tf_survey_question_item` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `question_id` INT(11) NOT NULL COMMENT '问题id',
    `option` VARCHAR(255) NOT NULL COMMENT '选项内容',
    `create_time` INT(11) NOT NULL COMMENT '创建时间',
    `deleted` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '0 正常 1删除',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '题目选项,发布之后不可编辑';


CREATE TABLE `tf_survey_company` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `survey_id` INT(11) NOT NULL COMMENT '问卷id',
    `company_id` INT(11) NOT NULL COMMENT '企业id',
    `is_sub`    TINYINT(4) NOT NULL DEFAULT 0 COMMENT '状态 0未提交 1已提交',
    `sub_time` INT(11) NOT NULL COMMENT '提交时间',
    `create_time` INT(11) NOT NULL COMMENT '创建时间',
    `deleted` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '0 正常 1删除',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '分配企业';

CREATE TABLE `tf_survey_answer` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `survey_id` INT(11) NOT NULL COMMENT '问卷id',
    `company_id` INT(11) NOT NULL COMMENT '企业id',
    `question_id` INT(11) NOT NULL COMMENT '题目id',
    `question_type` TINYINT(11) NOT NULL COMMENT '题目类型 冗余',
    `answer` TEXT NOT NULL COMMENT '回答内容,单选存id,多选存id,问答存内容。id两边都有逗号,便于筛选数据。',
    `create_time` INT(11) NOT NULL COMMENT '创建时间',
    `deleted` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '0 正常 1删除',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '企业回答';

问卷表,题目表,选项表,分配表,答题表。

posted @ 2020-03-10 11:24  TBHacker  阅读(249)  评论(0编辑  收藏  举报