|
@@ -556,6 +556,8 @@
|
|
<result column="exercises_message_timely_num_" property="exercisesMessageTimelyNum" />
|
|
<result column="exercises_message_timely_num_" property="exercisesMessageTimelyNum" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<sql id="queryTeacherServeInfoCondition">
|
|
<sql id="queryTeacherServeInfoCondition">
|
|
<where>
|
|
<where>
|
|
sees.tenant_id_ = #{tenantId}
|
|
sees.tenant_id_ = #{tenantId}
|
|
@@ -805,4 +807,99 @@
|
|
WHERE sees.serve_type_ = #{serveType} AND cs.id_ != #{courseScheduleId} AND cs.music_group_id_ = #{musicGroupId}
|
|
WHERE sees.serve_type_ = #{serveType} AND cs.id_ != #{courseScheduleId} AND cs.music_group_id_ = #{musicGroupId}
|
|
AND sees.monday_ = #{month} AND sees.student_id_ = #{userId}
|
|
AND sees.monday_ = #{month} AND sees.student_id_ = #{userId}
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <resultMap id="StudentServeDto" type="com.ym.mec.biz.dal.dto.StudentServeDto">
|
|
|
|
+ <result column="student_id_" property="userId"/>
|
|
|
|
+ <result column="username_" property="username"/>
|
|
|
|
+ <result column="music_group_name_" property="musicGroupName"/>
|
|
|
|
+ <result column="organ_name_" property="organName"/>
|
|
|
|
+ <result column="serve_period_" property="servePeriod"/>
|
|
|
|
+ <result column="serve_num_" property="serveNum"/>
|
|
|
|
+ <result column="actual_exercises_num_" property="actualExercisesNum"/>
|
|
|
|
+ <result column="exercises_reply_num_" property="exercisesReplyNum"/>
|
|
|
|
+ <result column="exercises_message_num_" property="exercisesMessageNum"/>
|
|
|
|
+ <result column="sign_rate_" property="signRate"/>
|
|
|
|
+ <result column="pass_rate_" property="passRate"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <!-- 还差出勤率和达标率 -->
|
|
|
|
+ <select id="queryStudentServeInfo" resultMap="TeacherServeDto">
|
|
|
|
+ select
|
|
|
|
+ sees.student_id_,
|
|
|
|
+ sees.username_,
|
|
|
|
+ sees.organ_name_,
|
|
|
|
+ sees.serve_num_,
|
|
|
|
+ sees.actual_exercises_num_,
|
|
|
|
+ sees.exercises_reply_num_,
|
|
|
|
+ sees.exercises_message_num_,
|
|
|
|
+ a.sign_rate_,
|
|
|
|
+ a.pass_rate_,
|
|
|
|
+ b.music_group_name_,
|
|
|
|
+ concat(#{monday},'至', #{sunday}) as serve_period_
|
|
|
|
+ from (
|
|
|
|
+ select
|
|
|
|
+ sees.student_id_,
|
|
|
|
+ u.username_,
|
|
|
|
+ organ.name_ as organ_name_,
|
|
|
|
+ count(sees.id_) as serve_num_,
|
|
|
|
+ sum(sees.actual_exercises_num_) as actual_exercises_num_,
|
|
|
|
+ sum(sees.exercises_reply_num_) as exercises_reply_num_,
|
|
|
|
+ sum(sees.exercises_message_num_) as exercises_message_num_
|
|
|
|
+ from student_extracurricular_exercises_situation_ sees
|
|
|
|
+ left join sys_user u ON sees.student_id_ = u.id_
|
|
|
|
+ LEFT JOIN organization organ ON organ.id_=u.organ_id_ and organ.del_flag_ = 0
|
|
|
|
+ <where>
|
|
|
|
+ sees.tenant_id_ = #{tenantId}
|
|
|
|
+ <if test="monday != null and monday != ''">
|
|
|
|
+ AND DATE_FORMAT(sees.monday_, '%Y-%m-%d') >= #{monday}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sunday != null and sunday != ''">
|
|
|
|
+ AND DATE_FORMAT(sees.sunday_, '%Y-%m-%d') <= #{sunday}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="organIds != null and organIds.size()>0">
|
|
|
|
+ AND u.organ_id_ IN
|
|
|
|
+ <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
|
|
|
|
+ #{organId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ group by sees.student_id_
|
|
|
|
+ ) sees
|
|
|
|
+ left join (
|
|
|
|
+ select
|
|
|
|
+ sees.student_id_,
|
|
|
|
+ ifnull(sum(if(sa.status_ = 'NORMAL',1,0))/count(sa.id_),0) as sign_rate_,
|
|
|
|
+ ifnull(sum(sa.qualified_flag_)/count(sa.id_),0) as pass_rate_
|
|
|
|
+ from student_extracurricular_exercises_situation_ sees
|
|
|
|
+ left join sys_user u ON sees.student_id_ = u.id_
|
|
|
|
+ left join course_schedule cs on find_in_set(cs.id_,sees.course_ids_) and cs.del_flag_ = 0
|
|
|
|
+ left join music_group mg on cs.music_group_id_ = mg.id_
|
|
|
|
+ left join student_attendance sa on sees.student_id_ = sa.user_id_ and cs.id_ = sa.course_schedule_id_
|
|
|
|
+ <where>
|
|
|
|
+ sees.tenant_id_ = #{tenantId} and cs.id_ is not null
|
|
|
|
+ <if test="monday != null and monday != ''">
|
|
|
|
+ AND DATE_FORMAT(sees.monday_, '%Y-%m-%d') >= #{monday}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sunday != null and sunday != ''">
|
|
|
|
+ AND DATE_FORMAT(sees.sunday_, '%Y-%m-%d') <= #{sunday}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="organIds != null and organIds.size()>0">
|
|
|
|
+ AND u.organ_id_ IN
|
|
|
|
+ <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
|
|
|
|
+ #{organId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ group by sees.student_id_
|
|
|
|
+ ) a on sees.student_id_ = a.student_id_
|
|
|
|
+ left join (
|
|
|
|
+ select
|
|
|
|
+ user_id_,group_concat(distinct b.name_) as music_group_name_
|
|
|
|
+ from student_registration a
|
|
|
|
+ left join music_group b on a.music_group_id_ = b.id_
|
|
|
|
+ where payment_status_ = 1 and music_group_status_ = 'PROGRESS'
|
|
|
|
+ group by a.user_id_
|
|
|
|
+ ) b on sees.student_id_ = b.user_id_
|
|
|
|
+ </select>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|