|
@@ -1752,4 +1752,129 @@
|
|
|
) > 0
|
|
|
AND cgu.user_id = #{userId}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="listVideoUserPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
|
|
|
+ resultMap="ClassPeriodStudentVo">
|
|
|
+ SELECT
|
|
|
+ u.user_account,
|
|
|
+ u.user_id,
|
|
|
+ cgu.`status`,
|
|
|
+ u.realname,
|
|
|
+ og.goods_id,
|
|
|
+ u.id_card,
|
|
|
+ cgu.grade_id,
|
|
|
+ u.telphone,
|
|
|
+ u.one_inch_photos,
|
|
|
+ g.class_hours as class_hours,
|
|
|
+ g.study_start_time as study_start_time,
|
|
|
+ g.study_end_time as study_end_time,
|
|
|
+ g.goods_name,
|
|
|
+ g.code as goods_code,
|
|
|
+ g.stand_price,
|
|
|
+ cgu.period_status,
|
|
|
+ cg.class_start_time,
|
|
|
+ cg.class_end_time,
|
|
|
+ cg.class_name,
|
|
|
+ cgu.period_plush,
|
|
|
+ cgu.period_status_num,
|
|
|
+ cgu.period_time,
|
|
|
+ cgu.order_goods_id,
|
|
|
+ IFNULL(ge.exam_num,0) as exam_num,
|
|
|
+ cgu.period_wait_time as end_time,
|
|
|
+ (SELECT og.seven_year FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as seven_year,
|
|
|
+ (SELECT og.service_start_time FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as service_start_time,
|
|
|
+ (SELECT og.service_end_time FROM order_goods og where og.order_goods_id = cgu.order_goods_id ) as service_end_time,
|
|
|
+ (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr where ubr.`status`=1 and ubr.`type` in (1,3) and ubr.report_status=1 and ubr.order_goods_id = cgu.order_goods_id and ubr.grade_id = cgu.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num
|
|
|
+ FROM
|
|
|
+ class_grade_user cgu
|
|
|
+ LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
|
|
|
+ LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
|
|
|
+ LEFT JOIN `user` u ON u.user_id = cgu.user_id
|
|
|
+ LEFT JOIN goods g on og.goods_id = g.goods_id
|
|
|
+ LEFT JOIN course_business cb ON g.business_id = cb.id
|
|
|
+ LEFT JOIN (SELECT
|
|
|
+ COUNT( m.id ) AS exam_num,
|
|
|
+ c.goods_id
|
|
|
+ FROM
|
|
|
+ course_menu_exam m
|
|
|
+ LEFT JOIN goods_course c ON m.course_id = c.course_id
|
|
|
+ where
|
|
|
+ m.type in (1,3)
|
|
|
+ GROUP BY c.goods_id ) ge on og.goods_id = ge.goods_id
|
|
|
+ where 1=1
|
|
|
+ and cgu.`status` =1
|
|
|
+ <if test="periodPlush != null and periodPlush != ''">
|
|
|
+ AND cgu.period_plush = #{periodPlush}
|
|
|
+ </if>
|
|
|
+ <if test="officialStatus != null and officialStatus != ''">
|
|
|
+ AND cgu.official_status = #{officialStatus}
|
|
|
+ </if>
|
|
|
+ <if test="changeGrade != null and changeGrade != ''">
|
|
|
+ AND cgu.change_grade = #{changeGrade}
|
|
|
+ </if>
|
|
|
+ <if test="profileStatus != null and profileStatus != ''">
|
|
|
+ AND up.status = #{profileStatus}
|
|
|
+ </if>
|
|
|
+ <if test="gradeId != null and gradeId !='' ">
|
|
|
+ and cgu.grade_id = #{gradeId}
|
|
|
+ </if>
|
|
|
+ <if test="businessId != null and businessId != ''">
|
|
|
+ AND g.business_id = #{businessId}
|
|
|
+ </if>
|
|
|
+ <if test="projectId != null and projectId != ''">
|
|
|
+ AND g.project_id = #{projectId}
|
|
|
+ </if>
|
|
|
+ <if test="educationTypeId != null and educationTypeId != ''">
|
|
|
+ AND g.education_type_id = #{educationTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="schoolId != null and schoolId != ''">
|
|
|
+ AND g.school_id = #{schoolId}
|
|
|
+ </if>
|
|
|
+ <if test="majorId != null and majorId != ''">
|
|
|
+ AND g.major_id = #{majorId}
|
|
|
+ </if>
|
|
|
+ <if test="periodStatus != null ">
|
|
|
+ and cgu.period_status = #{periodStatus}
|
|
|
+ </if>
|
|
|
+ <if test="classStartTime != null and classStartTime != '' ">
|
|
|
+ AND cg.class_start_time >= #{classStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="classEndTime != null and classEndTime != '' ">
|
|
|
+ AND #{classEndTime} >= cg.class_end_time
|
|
|
+ </if>
|
|
|
+ <if test="studyStatus != null and studyStatus == 1 ">
|
|
|
+ and cgu.period_status = -1
|
|
|
+ </if>
|
|
|
+ <if test="studyStatus != null and studyStatus == 2 ">
|
|
|
+ and cgu.period_status != -1
|
|
|
+ </if>
|
|
|
+ <if test="className != null and className !='' ">
|
|
|
+ and cg.class_name like concat('%', #{className}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="searchKey != null and searchKey != '' ">
|
|
|
+ and (u.realname like concat('%', #{searchKey}, '%')
|
|
|
+ or u.id_card like concat('%', #{searchKey,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%')
|
|
|
+ or g.goods_name like concat('%', #{searchKey}, '%')
|
|
|
+ or cg.class_name like concat('%', #{searchKey}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="idCard != null and idCard !='' ">
|
|
|
+ AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
|
|
|
+ </if>
|
|
|
+ <if test="telphone != null and telphone !='' ">
|
|
|
+ AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
|
|
|
+ </if>
|
|
|
+ <if test="searchStartTime != null and searchStartTime !='' ">
|
|
|
+ AND cgu.create_time >=#{searchStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="searchEndTime != null and searchEndTime !='' ">
|
|
|
+ AND #{searchEndTime} >= cgu.create_time
|
|
|
+ </if>
|
|
|
+ <if test="periodStartTime != null and periodStartTime !='' ">
|
|
|
+ AND cgu.period_time >=#{periodStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="periodEndTime != null and periodEndTime !='' ">
|
|
|
+ AND #{periodEndTime} >= cgu.period_time
|
|
|
+ </if>
|
|
|
+ order by cgu.create_time desc
|
|
|
+ </select>
|
|
|
</mapper>
|