when SpringBoot uploads batch files, the information of uploaded files is written, and the database is found to be duplicated.
uses mybatis + mybatis-plus.
service code as follows:
public Boolean insertByEntity(SysPkFile entity) {
System.out.println(entity.getFileName());
sysPkFileMapper.insert(entity);
System.out.println(entity.getFileName());
return false;
}
here is the content printed by the method. As you can see, the FileName field passed in to entity is correct. But only the last piece of data was inserted when it was inserted.
what is the cause of this and how to solve it? thank you!