Browse Source

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

Joburgess 3 years ago
parent
commit
27cf4607a9
1 changed files with 11 additions and 18 deletions
  1. 11 18
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

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

@@ -804,16 +804,8 @@
         FROM ((SELECT sr.user_id_
                FROM student_registration sr
                     LEFT JOIN music_group mg ON sr.music_group_id_=mg.id_
-                        LEFT JOIN sys_user su ON sr.user_id_=su.id_
-               WHERE su.del_flag_=0
-                AND mg.status_='PROGRESS'
-                 AND sr.music_group_status_='NORMAL'
-                <if test="organIds!=null and organIds.size()>0">
-                    AND su.organ_id_ IN
-                    <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
-                        #{organId}
-                    </foreach>
-                </if>)
+               WHERE mg.status_='PROGRESS'
+                AND sr.music_group_status_='NORMAL')
               UNION ALL
               (SELECT
                    cssp.user_id_
@@ -823,14 +815,15 @@
                        LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
                WHERE
                    cssp.group_type_ IN ('VIP', 'PRACTICE')
-                 AND cs.status_='NOT_START'
-                 AND su.del_flag_ = 0
-                <if test="organIds!=null and organIds.size()>0">
-                    AND su.organ_id_ IN
-                    <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
-                        #{organId}
-                    </foreach>
-                </if>)) t
+                 AND cs.status_='NOT_START')) t
+        LEFT JOIN sys_user su ON t.user_id_=su.id_
+        WHERE su.del_flag_=0
+        <if test="organIds!=null and organIds.size()>0">
+            AND su.organ_id_ IN
+            <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+                #{organId}
+            </foreach>
+        </if>
     </select>
 
     <select id="getOrgansStudentNum" resultType="map">