BdglEvenMapper.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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.grassrootsregistration.mapper.BdglEvenMapper">
  6. <resultMap type="BdglEven" id="BdglEvenResult">
  7. <result property="id" column="id" />
  8. <result property="convokeTime" column="convoke_time" />
  9. <result property="address" column="address" />
  10. <result property="compereId" column="compere_id" />
  11. <result property="joinId" column="join_id" />
  12. <result property="peopleId" column="people_id" />
  13. <result property="title" column="title" />
  14. <result property="contents" column="contents" />
  15. <result property="createtime" column="createtime" />
  16. <result property="updatetime" column="updatetime" />
  17. <result property="unitId" column="unit_id" />
  18. <result property="unitName" column="unit_name" />
  19. <result property="compereRen" column="compere_ren" />
  20. <result property="peopleJiLu" column="people_ji_lu" />
  21. <result property="fileUrl" column="file_url" />
  22. <result property="meetingForm" column="meeting_form" />
  23. </resultMap>
  24. <sql id="selectBdglEvenVo">
  25. select id, convoke_time, address, compere_id, join_id, people_id, title, contents, createtime, updatetime, unit_id,unit_name,compere_ren,people_ji_lu,file_url,meeting_form from bdgl_even
  26. </sql>
  27. <select id="selectBdglEvenList" parameterType="BdglEven" resultMap="BdglEvenResult">
  28. select id, convoke_time, address, compere_id, join_id, people_id, title, contents, createtime, updatetime, unit_id,unit_name,compere_ren,people_ji_lu,file_url,meeting_form
  29. from bdgl_even e left join sys_dept t
  30. on d.unit_id=t.dept_id
  31. <where>
  32. <if test="convokeTime != null "> and e.convoke_time = #{convokeTime}</if>
  33. <if test="address != null and address != ''"> and e.address = #{address}</if>
  34. <if test="compereId != null "> and e.compere_id = #{compereId}</if>
  35. <if test="joinId != null and joinId != ''"> and e.join_id = #{joinId}</if>
  36. <if test="peopleId != null "> and e.people_id = #{peopleId}</if>
  37. <if test="title != null and title != ''"> and e.title = #{title}</if>
  38. <if test="contents != null and contents != ''"> and e.contents = #{contents}</if>
  39. <if test="createtime != null and createtime != ''"> and e.createtime = #{createtime}</if>
  40. <if test="updatetime != null and updatetime != ''"> and e.updatetime = #{updatetime}</if>
  41. <if test="compereRen != null "> and e.compere_ren concat('%',#{compereRen}, '%')</if>
  42. <if test="peopleJiLu != null "> and e.people_ji_lu concat('%', #{peopleJiLu}, '%')</if>
  43. <if test="fileUrl != null "> and e.file_url concat('%', #{fileUrl}, '%')</if>
  44. <if test="meetingForm != null "> and e.meeting_form concat('%', #{meetingForm}, '%')</if>
  45. and(d.unit_id=#{unitId} or find_in_set(#{unitId}, t.ancestors))
  46. </where>
  47. order by e.id desc
  48. </select>
  49. <select id="selectBdglEvenLists" parameterType="BdglEven" resultMap="BdglEvenResult">
  50. select e.id, e.convoke_time, e.address, e.compere_id, e.join_id, e.people_id, e.title, e.contents, e.createtime, e.updatetime, e.unit_id ,e.compere_ren,e.people_ji_lu,e.file_url,e.meeting_form,d.dept_name unit_name from
  51. bdgl_even e LEFT JOIN sys_dept d ON e.unit_id = d.dept_id
  52. <where>
  53. <if test="unitId!=null">
  54. and (e.unit_id=#{unitId} or find_in_set(#{unitId}, d.ancestors))
  55. </if>
  56. <if test="convokeTime != null "> and e.convoke_time = #{convokeTime}</if>
  57. <if test="address != null and address != ''"> and e.address = #{address}</if>
  58. <if test="compereId != null "> and e.compere_id = #{compereId}</if>
  59. <if test="joinId != null and joinId != ''"> and e.join_id = #{joinId}</if>
  60. <if test="peopleId != null "> and e. people_id = #{peopleId}</if>
  61. <if test="title != null and title != ''"> and e.title = #{title}</if>
  62. <if test="contents != null and contents != ''"> and e.contents = #{contents}</if>
  63. <if test="createtime != null and createtime != ''"> and e.createtime = #{createtime}</if>
  64. <if test="updatetime != null and updatetime != ''"> and e.updatetime = #{updatetime}</if>
  65. <if test="compereRen != null "> and e.compere_ren = #{compereRen}</if>
  66. <if test="peopleJiLu != null "> and e.people_ji_lu = #{peopleJiLu}</if>
  67. <if test="fileUrl != null "> and e.file_url = #{fileUrl}</if>
  68. <if test="meetingForm != null "> and e.meeting_form = #{meetingForm}</if>
  69. <if test="unitName != null "> and e.unit_name LIKE concat('%', #{unitName}, '%')</if>
  70. </where>
  71. order by e.id desc
  72. </select>
  73. <select id="selectBdglEvenById" parameterType="Integer" resultMap="BdglEvenResult">
  74. <include refid="selectBdglEvenVo"/>
  75. where id = #{id}
  76. </select>
  77. <select id="selectlMeetRecordByunitId" resultType="java.lang.Integer">
  78. select count(*) from bdgl_even where unit_id = #{unitId} and YEAR(convoke_time)= #{year}
  79. </select>
  80. <select id="selectMeetRecordOnUnitList" parameterType="BdglEven" resultMap="BdglEvenResult">
  81. select id, convoke_time, address, compere_id, join_id, people_id, title, contents, createtime, updatetime, unit_id,unit_name,compere_ren,people_ji_lu,file_url,meeting_form
  82. from bdgl_even
  83. <where>
  84. <if test="unitId != null"> and unit_id = #{unitId}</if>
  85. <if test="year != null and year != ''"> and YEAR(convoke_time)= #{year}</if>
  86. </where>
  87. order by id desc
  88. </select>
  89. <insert id="insertBdglEven" parameterType="BdglEven" useGeneratedKeys="true" keyProperty="id">
  90. insert into bdgl_even
  91. <trim prefix="(" suffix=")" suffixOverrides=",">
  92. <if test="convokeTime != null">convoke_time,</if>
  93. <if test="address != null">address,</if>
  94. <if test="compereId != null">compere_id,</if>
  95. <if test="joinId != null">join_id,</if>
  96. <if test="peopleId != null">people_id,</if>
  97. <if test="title != null">title,</if>
  98. <if test="contents != null">contents,</if>
  99. <if test="createtime != null">createtime,</if>
  100. <if test="updatetime != null">updatetime,</if>
  101. <if test="unitId != null">unit_id,</if>
  102. <if test="unitName != null">unit_name,</if>
  103. <if test="compereRen != null">compere_ren,</if>
  104. <if test="peopleJiLu != null">people_ji_lu,</if>
  105. <if test="fileUrl != null">file_url,</if>
  106. <if test="meetingForm != null">meeting_form,</if>
  107. </trim>
  108. <trim prefix="values (" suffix=")" suffixOverrides=",">
  109. <if test="convokeTime != null">#{convokeTime},</if>
  110. <if test="address != null">#{address},</if>
  111. <if test="compereId != null">#{compereId},</if>
  112. <if test="joinId != null">#{joinId},</if>
  113. <if test="peopleId != null">#{peopleId},</if>
  114. <if test="title != null">#{title},</if>
  115. <if test="contents != null">#{contents},</if>
  116. <if test="createtime != null">#{createtime},</if>
  117. <if test="updatetime != null">#{updatetime},</if>
  118. <if test="unitId != null">#{unitId},</if>
  119. <if test="unitName != null">#{unitName},</if>
  120. <if test="compereRen != null">#{compereRen},</if>
  121. <if test="peopleJiLu != null">#{peopleJiLu},</if>
  122. <if test="fileUrl != null">#{fileUrl},</if>
  123. <if test="meetingForm != null">#{meetingForm},</if>
  124. </trim>
  125. </insert>
  126. <update id="updateBdglEven" parameterType="BdglEven">
  127. update bdgl_even
  128. <trim prefix="SET" suffixOverrides=",">
  129. <if test="convokeTime != null">convoke_time = #{convokeTime},</if>
  130. <if test="address != null">address = #{address},</if>
  131. <if test="compereId != null">compere_id = #{compereId},</if>
  132. <if test="joinId != null">join_id = #{joinId},</if>
  133. <if test="peopleId != null">people_id = #{peopleId},</if>
  134. <if test="title != null">title = #{title},</if>
  135. <if test="contents != null">contents = #{contents},</if>
  136. <if test="createtime != null">createtime = #{createtime},</if>
  137. <if test="updatetime != null">updatetime = #{updatetime},</if>
  138. <if test="unitId != null">unit_id = #{unitId},</if>
  139. <if test="compereRen != null">compere_ren = #{compereRen},</if>
  140. <if test="peopleJiLu != null">people_ji_lu = #{peopleJiLu},</if>
  141. <if test="fileUrl != null">file_url = #{fileUrl},</if>
  142. <if test="meetingForm != null">meeting_form = #{meetingForm},</if>
  143. </trim>
  144. where id = #{id}
  145. </update>
  146. <delete id="deleteBdglEvenById" parameterType="Integer">
  147. delete from bdgl_even where id = #{id}
  148. </delete>
  149. <delete id="deleteBdglEvenByIds" parameterType="String">
  150. delete from bdgl_even where id in
  151. <foreach item="id" collection="array" open="(" separator="," close=")">
  152. #{id}
  153. </foreach>
  154. </delete>
  155. </mapper>