CREATE TABLE IF NOT EXISTS user ( id BIGINT(10) UNSIGNED NOT AUTO_INCREMENT COMMENT 'Id', name VARCHAR(10) NOT DEFAULT '' COMMENT '用户名', age INT(3) NOT DEFAULT 0 COMMENT '年龄', address VARCHAR(32) NOT DEFAULT '' COMMENT '地点', email VARCHAR(32) NOT DEFAULT '' COMMENT '邮件', PRIMARY KEY (id)) COMMENT = '用户表';
INSERT INTO user (name, age, address, email)VALUES ('张三', 18, '北京', '[email protected]');INSERT INTO user (name, age, address, email)VALUES ('李四', 19, '上海', '[email protected]');
public interface UserMapper {
int deleteByPrimaryKey(Long id);
int insert(User record);
User selectByPrimaryKey(Long id);
List selectAll();
int updateByPrimaryKey(User record);
}