ExamLifecycleLogMapper.xml 3.0 KB

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