List<FileInfo> fileInfos = fileInfoMapper.selectCondition(fileInfoVo);
//时间格式转换
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");//需要的格式
for (FileInfo fileInfo : fileInfos) {
Date date = fileInfo.getDate();//获取实体类中的时间
String s = simpleDateFormat.format(date);//时间类型转换为字符串类型
try {
Date newDate = simpleDateFormat.parse(s);//转换为需要的时间格式
java.sql.Date resultDate = new java.sql.Date(newDate.getTime());//最后转换为java.sql.Date类型重新赋给date
fileInfo.setDate(resultDate);
} catch (ParseException e) {
e.printStackTrace();
}
}