|
|
@@ -226,13 +226,20 @@
|
|
|
JOIN mysql.help_topic t2 ON t2.help_topic_id <( length( mru.user_ids ) - length( REPLACE ( mru.user_ids, ',', '' )) + 1 )
|
|
|
RIGHT JOIN (
|
|
|
SELECT
|
|
|
- substring_index( substring_index( m.sub_ids, ',', t2.help_topic_id + 1 ), ',',- 1 ) subId,
|
|
|
+-- substring_index( substring_index( m.sub_ids, ',', t2.help_topic_id + 1 ), ',',- 1 ) subId,
|
|
|
+ s.id as subId,
|
|
|
m.id
|
|
|
FROM
|
|
|
lab_grade_manage m
|
|
|
- JOIN mysql.help_topic t2 ON t2.help_topic_id <( length( m.sub_ids ) - length( REPLACE ( m.sub_ids, ',', '' )) + 1 )
|
|
|
+-- JOIN mysql.help_topic t2 ON t2.help_topic_id <( length( m.sub_ids ) - length( REPLACE ( m.sub_ids, ',', '' )) + 1 )
|
|
|
+ LEFT JOIN lab_subject s on m.dept_id = s.dept_id and (
|
|
|
+
|
|
|
+ (m.level = s.level or m.`level` is null)
|
|
|
+ and (m.type_id = s.type_id or m.type_id is null)
|
|
|
+ and (m.mold_id = s.mold_id or m.mold_id is null)
|
|
|
+ )
|
|
|
WHERE
|
|
|
- find_in_set( #{subId}, m.sub_ids )
|
|
|
+ s.id = #{subId}
|
|
|
) m ON mru.grade_manage_id = m.id
|
|
|
WHERE
|
|
|
(mru.cycle = "一天"
|