|
@@ -492,7 +492,7 @@
|
|
|
<if test="userId != null and userId != ''">
|
|
|
,
|
|
|
(SELECT exam_status from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_exam_status,
|
|
|
- (SELECT performance from user_subscribe where user_id = #{userId}and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_performance,
|
|
|
+ (SELECT performance from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_performance,
|
|
|
(SELECT `result` from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_result,
|
|
|
(SELECT subscribe_id from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as subscribe_id,
|
|
|
(SELECT apply_site_start_time from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_apply_site_start_time,
|
|
@@ -568,8 +568,13 @@
|
|
|
</select>
|
|
|
<select id="gradeIdSelect" parameterType="map" resultMap="ClassGradeVoResult" >
|
|
|
SELECT
|
|
|
-
|
|
|
- IFNULL(ge.exam_num,0) as exam_num,
|
|
|
+ (SELECT
|
|
|
+ COUNT( m.id )
|
|
|
+ FROM
|
|
|
+ goods_course c LEFT JOIN course_menu_exam m ON m.course_id = c.course_id
|
|
|
+ where
|
|
|
+ m.type = 1
|
|
|
+ and c.goods_id = #{goodsId}) as exam_num,
|
|
|
(SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id
|
|
|
= ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.grade_id = cg.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
|
|
|
cgu.grade_id,
|
|
@@ -591,15 +596,6 @@
|
|
|
class_grade_user cgu
|
|
|
LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
|
|
|
LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_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 = 1
|
|
|
- GROUP BY c.goods_id ) ge on #{goodsId} = ge.goods_id
|
|
|
WHERE
|
|
|
1=1
|
|
|
<if test="gradeId != null and gradeId != ''">
|