正确写法
@Select(“select * from fields_header”)
@Results(id = “baseResultMap”, value = {
@Result(property = “id”, column = “id”),
@Result(property = “fileName”, column = “file_name”),
@Result(property = “filePath”, column = “file_path”),
@Result(property = “createTime”, column = “create_time”),
@Result(property = “updateTime”, column = “update_time”),
@Result(property = “createUserId”, column = “create_user_id”)
})
List findAll();
在其他方法需要引用此方法的地方加上
@ResultMap(“baseResultMap”)
@Select(“select id, file_name, file_path, create_user_id from table_name where id = #{fileId}”)
@ResultMap(“baseResultMap”)
FieldsHeader selectFieldsHeader(@Param(“fileId”) String fileId);