|
|
@@ -61,7 +61,7 @@
|
|
|
LEFT JOIN base_student t2 ON (t2.user_id = t.student_user_id)
|
|
|
LEFT JOIN xjr_user t3 ON (t3.id = t.student_user_id)
|
|
|
WHERE t.delete_mark = 0
|
|
|
- and t.class_id = #{dto.classId} and t.textbook_id = #{dto.textbookId}
|
|
|
+ and t.class_id = #{dto.classId} and t.textbook_id = #{dto.textbookId} and
|
|
|
ORDER BY t.is_claim
|
|
|
</select>
|
|
|
|
|
|
@@ -73,17 +73,22 @@
|
|
|
t1.student_id as studentId
|
|
|
FROM xjr_user t
|
|
|
LEFT JOIN base_student t1 ON (t1.user_id = t.id)
|
|
|
- where t.id in (SELECT student_user_id
|
|
|
- FROM textbook_student_claim
|
|
|
+ where t.id in (SELECT distinct student_user_id
|
|
|
+ FROM textbook_student_claim t
|
|
|
WHERE delete_mark = 0
|
|
|
+ <if test="dto.claimStatus != null and dto.claimStatus == 3">
|
|
|
+ and (select count(*) from textbook_student_claim where is_claim = 1 and student_user_id = t.student_user_id) != (select count(*) from textbook_student_claim where student_user_id = t.student_user_id)
|
|
|
+ </if>
|
|
|
+ <if test="dto.claimStatus != null and dto.claimStatus == 2">
|
|
|
+ and (select count(*) from textbook_student_claim where is_claim = 1 and student_user_id = t.student_user_id) = (select count(*) from textbook_student_claim where student_user_id = t.student_user_id)
|
|
|
+ </if>
|
|
|
<if test="dto.classIdList != null and dto.classIdList.size() > 0">
|
|
|
and class_id in
|
|
|
<foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")"
|
|
|
separator=",">
|
|
|
#{classId}
|
|
|
</foreach>
|
|
|
- </if>
|
|
|
- GROUP BY student_user_id)
|
|
|
+ </if>)
|
|
|
<if test="dto.studentUserId != null and dto.studentUserId != 0 and dto.studentUserId != ''">
|
|
|
and t.id = #{dto.studentUserId}
|
|
|
</if>
|