qirong
2023-07-16 6c12bcfde3b2d5c910ed1b11112442237021ac09
src/main/resources/mapper/ExamPaperUserMapper.xml
@@ -22,5 +22,21 @@
        where user_id = #{userId} and deleted = 0
    </select>
    <select id="getByExamPaperId" resultMap="BaseResultMap">
        select * from t_exam_paper_user
        where exam_paper_id = #{examPaperId} and deleted = 0
    </select>
    <insert id="saves" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
        insert into t_exam_paper_user(id, exam_paper_id, user_id, deleted)
        values
        <foreach collection="list" item="item" index="index" separator=",">
            (#{item.id},#{item.examPaperId},#{item.userId},#{item.deleted})
        </foreach>
    </insert>
    <delete id="removeByExamPaperId">
        delete from t_exam_paper_user where exam_paper_id = #{examPaperId}
    </delete>
</mapper>