<?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="rd.dao.mapper.user.StudentInfoMapper">
    <insert id="insertOrUpdate" parameterType="rd.data.db.table.StudentInfo">
        insert into student_info (id, student_number, "name", major, grade, class)
        values (#{student.id}, #{student.studentNumber}, #{student.name}, #{student.major}, #{student.grade}, #{student.clazz})
        on conflict (id, student_number) do update set (id, student_number, "name", major, grade, class) = (#{student.id}, #{student.studentNumber}, #{student.name}, #{student.major}, #{student.grade}, #{student.clazz})
    </insert>
</mapper>
