|
@@ -766,14 +766,39 @@
|
|
|
<if test="status.name == 'TRUANT'"> or sa.id_ is null </if>
|
|
|
)
|
|
|
</select>
|
|
|
- <select id="countStudentLeave"
|
|
|
+ <select id="queryStudentLeave"
|
|
|
resultType="com.ym.mec.biz.dal.dto.CourseHomeworkWrapper$StudentLeaveResult">
|
|
|
- select cs.class_date_ classDate,cs.start_class_time_ startClassTime,cs.end_class_time_ endClassTime,cg.name_ classGroupName,cs.type_ courseScheduleType,sa.remark_ remark,su.username_ username from student_attendance sa
|
|
|
+ select cs.class_date_ classDate,cs.start_class_time_ startClassTime,cs.end_class_time_ endClassTime,
|
|
|
+ cg.name_ classGroupName,cs.type_ courseScheduleType,sa.remark_ remark,su.username_ username from student_attendance sa
|
|
|
left join course_schedule cs ON cs.id_ = sa.course_schedule_id_
|
|
|
left join class_group cg ON cg.id_ = cs.class_group_id_
|
|
|
left join sys_user su ON su.id_ = sa.user_id_
|
|
|
- where sa.status_ = 'LEAVE'
|
|
|
- AND sa.class_group_id_ = 1 AND sa.course_schedule_id_ = 1 AND cs.class_date_ = ''
|
|
|
- AND (sa.user_id_ = 1 OR su.phone_ LIKE CONCAT('%',,'%') OR su.username_ LIKE CONCAT('%',,'%'))
|
|
|
+ <include refid="queryStudentLeaveCondition"/>
|
|
|
</select>
|
|
|
+ <select id="countStudentLeave" resultType="java.lang.Integer">
|
|
|
+ select COUNT(sa.id_) from student_attendance sa
|
|
|
+ left join course_schedule cs ON cs.id_ = sa.course_schedule_id_
|
|
|
+ left join sys_user su ON su.id_ = sa.user_id_
|
|
|
+ <include refid="queryStudentLeaveCondition"/>
|
|
|
+ </select>
|
|
|
+ <sql id="queryStudentLeaveCondition">
|
|
|
+ <where>
|
|
|
+ sa.status_ = 'LEAVE'
|
|
|
+ <if test="classGroupId != null">
|
|
|
+ AND sa.class_group_id_ = #{classGroupId}
|
|
|
+ </if>
|
|
|
+ <if test="courseScheduleId != null">
|
|
|
+ AND sa.course_schedule_id_ = #{courseScheduleId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ AND cs.class_date_ BETWEEN #{startTime} AND #{endTime}
|
|
|
+ </if>
|
|
|
+ <if test="musicGroupIds != null and musicGroupIds != ''">
|
|
|
+ AND FIND_IN_SET(cs.music_group_id_,#{musicGroupIds})
|
|
|
+ </if>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND (sa.user_id_ = #{search} OR su.phone_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
</mapper>
|