ExamLifecycleLogMapper.xml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.ExamLifecycleLogDao">
  8. <resultMap type="com.keao.edu.user.entity.ExamLifecycleLog" id="ExamLifecycleLog">
  9. <result column="id_" property="id" />
  10. <result column="examination_basic_id_" property="examinationBasicId" />
  11. <result column="event_name_" property="eventName" />
  12. <result column="operator_user_id_" property="operatorUserId" />
  13. <result column="memo_" property="memo" />
  14. <result column="create_time_" property="createTime" />
  15. </resultMap>
  16. <!-- 根据主键查询一条记录 -->
  17. <select id="get" resultMap="ExamLifecycleLog" >
  18. SELECT * FROM exam_lifecycle_log WHERE id_ = #{id}
  19. </select>
  20. <!-- 全查询 -->
  21. <select id="findAll" resultMap="ExamLifecycleLog">
  22. SELECT * FROM exam_lifecycle_log ORDER BY id_
  23. </select>
  24. <!-- 向数据库增加一条记录 -->
  25. <insert id="insert" parameterType="com.keao.edu.user.entity.ExamLifecycleLog" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  26. <!--
  27. <selectKey resultClass="int" keyProperty="id" >
  28. SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
  29. </selectKey>
  30. -->
  31. INSERT INTO exam_lifecycle_log (id_,examination_basic_id_,event_name_,operator_user_id_,memo_,create_time_)
  32. VALUES(#{id},#{examinationBasicId},#{eventName},#{operatorUserId},#{memo},NOW())
  33. </insert>
  34. <!-- 根据主键查询一条记录 -->
  35. <update id="update" parameterType="com.keao.edu.user.entity.ExamLifecycleLog">
  36. UPDATE exam_lifecycle_log
  37. <set>
  38. <if test="examinationBasicId != null">
  39. examination_basic_id_ = #{examinationBasicId},
  40. </if>
  41. <if test="id != null">
  42. id_ = #{id},
  43. </if>
  44. <if test="memo != null">
  45. memo_ = #{memo},
  46. </if>
  47. <if test="operatorUserId != null">
  48. operator_user_id_ = #{operatorUserId},
  49. </if>
  50. <if test="eventName != null">
  51. event_name_ = #{eventName},
  52. </if>
  53. </set> WHERE id_ = #{id}
  54. </update>
  55. <!-- 根据主键删除一条记录 -->
  56. <delete id="delete" >
  57. DELETE FROM exam_lifecycle_log WHERE id_ = #{id}
  58. </delete>
  59. <!-- 分页查询 -->
  60. <select id="queryPage" resultMap="ExamLifecycleLog" parameterType="map">
  61. SELECT * FROM exam_lifecycle_log ORDER BY id_ <include refid="global.limit"/>
  62. </select>
  63. <!-- 查询当前表的总记录数 -->
  64. <select id="queryCount" resultType="int">
  65. SELECT COUNT(*) FROM exam_lifecycle_log
  66. </select>
  67. </mapper>