From 6d05f0dc6e96ead24bb7e035e16f18031b1ede78 Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期五, 17 五月 2024 11:35:26 +0800 Subject: [PATCH] feat:看题新增查询条件 --- src/main/resources/mapper/ExamPaperQuestionCustomerAnswerMapper.xml | 25 +++++++++++++++++-------- 1 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/main/resources/mapper/ExamPaperQuestionCustomerAnswerMapper.xml b/src/main/resources/mapper/ExamPaperQuestionCustomerAnswerMapper.xml index 4552fb3..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> -- Gitblit v1.8.0