ExamCertificationMapper.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <!--
  4. 这个文件是自动生成的。
  5. 不要修改此文件。所有改动将在下次重新自动生成时丢失。
  6. -->
  7. <mapper namespace="com.keao.edu.user.dao.ExamCertificationDao">
  8. <resultMap type="com.keao.edu.user.entity.ExamCertification" id="ExamCertification">
  9. <result column="id_" property="id" />
  10. <result column="examination_basic_id_" property="examinationBasicId" />
  11. <result column="student_id_" property="studentId" />
  12. <result column="card_no_" property="cardNo" />
  13. <result column="subject_id_" property="subjectId" />
  14. <result column="level_" property="level" />
  15. <result column="exam_start_time_" property="examStartTime" />
  16. <result column="exam_end_time_" property="examEndTime" />
  17. <result column="exam_address_" property="examAddress" />
  18. <result column="create_time_" property="createTime" />
  19. <result column="update_time_" property="updateTime" />
  20. <result column="tenant_id_" property="tenantId" />
  21. </resultMap>
  22. <!-- 根据主键查询一条记录 -->
  23. <select id="get" resultMap="ExamCertification" >
  24. SELECT * FROM exam_certification WHERE id_ = #{id}
  25. </select>
  26. <!-- 全查询 -->
  27. <select id="findAll" resultMap="ExamCertification">
  28. SELECT * FROM exam_certification ORDER BY id_
  29. </select>
  30. <!-- 向数据库增加一条记录 -->
  31. <insert id="insert" parameterType="com.keao.edu.user.entity.ExamCertification" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  32. <!--
  33. <selectKey resultClass="int" keyProperty="id" >
  34. SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
  35. </selectKey>
  36. -->
  37. INSERT INTO exam_certification (id_,examination_basic_id_,student_id_,card_no_,subject_id_,level_,exam_start_time_,exam_end_time_,exam_address_,create_time_,update_time_,tenant_id_)
  38. VALUES(#{id},#{examinationBasicId},#{studentId},#{cardNo},#{subjectId},#{level},#{examStartTime},#{examEndTime},#{examAddress},NOW(),NOW(),#{tenantId})
  39. </insert>
  40. <!-- 根据主键查询一条记录 -->
  41. <update id="update" parameterType="com.keao.edu.user.entity.ExamCertification">
  42. UPDATE exam_certification
  43. <set>
  44. <if test="examinationBasicId != null">
  45. examination_basic_id_ = #{examinationBasicId},
  46. </if>
  47. <if test="subjectId != null">
  48. subject_id_ = #{subjectId},
  49. </if>
  50. <if test="examEndTime != null">
  51. exam_end_time_ = #{examEndTime},
  52. </if>
  53. <if test="id != null">
  54. id_ = #{id},
  55. </if>
  56. <if test="examStartTime != null">
  57. exam_start_time_ = #{examStartTime},
  58. </if>
  59. <if test="tenantId != null">
  60. tenant_id_ = #{tenantId},
  61. </if>
  62. <if test="cardNo != null">
  63. card_no_ = #{cardNo},
  64. </if>
  65. <if test="studentId != null">
  66. student_id_ = #{studentId},
  67. </if>
  68. <if test="level != null">
  69. level_ = #{level},
  70. </if>
  71. <if test="examAddress != null">
  72. exam_address_ = #{examAddress},
  73. </if>
  74. update_time_ = NOW()
  75. </set> WHERE id_ = #{id}
  76. </update>
  77. <!-- 根据主键删除一条记录 -->
  78. <delete id="delete" >
  79. DELETE FROM exam_certification WHERE id_ = #{id}
  80. </delete>
  81. <!-- 分页查询 -->
  82. <select id="queryPage" resultMap="ExamCertification" parameterType="map">
  83. SELECT * FROM exam_certification ORDER BY id_ <include refid="global.limit"/>
  84. </select>
  85. <!-- 查询当前表的总记录数 -->
  86. <select id="queryCount" resultType="int">
  87. SELECT COUNT(*) FROM exam_certification
  88. </select>
  89. </mapper>