From f0cbe681cb28df22952fb8a6420424a7385ac9db Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期五, 10 五月 2024 09:30:25 +0800 Subject: [PATCH] 练习删除 --- src/main/resources/mapper/QuestionSubjectMapper.xml | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/src/main/resources/mapper/QuestionSubjectMapper.xml b/src/main/resources/mapper/QuestionSubjectMapper.xml index bd5e907..24ef74e 100644 --- a/src/main/resources/mapper/QuestionSubjectMapper.xml +++ b/src/main/resources/mapper/QuestionSubjectMapper.xml @@ -48,4 +48,20 @@ where subject_id = #{subjectId} </delete> -</mapper> \ No newline at end of file + <select id="getSubject" resultMap="BaseResultMap"> + select qs.*,s.name as subName + from t_question_subject qs + left join t_subject s on qs.subject_id = s.id + where subject_id = #{id} and qs.deleted = 0 and s.deleted = 0 + </select> + + <select id="countQuestionNum" resultType="integer"> + SELECT + count(distinct id) + FROM + t_question_subject + WHERE + subject_id IN <foreach collection="subjects" open="(" separator="," close=")" item="subjectId">#{subjectId}</foreach> + </select> + +</mapper> -- Gitblit v1.8.0