ExamRoomMapper.xml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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.ExamRoomDao">
  8. <resultMap type="com.keao.edu.user.api.entity.ExamRoom" id="ExamRoom">
  9. <result column="id_" property="id" />
  10. <result column="exam_mode_" property="examMode" />
  11. <result column="exam_location_id_" property="examLocationId" />
  12. <result column="subject_id_list_" property="subjectIdList" />
  13. <result column="main_teacher_user_id_" property="mainTeacherUserId" />
  14. <result column="assistant_teacher_user_id_list_" property="assistantTeacherUserIdList" />
  15. <result column="exam_time_json_" property="examTimeJson" />
  16. <result column="del_flag_" property="delFlag" />
  17. <result column="create_time_" property="createTime" />
  18. <result column="update_time_" property="updateTime" />
  19. <result column="tenant_id_" property="tenantId" />
  20. </resultMap>
  21. <!-- 根据主键查询一条记录 -->
  22. <select id="get" resultMap="ExamRoom" >
  23. SELECT * FROM exam_room WHERE id_ = #{id}
  24. </select>
  25. <!-- 全查询 -->
  26. <select id="findAll" resultMap="ExamRoom">
  27. SELECT * FROM exam_room ORDER BY id_
  28. </select>
  29. <!-- 向数据库增加一条记录 -->
  30. <insert id="insert" parameterType="com.keao.edu.user.api.entity.ExamRoom" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  31. INSERT INTO exam_room (id_,exam_mode_,exam_location_id_,subject_id_list_,main_teacher_user_id_,
  32. assistant_teacher_user_id_list_,exam_time_json_,del_flag_,create_time_,update_time_,tenant_id_)
  33. VALUES(#{id},#{examMode},#{examLocationId},#{subjectIdList},#{mainTeacherUserId},#{assistantTeacherUserIdList},
  34. #{examTimeJson},#{delFlag},NOW(),NOW(),#{tenantId})
  35. </insert>
  36. <!-- 根据主键查询一条记录 -->
  37. <update id="update" parameterType="com.keao.edu.user.api.entity.ExamRoom">
  38. UPDATE exam_room <set>
  39. <if test="delFlag != null">
  40. del_flag_ = #{delFlag},
  41. </if>
  42. <if test="examTimeJson != null">
  43. exam_time_json_ = #{examTimeJson},
  44. </if>
  45. <if test="subjectIdList != null">
  46. subject_id_list_ = #{subjectIdList},
  47. </if>
  48. <if test="tenantId != null">
  49. tenant_id_ = #{tenantId},
  50. </if>
  51. <if test="updateTime != null">
  52. update_time_ = #{updateTime},
  53. </if>
  54. <if test="examMode != null">
  55. exam_mode_ = #{examMode},
  56. </if>
  57. <if test="examLocationId != null">
  58. exam_location_id_ = #{examLocationId},
  59. </if>
  60. <if test="mainTeacherUserId != null">
  61. main_teacher_user_id_ = #{mainTeacherUserId},
  62. </if>
  63. <if test="assistantTeacherUserIdList != null">
  64. assistant_teacher_user_id_list_ = #{assistantTeacherUserIdList},
  65. </if>
  66. </set> WHERE id_ = #{id}
  67. </update>
  68. <!-- 根据主键删除一条记录 -->
  69. <delete id="delete" >
  70. DELETE FROM exam_room WHERE id_ = #{id}
  71. </delete>
  72. <!-- 分页查询 -->
  73. <select id="queryPage" resultMap="ExamRoom" parameterType="map">
  74. SELECT * FROM exam_room ORDER BY id_ <include refid="global.limit"/>
  75. </select>
  76. <!-- 查询当前表的总记录数 -->
  77. <select id="queryCount" resultType="int">
  78. SELECT COUNT(*) FROM exam_room
  79. </select>
  80. </mapper>