BdglPartyMapper.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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.BdglPartyMapper">
  6. <resultMap type="BdglParty" id="BdglPartyResult">
  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="unitName" column="unit_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="selectBdglPartyVo">
  27. select id, convoke_time, address, compere_id, join_id, people_ids, absent_ids, people_id, title, contents, createtime, updatetime, unit_id ,unit_name ,compere_ren,people_ji_lu,file_url,meeting_form from bdgl_party
  28. </sql>
  29. <select id="selectBdglPartyList" parameterType="BdglParty" resultMap="BdglPartyResult">
  30. select id, convoke_time, address, compere_id, join_id, people_ids, absent_ids, people_id, title, contents, createtime, updatetime, unit_id ,unit_name ,compere_ren,people_ji_lu,file_url,meeting_form
  31. from bdgl_party p left join sys_dept t
  32. on p.unit_id=t.dept_id
  33. <where>
  34. <if test="unitId !=null">
  35. and (p.unit_id=#{unitId} or find_in_set(#{unitId}, t.ancestors))
  36. </if>
  37. <if test="convokeTime != null "> and p.convoke_time = #{convokeTime}</if>
  38. <if test="address != null and address != ''"> and p.address = #{address}</if>
  39. <if test="compereId != null "> and p.compere_id = #{compereId}</if>
  40. <if test="joinId != null and joinId != ''"> and p.join_id = #{joinId}</if>
  41. <if test="peopleIds != null and peopleIds != ''"> and p.people_ids = #{peopleIds}</if>
  42. <if test="absentIds != null and absentIds != ''"> and p.absent_ids = #{absentIds}</if>
  43. <if test="peopleId != null "> and p.people_id = #{peopleId}</if>
  44. <if test="title != null and title != ''"> and p.title = #{title}</if>
  45. <if test="contents != null and contents != ''"> and p.contents = #{contents}</if>
  46. <if test="createtime != null and createtime != ''"> and p.createtime = #{createtime}</if>
  47. <if test="updatetime != null and updatetime != ''"> and p.updatetime = #{updatetime}</if>
  48. <if test="compereRen != null "> and p.compere_ren = #{compereRen}</if>
  49. <if test="peopleJiLu != null "> and p.people_ji_lu = #{peopleJiLu}</if>
  50. <if test="fileUrl != null "> and p.file_url = #{fileUrl}</if>
  51. <if test="meetingForm != null "> and p.meeting_form = #{meetingForm}</if>
  52. <if test="unitName != null "> and unit_name LIKE concat('%', #{unitName}, '%')</if>
  53. </where>
  54. order by p.id desc
  55. </select>
  56. <select id="selectPartyOnUnitList" parameterType="BdglParty" resultMap="BdglPartyResult">
  57. select id, convoke_time, address, compere_id, join_id, people_ids, absent_ids, people_id, title, contents, createtime, updatetime, unit_id ,unit_name ,compere_ren,people_ji_lu,file_url,meeting_form
  58. from bdgl_party
  59. <where>
  60. <if test="unitId != null"> and unit_id = #{unitId}</if>
  61. <if test="year != null and year != ''"> and YEAR(convoke_time)= #{year}</if>
  62. </where>
  63. order by id desc
  64. </select>
  65. <select id="selectBdglPartyById" parameterType="Integer" resultMap="BdglPartyResult">
  66. <include refid="selectBdglPartyVo"/>
  67. where id = #{id}
  68. </select>
  69. <select id="selectlPartyByunitId" resultType="java.lang.Integer">
  70. select count(*) from bdgl_party where unit_id = #{unitId} and YEAR(convoke_time)= #{year}
  71. </select>
  72. <insert id="insertBdglParty" parameterType="BdglParty" useGeneratedKeys="true" keyProperty="id">
  73. insert into bdgl_party
  74. <trim prefix="(" suffix=")" suffixOverrides=",">
  75. <if test="convokeTime != null">convoke_time,</if>
  76. <if test="address != null">address,</if>
  77. <if test="compereId != null">compere_id,</if>
  78. <if test="joinId != null">join_id,</if>
  79. <if test="peopleIds != null">people_ids,</if>
  80. <if test="absentIds != null">absent_ids,</if>
  81. <if test="peopleId != null">people_id,</if>
  82. <if test="title != null">title,</if>
  83. <if test="contents != null">contents,</if>
  84. <if test="createtime != null">createtime,</if>
  85. <if test="updatetime != null">updatetime,</if>
  86. <if test="unitId != null">unit_id,</if>
  87. <if test="unitName != null">unit_name,</if>
  88. <if test="compereRen != null">compere_ren,</if>
  89. <if test="peopleJiLu != null">people_ji_lu,</if>
  90. <if test="fileUrl != null">file_url,</if>
  91. <if test="meetingForm != null">meeting_form,</if>
  92. </trim>
  93. <trim prefix="values (" suffix=")" suffixOverrides=",">
  94. <if test="convokeTime != null">#{convokeTime},</if>
  95. <if test="address != null">#{address},</if>
  96. <if test="compereId != null">#{compereId},</if>
  97. <if test="joinId != null">#{joinId},</if>
  98. <if test="peopleIds != null">#{peopleIds},</if>
  99. <if test="absentIds != null">#{absentIds},</if>
  100. <if test="peopleId != null">#{peopleId},</if>
  101. <if test="title != null">#{title},</if>
  102. <if test="contents != null">#{contents},</if>
  103. <if test="createtime != null">#{createtime},</if>
  104. <if test="updatetime != null">#{updatetime},</if>
  105. <if test="unitId != null">#{unitId},</if>
  106. <if test="unitName != null">#{unitName},</if>
  107. <if test="compereRen != null">#{compereRen},</if>
  108. <if test="peopleJiLu != null">#{peopleJiLu},</if>
  109. <if test="fileUrl != null">#{fileUrl},</if>
  110. <if test="meetingForm != null">#{meetingForm},</if>
  111. </trim>
  112. </insert>
  113. <update id="updateBdglParty" parameterType="BdglParty">
  114. update bdgl_party
  115. <trim prefix="SET" suffixOverrides=",">
  116. <if test="convokeTime != null">convoke_time = #{convokeTime},</if>
  117. <if test="address != null">address = #{address},</if>
  118. <if test="compereId != null">compere_id = #{compereId},</if>
  119. <if test="joinId != null">join_id = #{joinId},</if>
  120. <if test="peopleIds != null">people_ids = #{peopleIds},</if>
  121. <if test="absentIds != null">absent_ids = #{absentIds},</if>
  122. <if test="peopleId != null">people_id = #{peopleId},</if>
  123. <if test="title != null">title = #{title},</if>
  124. <if test="contents != null">contents = #{contents},</if>
  125. <if test="createtime != null">createtime = #{createtime},</if>
  126. <if test="updatetime != null">updatetime = #{updatetime},</if>
  127. <if test="unitId != null">unit_id = #{unitId},</if>
  128. <if test="compereRen != null">compere_ren = #{compereRen},</if>
  129. <if test="peopleJiLu != null">people_ji_lu = #{peopleJiLu},</if>
  130. <if test="fileUrl != null">file_url = #{fileUrl},</if>
  131. <if test="meetingForm != null">meeting_form = #{meetingForm},</if>
  132. <if test="unitName != null">unit_name = #{unitName},</if>
  133. </trim>
  134. where id = #{id}
  135. </update>
  136. <delete id="deleteBdglPartyById" parameterType="Integer">
  137. delete from bdgl_party where id = #{id}
  138. </delete>
  139. <delete id="deleteBdglPartyByIds" parameterType="String">
  140. delete from bdgl_party where id in
  141. <foreach item="id" collection="array" open="(" separator="," close=")">
  142. #{id}
  143. </foreach>
  144. </delete>
  145. </mapper>