浏览代码

学生作业列表显示所有学生
导出增加时间

shenhao 4 年之前
父节点
当前提交
af968f795d

+ 1 - 1
src/main/java/com/ssj/service/sys/fx/service/impl/SysCuratorServiceImpl.java

@@ -120,7 +120,7 @@ public class SysCuratorServiceImpl implements SysCuratorService {
         List<Map<String, Object>> list = curatorMapper.searchActiveTop(startDate,endDate);
         data.put("total",list.size());
         List<Map<String, Object>> lastList = new ArrayList<>();
-        if(pageNo >0){
+        if(pageNo >1){
             lastList =list.subList((pageNo-1)*pageSize,pageNo*pageSize);
         }else{
             lastList.addAll(list);

+ 1 - 0
src/main/java/com/ssj/sys/controller/SysCuratorController.java

@@ -383,6 +383,7 @@ public class SysCuratorController extends BaseController {
                 entity.add(new ExcelExportEntity("年级","grade"));
                 entity.add(new ExcelExportEntity("学校","school"));
                 entity.add(new ExcelExportEntity("绑定校区","league_name"));
+                entity.add(new ExcelExportEntity("作业日期","create_time"));
                 entity.add(new ExcelExportEntity("上传作业份数","pictureCount"));
                 entity.add(new ExcelExportEntity("语文作业份数","count1"));
                 entity.add(new ExcelExportEntity("数学作业份数","count2"));

+ 22 - 18
src/main/resources/mybatis/mapper/CuratorMapper.xml

@@ -371,7 +371,7 @@
         a.grade,
         a.league_name,
         a.school,
-        count( 1 ) AS pictureCount,
+        count( if(a.id is not null,true,null) ) AS pictureCount,
         group_concat( a.file_key ) AS file_keys,
         a.create_time,
         a.`subject`,
@@ -391,30 +391,34 @@
         FROM
         (
         SELECT
-        t11.vip_id,
-        t.id,
+        t12.id as vip_id,
+        t11.id,
         t12.child_name,
         t12.grade,
         t13.league_name,
         t12.school,
-        t11.file_key,
-        DATE_FORMAT( t11.create_time, '%Y-%m-%d' ) AS create_time,
-        t.`subject`,
-        t11.corrected_picture_url
+        t11.`subject`,
+        t11.create_time,
+        t11.corrected_picture_url,
+        t11.file_key
         FROM
-        scon_homework t
-        LEFT JOIN scon_homework_picture t11 ON t.id = t11.homework_id
-        LEFT JOIN tb_lib_vip t12 ON t11.vip_id = t12.id
-        LEFT JOIN tb_lib_join t13 ON t12.lib_id = t13.id
-        WHERE
-        t12.lib_id = #{libId}
-        AND t11.is_delete = 0
+        tb_lib_vip t12
+        left join
+        (
+            SELECT 	DATE_FORMAT( t11.create_time, '%Y-%m-%d' ) AS create_time,	t11.corrected_picture_url,	t11.file_key,t.id,t11.vip_id,t.`subject`
+            from 	 scon_homework_picture t11
+            LEFT JOIN scon_homework t ON t.id = t11.homework_id
+            where 	 t11.is_delete = 0
         <if test="queryDate !=null and queryDate!=''">
-        AND to_days(t11.create_time) >= TO_DAYS(#{queryDate})
+            AND to_days(t11.create_time) >= TO_DAYS(#{queryDate})
         </if>
         <if test="queryEndDate !=null and queryEndDate!=''">
-        AND to_days(  #{queryEndDate} ) >= to_days( t11.create_time )
+            AND to_days(  #{queryEndDate} ) >= to_days( t11.create_time )
         </if>
+        )t11 on t12.id = t11.vip_id
+        LEFT JOIN tb_lib_join t13 ON t12.lib_id = t13.id
+        WHERE
+        t12.lib_id = #{libId}
         <if test="searchValue != '' ">
             and t12.child_name regexp #{searchValue}
         </if>
@@ -424,8 +428,8 @@
         a.vip_id
         ORDER BY
         a.vip_id,
-        a.SUBJECT,
-        a.create_time DESC
+        a.create_time DESC,
+        a.SUBJECT
     </select>
 
     <select id="findPageStudentList" resultType="java.util.Map">