RepairsStudentMapper.xml 1.9 KB

123456789101112131415161718192021222324252627282930
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.chuanghai.repair.mapper.RepairsStudentMapper">
  4. <resultMap id="BaseResultMap" type="com.chuanghai.repair.entity.RepairsStudent">
  5. <!--
  6. WARNING - @mbg.generated
  7. -->
  8. <id column="student_id" property="studentId" jdbcType="VARCHAR"/>
  9. <result column="student_name" property="studentName" jdbcType="VARCHAR"/>
  10. <result column="student_sex" property="studentSex" jdbcType="VARCHAR"/>
  11. <result column="student_phone" property="studentPhone" jdbcType="VARCHAR"/>
  12. <result column="student_other_phone" property="studentOtherPhone" jdbcType="VARCHAR"/>
  13. <result column="student_clazz" property="studentClazz" jdbcType="VARCHAR"/>
  14. <result column="dorm_number" property="dormNumber" jdbcType="VARCHAR"/>
  15. <result column="student_dormitory" property="studentDormitory" jdbcType="VARCHAR"/>
  16. <result column="student_status" property="studentStatus" jdbcType="VARCHAR"/>
  17. <result column="student_campus" property="studentCampus" jdbcType="VARCHAR"/>
  18. <result column="card_number" property="cardNumber" jdbcType="VARCHAR"/>
  19. </resultMap>
  20. <!-- 新增学生信息-->
  21. <insert id="insertStudent" parameterType="com.chuanghai.repair.entity.RepairsStudent">
  22. insert into repairs_student values(#{studentId},#{studentName},#{studentSex},#{studentPhone},#{studentOtherPhone},
  23. #{studentClazz},#{dormNumber},#{studentDormitory},#{studentStatus},#{studentCampus},#{cardNumber})
  24. </insert>
  25. <!-- 查询指定学号-->
  26. <select id="queryByStudentId" parameterType="java.lang.String" resultMap="BaseResultMap">
  27. select * from repairs_student where student_id = #{studentId}
  28. </select>
  29. </mapper>