USE hnqzx;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for wm_task_sub_rule
-- ----------------------------
DROP TABLE IF EXISTS `wm_task_sub_rule`;
CREATE TABLE `wm_task_sub_rule`
(
    `rule_id`     INT(20)     NOT NULL AUTO_INCREMENT COMMENT '规则ID',
    `dept_id`     INT(20)     NOT NULL COMMENT '企业id',
    `sub_cate`    VARCHAR(32) NOT NULL COMMENT '次级分类',
    `sub_rule`    JSON COMMENT '规则',
    `opt_flag`    VARCHAR(32) NOT NULL 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 (`rule_id`) USING BTREE,
    INDEX `idx_dept_id` (`dept_id`) USING BTREE,
    INDEX `idx_sub_cate` (`sub_cate`) USING BTREE
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4 COMMENT ='任务提交规则表';

-- ----------------------------
-- Records of wm_task_sub_rule
-- ----------------------------
BEGIN;
INSERT INTO wm_task_sub_rule (rule_id, dept_id, sub_cate, sub_rule, opt_flag, create_time, update_time) VALUES (1, 1, 'PRODUCT_ALBUM', '[{"manual": "同一个人对同一个相册的转发上限", "frequency": [{"quantity": 20, "timeUnit": "DAY", "separator": "/"}]}]', 'OK', '2022-08-15 18:18:53', '2022-08-15 18:18:53');
INSERT INTO wm_task_sub_rule (rule_id, dept_id, sub_cate, sub_rule, opt_flag, create_time, update_time) VALUES (2, 1, 'ACADEMIC_INFO_EXCHANGE', '[{"manual": "同一个人对同一篇文章的转发上限", "frequency": [{"quantity": 20, "timeUnit": "DAY", "separator": "/"}]}]', 'OK', '2022-08-15 18:18:53', '2022-08-15 18:18:53');
INSERT INTO wm_task_sub_rule (rule_id, dept_id, sub_cate, sub_rule, opt_flag, create_time, update_time) VALUES (3, 1, 'CONFERENCE', '[{"manual": "任务有效期限", "frequency": [{"quantity": 30, "timeUnit": "DAY", "separator": "/"}]}, {"manual": "举办次数上限", "frequency": [{"quantity": 2, "timeUnit": "DAY", "separator": "/"}]}]', 'OK', '2022-08-15 18:18:53', '2022-08-15 18:18:53');
INSERT INTO wm_task_sub_rule (rule_id, dept_id, sub_cate, sub_rule, opt_flag, create_time, update_time) VALUES (4, 1, 'ONE_ON_ONE_INTERVIEW', '[{"manual": "任务有效期限", "frequency": [{"quantity": 30, "timeUnit": "DAY", "separator": ""}]}, {"manual": "举办次数上限", "frequency": [{"quantity": 2, "timeUnit": "DAY", "separator": "/"}]}]', 'OK', '2022-08-15 18:18:53', '2022-08-15 18:18:53');
INSERT INTO wm_task_sub_rule (rule_id, dept_id, sub_cate, sub_rule, opt_flag, create_time, update_time) VALUES (5, 1, 'TRAINING', '[{"manual": "任务有效期限", "frequency": [{"quantity": 30, "timeUnit": "DAY", "separator": ""}]}, {"manual": "举办次数上限", "frequency": [{"quantity": 2, "timeUnit": "DAY", "separator": "/"}]}]', 'OK', '2022-08-15 18:18:53', '2022-08-15 18:18:53');
INSERT INTO wm_task_sub_rule (rule_id, dept_id, sub_cate, sub_rule, opt_flag, create_time, update_time) VALUES (6, 1, 'BUSINESS_COMPANY_VISIT', '[{"manual": "打卡时间间隔", "frequency": [{"quantity": 30, "timeUnit": "MINUTE", "separator": ""}]}, {"manual": "同一个人在同一个商业公司的打卡时间间隔", "frequency": [{"quantity": 4, "timeUnit": "HOUR", "separator": ""}]}]', 'OK', '2022-08-15 18:18:53', '2022-08-15 18:18:53');
INSERT INTO wm_task_sub_rule (rule_id, dept_id, sub_cate, sub_rule, opt_flag, create_time, update_time) VALUES (7, 1, 'HOSPITAL_VISIT', '[{"manual": "打卡时间间隔", "frequency": [{"quantity": 30, "timeUnit": "MINUTE", "separator": ""}]}, {"manual": "同一个人在同一家医院的打卡时间间隔", "frequency": [{"quantity": 4, "timeUnit": "HOUR", "separator": ""}]}]', 'OK', '2022-08-15 18:18:53', '2022-08-15 18:18:53');
INSERT INTO wm_task_sub_rule (rule_id, dept_id, sub_cate, sub_rule, opt_flag, create_time, update_time) VALUES (8, 1, 'PHARMACY_VISIT', '[{"manual": "打卡时间间隔", "frequency": [{"quantity": 30, "timeUnit": "MINUTE", "separator": ""}]}, {"manual": "同一个人在同一家药店的打卡时间间隔", "frequency": [{"quantity": 4, "timeUnit": "HOUR", "separator": ""}]}]', 'OK', '2022-08-15 18:18:53', '2022-08-15 18:18:53');
INSERT INTO wm_task_sub_rule (rule_id, dept_id, sub_cate, sub_rule, opt_flag, create_time, update_time) VALUES (9, 1, 'INVENTORY_INFO_COLLECTION', '[{"manual": "任务上限", "frequency": [{"quantity": 3, "timeUnit": "DAY", "separator": "/"}]}]', 'OK', '2022-08-15 18:18:53', '2022-08-15 18:18:53');
INSERT INTO wm_task_sub_rule (rule_id, dept_id, sub_cate, sub_rule, opt_flag, create_time, update_time) VALUES (10, 1, 'HOSPITAL_INFO_COLLECTION', '[{"manual": "同一家医院的修改次数上限", "frequency": [{"quantity": 3, "timeUnit": "MONTH", "separator": "/"}]}, {"manual": "同一个人对同一家医院的修改次数上限", "frequency": [{"quantity": 1, "timeUnit": "MONTH", "separator": "/"}]}]', 'OK', '2022-08-15 18:18:53', '2022-08-15 18:18:53');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;