Browse Source

add 获取进行中乐团的乐团主管

周箭河 4 years ago
parent
commit
7796ba8e85

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherVisitDto.java

@@ -1,9 +1,11 @@
 package com.ym.mec.biz.dal.dto;
 
 /**
- * 老师访
+ * 老师访数
  */
 public class TeacherVisitDto {
+    private Integer organId;
+
     private Integer teacherId;
 
     private String month;
@@ -33,4 +35,12 @@ public class TeacherVisitDto {
     public void setMonth(String month) {
         this.month = month;
     }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
 }

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemServiceImpl.java

@@ -54,6 +54,7 @@ public class InspectionItemServiceImpl extends BaseServiceImpl<Long, InspectionI
                 if (row.getItem().equals(InspectionItemEnum.INSPECT)) continue;
                 for (TeacherVisitDto teacherVisitCount : teacherVisitCounts) {
                     if (teacherVisitCount.getTeacherId().equals(row.getUserId()) &&
+                            teacherVisitCount.getOrganId().equals(row.getOrganId()) &&
                             DateUtil.dateToString(row.getMonth(), "yyyy-MM").equals(teacherVisitCount.getMonth())
                     ) {
                         row.setSubmittedTimes(teacherVisitCount.getNum());

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/InspectionItemMapper.xml

@@ -153,7 +153,7 @@
         LEFT JOIN organization o ON o.id_=ii.organ_id_
         LEFT JOIN sys_user su ON su.id_ = ii.user_id_
         <include refid="queryPageSql"/>
-        ORDER BY ii.id_
+        ORDER BY i.month_ DESC ,ii.id_ DESC
         <include refid="global.limit"/>
     </select>
 

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/InspectionMapper.xml

@@ -73,7 +73,7 @@
         LEFT JOIN organization o ON o.id_=i.organ_id_
         LEFT JOIN sys_user su ON su.id_ = i.user_id_
         <include refid="queryPageSql"/>
-        ORDER BY i.id_
+            ORDER BY i.month_ DESC, i.id_ DESC
         <include refid="global.limit"/>
     </select>
 

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/StudentVisitMapper.xml

@@ -182,7 +182,7 @@
         </foreach>
     </select>
     <select id="getTeacherVisitCount" resultType="com.ym.mec.biz.dal.dto.TeacherVisitDto">
-        SELECT teacher_id_ teacherId,date_format(visit_time_, '%Y-%m') month, COUNT(*) num
+        SELECT organ_id_ organId, teacher_id_ teacherId,date_format(visit_time_, '%Y-%m') month, COUNT(*) num
         FROM student_visit
         WHERE teacher_id_ IN
         <foreach collection="teacherIds" item="teacherId" open="(" close=")" separator=",">
@@ -191,6 +191,6 @@
         AND visit_time_ >= #{startTime}
         <![CDATA[AND visit_time_ <= #{endTime}
         ]]>
-        GROUP BY teacher_id_,date_format(visit_time_, '%Y-%m')
+        GROUP BY organ_id_, teacher_id_,date_format(visit_time_, '%Y-%m')
     </select>
 </mapper>