ThoughtParliamentMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.ThoughtParliamentMapper">
  6. <resultMap type="ThoughtParliament" id="ThoughtParliamentResult">
  7. <result property="id" column="id" />
  8. <result property="unitName" column="unit_name" />
  9. <result property="unitId" column="unit_id" />
  10. <result property="startTime" column="start_time" />
  11. <result property="endTime" column="end_time" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateTime" column="update_time" />
  14. <result property="createName" column="create_name" />
  15. <result property="createId" column="create_id" />
  16. <result property="filePath" column="file_path" />
  17. <result property="fileName" column="file_name" />
  18. <result property="talkContent" column="talk_content" />
  19. <result property="recorder" column="recorder" />
  20. <result property="recorderId" column="recorder_id" />
  21. <result property="participants" column="participants" />
  22. <result property="participantsId" column="participants_id" />
  23. <result property="organizer" column="organizer" />
  24. <result property="organizerId" column="organizer_id" />
  25. <result property="talkTheme" column="talk_theme" />
  26. </resultMap>
  27. <sql id="selectThoughtParliamentVo">
  28. select id, unit_name, unit_id, start_time, end_time, create_time, update_time, create_name, create_id, file_path, file_name, talk_content, recorder, recorder_id, participants, participants_id, organizer, organizer_id, talk_theme from thought_parliament
  29. </sql>
  30. <select id="selectThoughtParliamentList" parameterType="ThoughtParliament" resultMap="ThoughtParliamentResult">
  31. <include refid="selectThoughtParliamentVo"/>
  32. <where>
  33. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  34. <if test="unitId != null "> and unit_id = #{unitId}</if>
  35. <if test="startTime != null "> and start_time = #{startTime}</if>
  36. <if test="endTime != null "> and end_time = #{endTime}</if>
  37. <if test="createName != null and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
  38. <if test="createId != null "> and create_id = #{createId}</if>
  39. <if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
  40. <if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
  41. <if test="talkContent != null and talkContent != ''"> and talk_content = #{talkContent}</if>
  42. <if test="recorder != null and recorder != ''"> and recorder = #{recorder}</if>
  43. <if test="recorderId != null and recorderId != ''"> and recorder_id = #{recorderId}</if>
  44. <if test="participants != null and participants != ''"> and participants = #{participants}</if>
  45. <if test="participantsId != null and participantsId != ''"> and participants_id = #{participantsId}</if>
  46. <if test="organizer != null and organizer != ''"> and organizer = #{organizer}</if>
  47. <if test="organizerId != null and organizerId != ''"> and organizer_id = #{organizerId}</if>
  48. <if test="talkTheme != null and talkTheme != ''"> and talk_theme = #{talkTheme}</if>
  49. </where>
  50. order by id desc
  51. </select>
  52. <select id="selectThoughtParliamentById" parameterType="Long" resultMap="ThoughtParliamentResult">
  53. <include refid="selectThoughtParliamentVo"/>
  54. where id = #{id}
  55. </select>
  56. <insert id="insertThoughtParliament" parameterType="ThoughtParliament" useGeneratedKeys="true" keyProperty="id">
  57. insert into thought_parliament
  58. <trim prefix="(" suffix=")" suffixOverrides=",">
  59. <if test="unitName != null">unit_name,</if>
  60. <if test="unitId != null">unit_id,</if>
  61. <if test="startTime != null">start_time,</if>
  62. <if test="endTime != null">end_time,</if>
  63. <if test="createTime != null">create_time,</if>
  64. <if test="updateTime != null">update_time,</if>
  65. <if test="createName != null">create_name,</if>
  66. <if test="createId != null">create_id,</if>
  67. <if test="filePath != null">file_path,</if>
  68. <if test="fileName != null">file_name,</if>
  69. <if test="talkContent != null">talk_content,</if>
  70. <if test="recorder != null">recorder,</if>
  71. <if test="recorderId != null">recorder_id,</if>
  72. <if test="participants != null">participants,</if>
  73. <if test="participantsId != null">participants_id,</if>
  74. <if test="organizer != null">organizer,</if>
  75. <if test="organizerId != null">organizer_id,</if>
  76. <if test="talkTheme != null">talk_theme,</if>
  77. </trim>
  78. <trim prefix="values (" suffix=")" suffixOverrides=",">
  79. <if test="unitName != null">#{unitName},</if>
  80. <if test="unitId != null">#{unitId},</if>
  81. <if test="startTime != null">#{startTime},</if>
  82. <if test="endTime != null">#{endTime},</if>
  83. <if test="createTime != null">#{createTime},</if>
  84. <if test="updateTime != null">#{updateTime},</if>
  85. <if test="createName != null">#{createName},</if>
  86. <if test="createId != null">#{createId},</if>
  87. <if test="filePath != null">#{filePath},</if>
  88. <if test="fileName != null">#{fileName},</if>
  89. <if test="talkContent != null">#{talkContent},</if>
  90. <if test="recorder != null">#{recorder},</if>
  91. <if test="recorderId != null">#{recorderId},</if>
  92. <if test="participants != null">#{participants},</if>
  93. <if test="participantsId != null">#{participantsId},</if>
  94. <if test="organizer != null">#{organizer},</if>
  95. <if test="organizerId != null">#{organizerId},</if>
  96. <if test="talkTheme != null">#{talkTheme},</if>
  97. </trim>
  98. </insert>
  99. <update id="updateThoughtParliament" parameterType="ThoughtParliament">
  100. update thought_parliament
  101. <trim prefix="SET" suffixOverrides=",">
  102. <if test="unitName != null">unit_name = #{unitName},</if>
  103. <if test="unitId != null">unit_id = #{unitId},</if>
  104. <if test="startTime != null">start_time = #{startTime},</if>
  105. <if test="endTime != null">end_time = #{endTime},</if>
  106. <if test="createTime != null">create_time = #{createTime},</if>
  107. <if test="updateTime != null">update_time = #{updateTime},</if>
  108. <if test="createName != null">create_name = #{createName},</if>
  109. <if test="createId != null">create_id = #{createId},</if>
  110. <if test="filePath != null">file_path = #{filePath},</if>
  111. <if test="fileName != null">file_name = #{fileName},</if>
  112. <if test="talkContent != null">talk_content = #{talkContent},</if>
  113. <if test="recorder != null">recorder = #{recorder},</if>
  114. <if test="recorderId != null">recorder_id = #{recorderId},</if>
  115. <if test="participants != null">participants = #{participants},</if>
  116. <if test="participantsId != null">participants_id = #{participantsId},</if>
  117. <if test="organizer != null">organizer = #{organizer},</if>
  118. <if test="organizerId != null">organizer_id = #{organizerId},</if>
  119. <if test="talkTheme != null">talk_theme = #{talkTheme},</if>
  120. </trim>
  121. where id = #{id}
  122. </update>
  123. <delete id="deleteThoughtParliamentById" parameterType="Long">
  124. delete from thought_parliament where id = #{id}
  125. </delete>
  126. <delete id="deleteThoughtParliamentByIds" parameterType="String">
  127. delete from thought_parliament where id in
  128. <foreach item="id" collection="array" open="(" separator="," close=")">
  129. #{id}
  130. </foreach>
  131. </delete>
  132. </mapper>