2023-04-16 16:56:56 +08:00
|
|
|
|
CREATE TABLE `access_log` (
|
|
|
|
|
`id` bigint(20) NOT NULL COMMENT '雪花id',
|
|
|
|
|
`time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '进出时间',
|
|
|
|
|
`user_id` int(11) NOT NULL COMMENT '用户id',
|
|
|
|
|
`user_real_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '用户真实姓名',
|
|
|
|
|
`gate_id` bigint(20) NOT NULL COMMENT '大门id',
|
|
|
|
|
`type` enum('IN','OUT') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '类型(进门 OR 出门)'
|
|
|
|
|
)
|
2023-04-15 19:25:52 +08:00
|
|
|
|
|
|
|
|
|
创建该表的 add update getList deleteById 的 Mybatils xml片段
|
2023-04-16 16:56:56 +08:00
|
|
|
|
(例如:<insert id="addAccessLog">,<update id="updateAccessLog">,<select id="getAccessLogList">,<delete id="deleteAccessLogById">)
|
2023-04-15 19:25:52 +08:00
|
|
|
|
|
|
|
|
|
实体类如下
|
|
|
|
|
|
2023-04-16 16:56:56 +08:00
|
|
|
|
public class AccessLog implements Serializable {
|
2023-04-15 19:25:52 +08:00
|
|
|
|
private Long id;
|
2023-04-16 16:56:56 +08:00
|
|
|
|
private Date time;
|
|
|
|
|
private Integer userId;
|
|
|
|
|
private String userRealName;
|
|
|
|
|
private Long gateId;
|
|
|
|
|
private String type;
|
2023-04-15 19:25:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
以下是一些要求
|
2023-04-16 16:56:56 +08:00
|
|
|
|
parameterType="com.cxyxiaomo.epp.common.pojo.AccessLog"
|
2023-04-15 19:25:52 +08:00
|
|
|
|
where 条件所引用的Java变量都需要先判断是否为null或空
|
|
|
|
|
输出应该为一个 ```code``` 包起来的代码片段
|