选择导出其实没什么特别的
首先我们需要在实体类中添加注解
你想让它在Excel中位于第几列得弄出来所以说我们需要写第几列order=1就是第一列
如果我们想要表连接查询导出我们需要在实体类中写它表连接导出的属性
在dao.xml中也需要写新的声明, 同时需要在sql语句代码中给名字重写(as)要和在实体类中写的属性的名称一样
@ExcelResources(title="成绩编号",order=1)
public Integer getRid() {
return rid;
}
controller
在这里我是用request去接受的值
传过来又进行的操作去进行判断是选择了id没有还是没有选择
没有选择则查出来这个表的所有数据
而选择了的话则会只查出选择的那几条数据
/**
* 批量自选导出用户
* @throws IOException
*/
@Log("导出用户")
@RequestMapping("/exportExcelTwo")
@RequiresPermissions("platform:record:exportExcelTwo")
public void exportExcelTwo(HttpServletRequest request,HttpServletResponse response) throws IOException{
String recordIds = request.getParameter("recordIds");
List<Record> records = new ArrayList<