1.为bean添加主键返回策略@GeneratedValue(strategy = GenerationType.IDENTITY)
2.mybatis自动生成的有些bean没有转换主键,在jdbc的url中添加nullCatalogMeansCurrent=true,其中&符号被idea识别成特殊符号,故用&代替
connectionURL="jdbc:mysql://localhost:3306/mall1?serverTimezone=UTC&nullCatalogMeansCurrent=true"