From 47cd9ecc0eff38ffe6b3b794b2bf197e958f4403 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 14 五月 2025 15:50:57 +0800
Subject: [PATCH] bug:学员有状态不能修改问题
---
src/main/resources/mapper/ExamPaperQuestionCustomerAnswerMapper.xml | 49 +++++++++++++++++++++++++++++++++++++++----------
1 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/src/main/resources/mapper/ExamPaperQuestionCustomerAnswerMapper.xml b/src/main/resources/mapper/ExamPaperQuestionCustomerAnswerMapper.xml
index 6dd0465..6eb21eb 100644
--- a/src/main/resources/mapper/ExamPaperQuestionCustomerAnswerMapper.xml
+++ b/src/main/resources/mapper/ExamPaperQuestionCustomerAnswerMapper.xml
@@ -228,14 +228,23 @@
</select>
- <select id="studentPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentRequestVM">
- SELECT
- <include refid="Base_Column_List"/>
- FROM t_exam_paper_question_customer_answer
- <where>
- and do_right=FALSE
- and create_user=#{createUser}
- </where>
+ <select id="studentPage" resultType="com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentResponseVM" parameterType="com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentRequestVM">
+ select a.id,
+ a.question_type,
+ JSON_VALUE(d.content, '$.titleContent') as shortTitle,
+ GROUP_CONCAT(DISTINCT c.name) as subjectName,
+ a.create_time
+ from t_exam_paper_question_customer_answer a
+ inner join t_question_subject b on a.question_id = b.question_id and b.deleted = 0
+ inner join t_subject c on b.subject_id = c.id and c.deleted = 0
+ inner join t_text_content d on a.question_text_content_id = d.id
+ where
+ a.do_right = FALSE
+ and a.create_user = #{createUser}
+ and JSON_VALUE(d.content, '$.titleContent') like concat('%', #{shortTitle}, '%')
+ group by a.question_id, question_type
+ HAVING GROUP_CONCAT(c.name) like concat('%', #{subjectName}, '%')
+ order by a.question_id desc
</select>
@@ -258,14 +267,34 @@
<select id="selectAllCount" resultType="java.lang.Integer">
- SELECT count(*) from t_exam_paper_question_customer_answer
+ SELECT count(*) from t_exam_paper_question_customer_answer a
+ inner join
+ (select user_id from t_user_department
+ <if test="deptIds != null and deptIds.size() > 0">
+ where department_id in
+ <foreach collection="deptIds" item="item" open="(" separator="," close=")">
+ #{item}
+ </foreach>
+ </if>
+ group by user_id)
+ b on a.create_user = b.user_id
</select>
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
SELECT create_time as name,COUNT(create_time) as value from
(
- SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper_question_customer_answer
+ SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper_question_customer_answer a
+ inner join
+ (select user_id from t_user_department
+ <if test="deptIds != null and deptIds.size() > 0">
+ where department_id in
+ <foreach collection="deptIds" item="item" open="(" separator="," close=")">
+ #{item}
+ </foreach>
+ </if>
+ group by user_id)
+ b on a.create_user = b.user_id
WHERE create_time between #{startTime} and #{endTime}
) a
GROUP BY create_time
--
Gitblit v1.8.0