| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.ym.mec.biz.dal.mapper.CoursePatrolEvaluationMapper">
-
- <select id="selectPage" resultType="com.ym.mec.biz.dal.wrapper.CoursePatrolEvaluationWrapper$CoursePatrolEvaluationInfo">
- SELECT t.id_
- , mg.organ_id_ as organId
- , mg.cooperation_organ_id_ as cooperationOrganId
- , cs.id_ as courseScheduleId
- , cs.type_ as courseType
- , cs.name_ as courseName
- , cs.class_date_ as courseDate
- , cs.start_class_time_ as startClassTime
- , cs.end_class_time_ as endClassTime
- , cs.status_ as courseStatus
- , cs.actual_teacher_id_ as teacherId
- , t.user_id_ as userId
- , t.evaluate_status_ as evaluateStatus
- , t.problem_type_ as problemType
- , t.problem_desc_ as problemDesc
- , t.handle_status_ as handleStatus
- , t.suggestion_ as suggestion
- , t.attachment_url_ as attachmentUrl
- FROM course_schedule cs
- left join course_patrol_evaluation t on cs.id_ = t.course_schedule_id_
- left join music_group mg on mg.id_ = cs.music_group_id_
- <if test="param.keyword != null and param.keyword != ''">
- left join sys_user su on cs.actual_teacher_id_ = su.id_
- </if>
- <where>
- <if test="param.patrolFlag != null and param.patrolFlag">
- and t.id_ is not null
- </if>
- <if test="param.keyword != null and param.keyword != ''">
- and (su.real_name_ like concat('%', #{param.keyword}, '%')
- or su.id_ like concat('%', #{param.keyword}, '%')
- or su.phone_ like concat('%', #{param.keyword}, '%'))
- </if>
- <if test="param.startTime != null">
- and cs.class_date_ >= date_format(#{param.startTime}, '%Y-%m-%d')
- </if>
- <if test="param.endTime != null">
- and cs.class_date_ <= date_format(#{param.endTime}, '%Y-%m-%d')
- </if>
- <if test="param.organId != null and param.organId != ''">
- and find_in_set(mg.organ_id_, #{param.organId})
- </if>
- <if test="param.cooperationOrganId != null">
- and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
- </if>
- <if test="param.courseType != null">
- and cs.type_ = #{param.courseType}
- </if>
- <if test="param.evaluateStatus != null">
- and t.evaluate_status_ = #{param.evaluateStatus}
- </if>
- <if test="param.problemType != null">
- and find_in_set(#{param.problemType}, t.problem_type_)
- </if>
- <if test="param.handleStatus != null">
- and t.handle_status_ = #{param.handleStatus}
- </if>
- <if test="param.evaluateFlag != null">
- <if test="param.evaluateFlag">
- and t.evaluate_status_ is not null
- </if>
- <if test="param.evaluateFlag == false">
- and t.evaluate_status_ is null
- </if>
- </if>
- <if test="param.id != null">
- and t.id_ = #{param.id}
- </if>
- <if test="param.status != null">
- and cs.status_ = #{param.status}
- </if>
- </where>
- order by cs.start_class_time_, cs.id_
- </select>
- <select id="pageStat"
- resultType="com.ym.mec.biz.dal.wrapper.CoursePatrolEvaluationWrapper$CoursePatrolEvaluationStat">
- select
- cs.class_date_ as `date`
- ,count(distinct cs.id_) as `totalCount`
- ,sum( if(cs.type_ = 'SINGLE',1,0)) as singleCourseCount
- ,sum( if(cs.type_ = 'MIX',1,0)) as minCourseCount
- ,sum( if(cpe.id_ is not null,1,0)) as patrolCount
- from
- course_schedule cs
- left join music_group mg on mg.id_ = cs.music_group_id_
- left join course_patrol_evaluation cpe on cpe.course_schedule_id_ = cs.id_
- <where>
- cs.teach_mode_ = 'OFFLINE'
- <if test="param.startTime != null">
- and cs.class_date_ >= date_format(#{param.startTime},'%Y-%m-%d')
- </if>
- <if test="param.endTime != null">
- and cs.class_date_ <= date_format(#{param.endTime},'%Y-%m-%d')
- </if>
- <if test="param.cooperationOrganId != null">
- and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
- </if>
- </where>
- group by cs.class_date_
- order by cs.class_date_
- </select>
- </mapper>
|