Selaa lähdekoodia

体验人数,直接查student表

周箭河 5 vuotta sitten
vanhempi
commit
3d644b3655

+ 12 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -14,14 +14,16 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
 
 
     List<SysUser> findStudents(Map<String, Object> params);
+
     int countStudents(Map<String, Object> params);
-    
+
     List<Student> queryByOperatingTag(Integer operatingTag);
-    
+
     int batchUpdate(@Param("studentList") List<Student> studentList);
 
     /**
      * 查询运营学生列表
+     *
      * @param params
      * @return
      */
@@ -29,8 +31,16 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
 
     /**
      * 查询运营学生总数
+     *
      * @param params
      * @return
      */
     Integer countOperatingStudents(Map<String, Object> params);
+
+    /**
+     * 批量获取老师体验学生数
+     * @param teacherIds
+     * @return
+     */
+    List<Student4operating> getTeacherOperatingStudentsNum(@Param("teacherIds") String teacherIds);
 }

+ 130 - 122
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/Student4operating.java

@@ -4,137 +4,145 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
 
 public class Student4operating {
 
-private String organName;
-private String organId;
-private String studentName;
-private Integer studentId;
-private String teacherId;
-private String teacherName;
-private Integer operatingTag;
-private Integer vipTimes;
-private Integer freePracticeTimes;
-private Integer buyPracticeTimes;
-
-private String operatingTagStr;
-private String vipTimesStr;
-private String freePracticeTimesStr;
-private String buyPracticeTimesStr;
-
-
-	public String getOrganName() {
-		return organName;
-	}
-
-	public void setOrganName(String organName) {
-		this.organName = organName;
-	}
-
-	public String getOrganId() {
-		return organId;
-	}
-
-	public void setOrganId(String organId) {
-		this.organId = organId;
-	}
-
-	public String getStudentName() {
-		return studentName;
-	}
-
-	public void setStudentName(String studentName) {
-		this.studentName = studentName;
-	}
-
-	public Integer getStudentId() {
-		return studentId;
-	}
-
-	public void setStudentId(Integer studentId) {
-		this.studentId = studentId;
-	}
-
-	public String getTeacherId() {
-		return teacherId;
-	}
-
-	public void setTeacherId(String teacherId) {
-		this.teacherId = teacherId;
-	}
-
-	public String getTeacherName() {
-		return teacherName;
-	}
-
-	public void setTeacherName(String teacherName) {
-		this.teacherName = teacherName;
-	}
+    private String organName;
+    private String organId;
+    private String studentName;
+    private Integer studentId;
+    private String teacherId;
+    private String teacherName;
+    private Integer operatingTag;
+    private Integer vipTimes;
+    private Integer freePracticeTimes;
+    private Integer buyPracticeTimes;
+
+    private String operatingTagStr;
+    private String vipTimesStr;
+    private String freePracticeTimesStr;
+    private String buyPracticeTimesStr;
+    private Integer studentNum;
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public String getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(String organId) {
+        this.organId = organId;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(String teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public Integer getOperatingTag() {
+        return operatingTag;
+    }
+
+    public void setOperatingTag(Integer operatingTag) {
+        this.operatingTag = operatingTag;
+    }
+
+    public Integer getVipTimes() {
+        return vipTimes;
+    }
+
+    public void setVipTimes(Integer vipTimes) {
+        this.vipTimes = vipTimes;
+    }
+
+    public Integer getFreePracticeTimes() {
+        return freePracticeTimes;
+    }
+
+    public void setFreePracticeTimes(Integer freePracticeTimes) {
+        this.freePracticeTimes = freePracticeTimes;
+    }
+
+    public Integer getBuyPracticeTimes() {
+        return buyPracticeTimes;
+    }
+
+    public void setBuyPracticeTimes(Integer buyPracticeTimes) {
+        this.buyPracticeTimes = buyPracticeTimes;
+    }
+
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    public String getOperatingTagStr() {
+        return operatingTagStr;
+    }
 
-	public Integer getOperatingTag() {
-		return operatingTag;
-	}
-
-	public void setOperatingTag(Integer operatingTag) {
-		this.operatingTag = operatingTag;
-	}
-
-	public Integer getVipTimes() {
-		return vipTimes;
-	}
-
-	public void setVipTimes(Integer vipTimes) {
-		this.vipTimes = vipTimes;
-	}
+    public void setOperatingTagStr(String operatingTagStr) {
+        this.operatingTagStr = operatingTagStr;
+    }
 
-	public Integer getFreePracticeTimes() {
-		return freePracticeTimes;
-	}
+    public String getVipTimesStr() {
+        return vipTimesStr;
+    }
 
-	public void setFreePracticeTimes(Integer freePracticeTimes) {
-		this.freePracticeTimes = freePracticeTimes;
-	}
+    public void setVipTimesStr(String vipTimesStr) {
+        this.vipTimesStr = vipTimesStr;
+    }
 
-	public Integer getBuyPracticeTimes() {
-		return buyPracticeTimes;
-	}
+    public String getFreePracticeTimesStr() {
+        return freePracticeTimesStr;
+    }
 
-	public void setBuyPracticeTimes(Integer buyPracticeTimes) {
-		this.buyPracticeTimes = buyPracticeTimes;
-	}
+    public void setFreePracticeTimesStr(String freePracticeTimesStr) {
+        this.freePracticeTimesStr = freePracticeTimesStr;
+    }
 
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this);
-	}
+    public String getBuyPracticeTimesStr() {
+        return buyPracticeTimesStr;
+    }
 
-	public String getOperatingTagStr() {
-		return operatingTagStr;
-	}
-
-	public void setOperatingTagStr(String operatingTagStr) {
-		this.operatingTagStr = operatingTagStr;
-	}
-
-	public String getVipTimesStr() {
-		return vipTimesStr;
-	}
-
-	public void setVipTimesStr(String vipTimesStr) {
-		this.vipTimesStr = vipTimesStr;
-	}
-
-	public String getFreePracticeTimesStr() {
-		return freePracticeTimesStr;
-	}
-
-	public void setFreePracticeTimesStr(String freePracticeTimesStr) {
-		this.freePracticeTimesStr = freePracticeTimesStr;
-	}
+    public void setBuyPracticeTimesStr(String buyPracticeTimesStr) {
+        this.buyPracticeTimesStr = buyPracticeTimesStr;
+    }
 
-	public String getBuyPracticeTimesStr() {
-		return buyPracticeTimesStr;
+	public Integer getStudentNum() {
+		return studentNum;
 	}
 
-	public void setBuyPracticeTimesStr(String buyPracticeTimesStr) {
-		this.buyPracticeTimesStr = buyPracticeTimesStr;
+	public void setStudentNum(Integer studentNum) {
+		this.studentNum = studentNum;
 	}
 }

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -145,6 +145,7 @@
 		<result column="vip_times_" property="vipTimes"/>
 		<result column="free_practice_times_" property="freePracticeTimes"/>
 		<result column="buy_practice_times_" property="buyPracticeTimes"/>
+		<result column="student_num_" property="studentNum"/>
 	</resultMap>
 
 	<select id="getOperatingStudents" resultMap="student4operating">
@@ -211,6 +212,7 @@
 
 	<sql id="student4OperatingQueryCondition">
 		<where>
+			su.user_type_ LIKE '%STUDENT%' AND su.del_flag_ = 0
 			<if test="search != null and search != ''">
 				AND (su.phone_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.id_ LIKE CONCAT('%',#{search},'%'))
 			</if>
@@ -243,4 +245,8 @@
 			</if>
 		</where>
 	</sql>
+
+	<select id="getTeacherOperatingStudentsNum" resultMap="student4operating">
+		select teacher_id_, count(*) student_num_ FROM student WHERE FIND_IN_SET(teacher_id_, #{teacherIds}) GROUP BY teacher_id_
+	</select>
 </mapper>