-- ----------------------------
-- Table structure for qz_task
-- ----------------------------
drop table if exists qz_task;
create table qz_task (
    task_id         bigint(20)      NOT NULL DEFAULT 0          COMMENT '求助任务ID',
    task_target     varchar(20)     NOT NULL DEFAULT ''         COMMENT '求助对象：A业委会，B居委会，C物业，D志愿者',
    task_status     int(11)         NOT NULL DEFAULT 0          COMMENT '求助状态：1未解决，2处理中，3已处理',
    task_title      varchar(20)     NOT NULL DEFAULT ''         COMMENT '求助标题',
    remark          varchar(100)    NOT NULL DEFAULT ''         COMMENT '备注',
    user_id         bigint(20)      NOT NULL DEFAULT 0          COMMENT '用户ID',
    user_name       varchar(20)     NOT NULL DEFAULT ''         COMMENT '用户名称',
    house_number    varchar(20)     NOT NULL DEFAULT ''         COMMENT '门牌号',
    house_id        varchar(20)     NOT NULL DEFAULT ''         COMMENT '门牌号ID',
    uptown_id       bigint(20)      NOT NULL DEFAULT 0          COMMENT '小区ID,下拉选ID',

    user_create     bigint(20)      NOT NULL DEFAULT 0          COMMENT '新增人',
    time_create     datetime(0)     NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
    user_update     bigint(20)      NOT NULL DEFAULT 0          COMMENT '修改人',
    time_update     datetime(0)     NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
    PRIMARY KEY (task_id) USING BTREE,
    INDEX user_id(user_id) USING BTREE
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8
COMMENT = '家庭求助表'
;

-- ----------------------------
-- Table structure for qz_task_reply
-- ----------------------------
DROP TABLE IF EXISTS qz_task_reply;
CREATE TABLE qz_task_reply (
    reply_id          bigint(20)    NOT NULL DEFAULT 0      COMMENT '回复ID',
    task_id           bigint(20)    NOT NULL DEFAULT 0      COMMENT '求助ID',
    user_id           bigint(20)    NOT NULL DEFAULT 0      COMMENT '回复用户ID',
    reply_content     varchar(100)  NOT NULL DEFAULT ''     COMMENT '回复内容',

    user_create       bigint(20)    NOT NULL DEFAULT 0      COMMENT '新增人',
    time_create       datetime(0)   NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
    user_update       bigint(20)    NOT NULL DEFAULT 0      COMMENT '修改人',
    time_update       datetime(0)   NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
    PRIMARY KEY (reply_id) USING BTREE,
    INDEX task_id(task_id) USING BTREE
) ENGINE = InnoDB default charset=utf8 comment = '家庭求助回复表';
