فهرست منبع

feat:教务端学员云教练数据统计

Joburgess 3 سال پیش
والد
کامیت
8bd51c4fa0

+ 10 - 12
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentQueryInfo.java

@@ -21,11 +21,9 @@ public class StudentQueryInfo extends QueryInfo {
 
     private List<String> organIdList;
 
-    @ApiModelProperty("排序字段:cloudStudyUseTime(总时长),cloudStudyRunningDays(连续天数)")
-    private String orderField = "cloudStudyUseTime";
+    private String cloudStudyUseTime;
 
-    @ApiModelProperty("排序方式:ASC(正序),DESC(倒序)")
-    private String orderType = "ASC";
+    private String cloudStudyRunningDays;
 
     public String getGroupType() {
         return groupType;
@@ -67,19 +65,19 @@ public class StudentQueryInfo extends QueryInfo {
         this.organIdList = organIdList;
     }
 
-    public String getOrderField() {
-        return orderField;
+    public String getCloudStudyUseTime() {
+        return cloudStudyUseTime;
     }
 
-    public void setOrderField(String orderField) {
-        this.orderField = orderField;
+    public void setCloudStudyUseTime(String cloudStudyUseTime) {
+        this.cloudStudyUseTime = cloudStudyUseTime;
     }
 
-    public String getOrderType() {
-        return orderType;
+    public String getCloudStudyRunningDays() {
+        return cloudStudyRunningDays;
     }
 
-    public void setOrderType(String orderType) {
-        this.orderType = orderType;
+    public void setCloudStudyRunningDays(String cloudStudyRunningDays) {
+        this.cloudStudyRunningDays = cloudStudyRunningDays;
     }
 }

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

@@ -824,7 +824,17 @@
             LEFT JOIN sys_music_compare_record smcr ON stu.user_id_ = smcr.user_id_
         <include refid="queryCloudStudyStudentDataCondition" />
         GROUP BY stu.user_id_
-        ORDER BY ${orderField} ${orderType}
+        <trim prefix="ORDER BY " suffixOverrides=",">
+            <if test="cloudStudyUseTime==null and cloudStudyRunningDays==null">
+                stu.user_id_,
+            </if>
+            <if test="cloudStudyUseTime!=null">
+                cloudStudyUseTime ${cloudStudyUseTime},
+            </if>
+            <if test="cloudStudyRunningDays!=null">
+                cloudStudyRunningDays ${cloudStudyRunningDays}
+            </if>
+        </trim>
         <include refid="global.limit"></include>
     </select>
     <select id="countCloudStudyStudentData" resultType="int">