| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?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.ruoyi.learn.mapper.LearnStudentMapper">
-
- <resultMap type="LearnStudent" id="LearnStudentResult">
- <result property="studentId" column="student_id" />
- <result property="directKey" column="direct_key" />
- </resultMap>
- <sql id="selectLearnStudentVo">
- select student_id, direct_key from learn_student
- </sql>
- <select id="selectLearnStudentList" parameterType="LearnStudent" resultMap="LearnStudentResult">
- <include refid="selectLearnStudentVo"/>
- <where>
- <if test="directKey != null and directKey != ''"> and direct_key = #{directKey}</if>
- </where>
- </select>
-
- <select id="selectLearnStudentByStudentId" parameterType="Long" resultMap="LearnStudentResult">
- <include refid="selectLearnStudentVo"/>
- where student_id = #{studentId}
- </select>
- <insert id="insertLearnStudent" parameterType="LearnStudent">
- insert into learn_student
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="studentId != null">student_id,</if>
- <if test="directKey != null">direct_key,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="studentId != null">#{studentId},</if>
- <if test="directKey != null">#{directKey},</if>
- </trim>
- </insert>
- <update id="updateLearnStudent" parameterType="LearnStudent">
- update learn_student
- <trim prefix="SET" suffixOverrides=",">
- <if test="directKey != null">direct_key = #{directKey},</if>
- </trim>
- where student_id = #{studentId}
- </update>
- <delete id="deleteLearnStudentByStudentId" parameterType="Long">
- delete from learn_student where student_id = #{studentId}
- </delete>
- <delete id="deleteLearnStudentByStudentIds" parameterType="String">
- delete from learn_student where student_id in
- <foreach item="studentId" collection="array" open="(" separator="," close=")">
- #{studentId}
- </foreach>
- </delete>
- </mapper>
|