龚焕茏
2024-07-03 3ec909b27b3eba956aa9d00cc7a94c179bd04bbf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mindskip.xzs.repository.ExamPaperSubjectMapper">
    <resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.ExamPaperSubject">
        <id column="id" jdbcType="INTEGER" property="id" />
        <result column="subject_id" jdbcType="INTEGER" property="subjectId" />
        <result column="exam_paper_id" jdbcType="INTEGER" property="examPaperId" />
        <result column="deleted" jdbcType="VARCHAR" property="deleted" />
    </resultMap>
 
    <sql id="Base_Column_List">
        id
        ,subject_id,exam_paper_id,deleted
    </sql>
 
    <insert id="saves" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
        insert into t_exam_paper_subject(id,subject_id,exam_paper_id,deleted)
        values
        <foreach collection="list" item="item" index="index" separator=",">
            (#{item.id},#{item.subjectId},#{item.examPaperId},#{item.deleted})
        </foreach>
    </insert>
 
    <select id="getByExamPaperId" resultMap="BaseResultMap">
        select * from t_exam_paper_subject
        where exam_paper_id = #{id} and deleted = 0
    </select>
 
    <select id="getBySubjectId" resultMap="BaseResultMap">
        select * from t_exam_paper_subject
        where subject_id = #{id} and deleted = 0
    </select>
 
    <delete id="removeByExamPaperId" parameterType="java.lang.Integer">
        delete from t_exam_paper_subject
        where exam_paper_id = #{id}
    </delete>
 
    <delete id="removeBySubjectId" parameterType="java.lang.Integer">
        delete from t_exam_paper_subject
        where subject_id = #{id}
    </delete>
</mapper>