DROPTABLEIFEXISTSuser;CREATETABLEuser(
id BIGINT(20)NOTNULLCOMMENT'主键ID',
name VARCHAR(30)NULLDEFAULTNULLCOMMENT'姓名',
age INT(11)NULLDEFAULTNULLCOMMENT'年龄',
email VARCHAR(50)NULLDEFAULTNULLCOMMENT'邮箱',PRIMARYKEY(id));INSERTINTOuser(id, name, age, email)VALUES(1,'Jone',18,'test1@baomidou.com'),(2,'Jack',20,'test2@baomidou.com'),(3,'Tom',28,'test3@baomidou.com'),(4,'Sandy',21,'test4@baomidou.com'),(5,'Billie',24,'test5@baomidou.com');
packagecom.no.seckill;importcom.no.seckill.dao.UserMapper;importcom.no.seckill.entity.User;importorg.junit.runner.RunWith;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.boot.test.context.SpringBootTest;importorg.springframework.test.context.junit4.SpringRunner;@RunWith(SpringRunner.class)@SpringBootTest()publicclassTest{@AutowiredprivateUserMapper userMapper;@org.junit.Testpublicvoidtest(){User user = userMapper.selectById(1);System.out.println(user.toString());}}