UniversityPointMapper.xml 1.55 KB
<?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.sincere.student.mapper.UniversityPointMapper">
  <resultMap id="BaseResultMap" type="com.sincere.student.model.Point">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="submit_id" jdbcType="INTEGER" property="submitId" />
    <result column="university" jdbcType="VARCHAR" property="universityName" />
    <result column="major" jdbcType="VARCHAR" property="major" />
    <result column="grade" jdbcType="VARCHAR" property="grade" />
    <result column="enroll_number" jdbcType="INTEGER" property="enrollNumber" />
    <result column="rank" jdbcType="INTEGER" property="rank" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="province" jdbcType="VARCHAR" property="province" />
    <result column="city" jdbcType="VARCHAR" property="city" />
  </resultMap>

  <insert id="insertBatch" parameterType="java.util.List">
    insert into university_point (submit_id, university , major ,grade ,enroll_number ,rank,create_time,province,city)
    values
    <foreach collection="list" item="emp" separator=",">
      (#{emp.submitId}, #{emp.universityName}, #{emp.major}, #{emp.grade}, #{emp.enrollNumber}, #{emp.rank},GETDATE(),#{emp.province},#{emp.city})
    </foreach>
  </insert>

  <delete id="deleteBySubmit" parameterType="java.lang.Integer">
    delete from university_point
    where submit_id = #{id,jdbcType=INTEGER}
  </delete>

</mapper>