ThoughtGetreadyMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.supervision.thought.mapper.ThoughtGetreadyMapper">
  6. <resultMap type="ThoughtGetready" id="ThoughtGetreadyResult">
  7. <result property="id" column="id" />
  8. <result property="talkPeople" column="talk_people" />
  9. <result property="startTime" column="start_time" />
  10. <result property="endTime" column="end_time" />
  11. <result property="createTime" column="create_time" />
  12. <result property="updateTime" column="update_time" />
  13. <result property="createName" column="create_name" />
  14. <result property="createId" column="create_id" />
  15. <result property="filePath" column="file_path" />
  16. <result property="fileName" column="file_name" />
  17. <result property="talkContent" column="talk_content" />
  18. <result property="talkTheme" column="talk_theme" />
  19. <result property="talkIntroduction" column="talk_introduction" />
  20. <result property="recorder" column="recorder" />
  21. <result property="recorderId" column="recorder_id" />
  22. </resultMap>
  23. <sql id="selectThoughtGetreadyVo">
  24. select id, talk_people, start_time, end_time, create_time, update_time, create_name, create_id, file_path, file_name, talk_content, talk_theme, talk_introduction, recorder, recorder_id from thought_getready
  25. </sql>
  26. <select id="selectThoughtGetreadyList" parameterType="ThoughtGetready" resultMap="ThoughtGetreadyResult">
  27. <include refid="selectThoughtGetreadyVo"/>
  28. <where>
  29. <if test="talkPeople != null and talkPeople != ''"> and talk_people = #{talkPeople}</if>
  30. <if test="startTime != null "> and start_time = #{startTime}</if>
  31. <if test="endTime != null "> and end_time = #{endTime}</if>
  32. <if test="createName != null and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
  33. <if test="createId != null "> and create_id = #{createId}</if>
  34. <if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
  35. <if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
  36. <if test="talkContent != null and talkContent != ''"> and talk_content = #{talkContent}</if>
  37. <if test="talkTheme != null and talkTheme != ''"> and talk_theme = #{talkTheme}</if>
  38. <if test="talkIntroduction != null and talkIntroduction != ''"> and talk_introduction = #{talkIntroduction}</if>
  39. <if test="recorder != null and recorder != ''"> and recorder = #{recorder}</if>
  40. <if test="recorderId != null and recorderId != ''"> and recorder_id = #{recorderId}</if>
  41. </where>
  42. order by id desc
  43. </select>
  44. <select id="selectThoughtGetreadyById" parameterType="Long" resultMap="ThoughtGetreadyResult">
  45. <include refid="selectThoughtGetreadyVo"/>
  46. where id = #{id}
  47. </select>
  48. <insert id="insertThoughtGetready" parameterType="ThoughtGetready" useGeneratedKeys="true" keyProperty="id">
  49. insert into thought_getready
  50. <trim prefix="(" suffix=")" suffixOverrides=",">
  51. <if test="talkPeople != null">talk_people,</if>
  52. <if test="startTime != null">start_time,</if>
  53. <if test="endTime != null">end_time,</if>
  54. <if test="createTime != null">create_time,</if>
  55. <if test="updateTime != null">update_time,</if>
  56. <if test="createName != null">create_name,</if>
  57. <if test="createId != null">create_id,</if>
  58. <if test="filePath != null">file_path,</if>
  59. <if test="fileName != null">file_name,</if>
  60. <if test="talkContent != null">talk_content,</if>
  61. <if test="talkTheme != null">talk_theme,</if>
  62. <if test="talkIntroduction != null">talk_introduction,</if>
  63. <if test="recorder != null">recorder,</if>
  64. <if test="recorderId != null">recorder_id,</if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="talkPeople != null">#{talkPeople},</if>
  68. <if test="startTime != null">#{startTime},</if>
  69. <if test="endTime != null">#{endTime},</if>
  70. <if test="createTime != null">#{createTime},</if>
  71. <if test="updateTime != null">#{updateTime},</if>
  72. <if test="createName != null">#{createName},</if>
  73. <if test="createId != null">#{createId},</if>
  74. <if test="filePath != null">#{filePath},</if>
  75. <if test="fileName != null">#{fileName},</if>
  76. <if test="talkContent != null">#{talkContent},</if>
  77. <if test="talkTheme != null">#{talkTheme},</if>
  78. <if test="talkIntroduction != null">#{talkIntroduction},</if>
  79. <if test="recorder != null">#{recorder},</if>
  80. <if test="recorderId != null">#{recorderId},</if>
  81. </trim>
  82. </insert>
  83. <update id="updateThoughtGetready" parameterType="ThoughtGetready">
  84. update thought_getready
  85. <trim prefix="SET" suffixOverrides=",">
  86. <if test="talkPeople != null">talk_people = #{talkPeople},</if>
  87. <if test="startTime != null">start_time = #{startTime},</if>
  88. <if test="endTime != null">end_time = #{endTime},</if>
  89. <if test="createTime != null">create_time = #{createTime},</if>
  90. <if test="updateTime != null">update_time = #{updateTime},</if>
  91. <if test="createName != null">create_name = #{createName},</if>
  92. <if test="createId != null">create_id = #{createId},</if>
  93. <if test="filePath != null">file_path = #{filePath},</if>
  94. <if test="fileName != null">file_name = #{fileName},</if>
  95. <if test="talkContent != null">talk_content = #{talkContent},</if>
  96. <if test="talkTheme != null">talk_theme = #{talkTheme},</if>
  97. <if test="talkIntroduction != null">talk_introduction = #{talkIntroduction},</if>
  98. <if test="recorder != null">recorder = #{recorder},</if>
  99. <if test="recorderId != null">recorder_id = #{recorderId},</if>
  100. </trim>
  101. where id = #{id}
  102. </update>
  103. <delete id="deleteThoughtGetreadyById" parameterType="Long">
  104. delete from thought_getready where id = #{id}
  105. </delete>
  106. <delete id="deleteThoughtGetreadyByIds" parameterType="String">
  107. delete from thought_getready where id in
  108. <foreach item="id" collection="array" open="(" separator="," close=")">
  109. #{id}
  110. </foreach>
  111. </delete>
  112. </mapper>