ThoughtTalkMapper.xml 8.2 KB

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