DROP TABLE IF EXISTS `t_comm_person_inoutlog`;
CREATE TABLE `t_comm_person_inoutlog` (
`dataid` varchar(100) NOT NULL COMMENT '日志编号',
`personid` varchar(100) NOT NULL COMMENT '人员编号',
`collecttime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上报时间',
`gateid` varchar(100) DEFAULT NULL COMMENT '闸机编号',
`dir` int(10) DEFAULT '1' COMMENT '1-进;2-出;',
`photourl` varchar(200) DEFAULT NULL COMMENT '照片路径',
`projectid` varchar(100) DEFAULT NULL COMMENT '项目编号',
`remark` varchar(200) DEFAULT NULL COMMENT '备注',
`inouttype` int(10) DEFAULT '1' COMMENT '1--小区;2--楼栋单元;3--其他;',
`cardtype` int(10) DEFAULT '7' COMMENT '1--IC卡;2--身份证;3--二维码;4--指纹;5--蓝牙;6--CPU;7--人脸;',
`cardno` varchar(100) DEFAULT NULL COMMENT '卡号',
`unlockflag` int(10) DEFAULT '1' COMMENT '1--开启;2--未开启;',
PRIMARY KEY (`dataid`, `collecttime`),
KEY `idx_personid` (`personid`),
KEY `idx_collecttime` (`collecttime`) USING BTREE,
KEY `idx_projectId` (`projectid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
PARTITION BY RANGE (TO_DAYS(collecttime)) (
PARTITION combo_rm_collecttime_20201010_12 VALUES LESS THAN (TO_DAYS('20201010'))
);
https://www.cnblogs.com/zmxmumu/p/4450857.html