瀏覽代碼

导出添加性别

夏文涛 11 月之前
父節點
當前提交
f9c906dff3

+ 26 - 24
src/main/java/com/template/controller/WelcomeStudentController.java

@@ -1539,35 +1539,37 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
         Row headerRow = sheet.createRow(0);
         headerRow.createCell(0).setCellValue("序号");
         headerRow.createCell(1).setCellValue("录取号");
-        headerRow.createCell(2).setCellValue("姓名");
-        headerRow.createCell(3).setCellValue("身份证号");
-        headerRow.createCell(4).setCellValue("院系");
-        headerRow.createCell(5).setCellValue("专业");
-        headerRow.createCell(6).setCellValue("班级");
-        headerRow.createCell(7).setCellValue("交通方式");
-        headerRow.createCell(8).setCellValue("到站地点");
-        headerRow.createCell(9).setCellValue("陪同人数");
-        headerRow.createCell(10).setCellValue("填报状态");
-        headerRow.createCell(11).setCellValue("应缴金额");
-        headerRow.createCell(12).setCellValue("实付金额");
-        headerRow.createCell(13).setCellValue("宿舍信息");
+        headerRow.createCell(2).setCellValue("性别");
+        headerRow.createCell(3).setCellValue("姓名");
+        headerRow.createCell(4).setCellValue("身份证号");
+        headerRow.createCell(5).setCellValue("院系");
+        headerRow.createCell(6).setCellValue("专业");
+        headerRow.createCell(7).setCellValue("班级");
+        headerRow.createCell(8).setCellValue("交通方式");
+        headerRow.createCell(9).setCellValue("到站地点");
+        headerRow.createCell(10).setCellValue("陪同人数");
+        headerRow.createCell(11).setCellValue("填报状态");
+        headerRow.createCell(12).setCellValue("应缴金额");
+        headerRow.createCell(13).setCellValue("实付金额");
+        headerRow.createCell(14).setCellValue("宿舍信息");
         for (int i = 0; i < result.size(); i++) {
             StudentPageVo studentData = result.get(i);
             Row dataRow = sheet.createRow(i + 1);
             dataRow.createCell(0).setCellValue(i + 1);
             dataRow.createCell(1).setCellValue(studentData.getAdmissNum());
-            dataRow.createCell(2).setCellValue(studentData.getName());
-            dataRow.createCell(3).setCellValue(studentData.getCardId());
-            dataRow.createCell(4).setCellValue(studentData.getCollege());
-            dataRow.createCell(5).setCellValue(studentData.getMajor());
-            dataRow.createCell(6).setCellValue(studentData.getClassstr());
-            dataRow.createCell(7).setCellValue(studentData.getTrafficMethod());
-            dataRow.createCell(8).setCellValue(studentData.getArrive());
-            dataRow.createCell(9).setCellValue(studentData.getAccompanyNum());
-            dataRow.createCell(10).setCellValue(studentData.getFillStatus());
-            dataRow.createCell(11).setCellValue(String.valueOf(studentData.getAmountPayable()));
-            dataRow.createCell(12).setCellValue(String.valueOf(studentData.getPayAmount()));
-            dataRow.createCell(13).setCellValue(studentData.getDormitory());
+            dataRow.createCell(2).setCellValue(studentData.getSex());
+            dataRow.createCell(3).setCellValue(studentData.getName());
+            dataRow.createCell(4).setCellValue(studentData.getCardId());
+            dataRow.createCell(5).setCellValue(studentData.getCollege());
+            dataRow.createCell(6).setCellValue(studentData.getMajor());
+            dataRow.createCell(7).setCellValue(studentData.getClassstr());
+            dataRow.createCell(8).setCellValue(studentData.getTrafficMethod());
+            dataRow.createCell(9).setCellValue(studentData.getArrive());
+            dataRow.createCell(10).setCellValue(studentData.getAccompanyNum());
+            dataRow.createCell(11).setCellValue(studentData.getFillStatus());
+            dataRow.createCell(12).setCellValue(String.valueOf(studentData.getAmountPayable()));
+            dataRow.createCell(13).setCellValue(String.valueOf(studentData.getPayAmount()));
+            dataRow.createCell(14).setCellValue(studentData.getDormitory());
         }
         // 将工作簿写入文件
         ExcelUtils.excelDownload(workbook, "学生信息.xlsx", response);

+ 3 - 0
src/main/java/com/template/model/vo/StudentPageVo.java

@@ -19,6 +19,9 @@ public class StudentPageVo {
     @ApiModelProperty(value = "数据ID")
     private Integer id;
 
+    @ApiModelProperty(value = "性别")
+    private String sex;
+
     @ApiModelProperty(value = "录取号")
     private String admissNum;
 

+ 2 - 1
src/main/resources/mapper/template/WelcomeStudentMapper.xml

@@ -16,13 +16,14 @@
         <result property="dormitory" column="dormitory"/>
         <result property="fillStatus" column="fill_status"/>
         <result property="accompanyNum" column="accompanyNum"/>
+        <result property="sex" column="sex"/>
     </resultMap>
 
     <select id="queryStudentPageList" resultType="com.template.model.vo.StudentPageVo" resultMap="studentPageMap">
         select (select count(id) from welcome_accompany where student_card = ws.card_id and deleted = 0) as accompanyNum,
         ws.id,ws.admiss_num,ws.name,ws.card_id,ws.college,ws.major,ws.classstr,
         ws.traffic_method,ws.arrive,ws.amount_payable,ws.pay_amount,ws.fill_status,
-        CONCAT(wsd.build, '-', wsd.dormitory, '-', wsd.number) as dormitory
+        CONCAT(wsd.build, '-', wsd.dormitory, '-', wsd.number) as dormitory,ws.sex
         from welcome_student ws
         left join welcome_bed wsd on wsd.deleted =0 and wsd.student_card = ws.card_id
         where ws.deleted = 0