## 如图所示
![mark](http://olbhidnfa.bkt.clouddn.com/blog/20171015-012424825.png)
## 正式表
```
DROP TABLE IF EXISTS `cmf_agent_category`;
CREATE TABLE `cmf_agent_category` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '分类id',
`parent_id` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分类父id',
`delete_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
`list_order` float NOT NULL DEFAULT 10000 COMMENT '排序',
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '分类名称',
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分类层级关系路径',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '分类表' ROW_FORMAT = Compact;
```
## 测试数据
```
INSERT INTO `cmf_agent_category` VALUES (8, 0, 0, 10000, '一级分类1', '0-8');
INSERT INTO `cmf_agent_category` VALUES (9, 8, 0, 10000, '二级分类1', '0-8-9');
INSERT INTO `cmf_agent_category` VALUES (10, 9, 0, 10000, '三级分类1', '0-8-9-10');
INSERT INTO `cmf_agent_category` VALUES (11, 10, 0, 10000, '四级分类1', '0-8-9-10-11');
INSERT INTO `cmf_agent_category` VALUES (12, 0, 0, 10000, '一级分类2', '0-12');
INSERT INTO `cmf_agent_category` VALUES (13, 0, 0, 10000, '一级分类4', '0-13');
INSERT INTO `cmf_agent_category` VALUES (14, 9, 0, 10000, '五级分类1', '0-8-9-14');
INSERT INTO `cmf_agent_category` VALUES (15, 14, 1508001532, 10000, '六级分类1', '0-8-9-14-15');
```