BdglMeetingMapper.xml 8.5 KB

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