综合办公系统
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

CmcTransferMapper.xml 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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.ruoyi.oa.mapper.CmcTransferMapper">
  6. <resultMap type="CmcTransfer" id="CmcTransferResult">
  7. <result property="transferId" column="transfer_id" />
  8. <result property="applier" column="applier" />
  9. <result property="applyDate" column="apply_date" />
  10. <result property="beforeDeptId" column="before_dept_id" />
  11. <result property="beforePostId" column="before_post_id" />
  12. <result property="afterDeptId" column="after_dept_id" />
  13. <result property="afterPostId" column="after_post_id" />
  14. <result property="beforeDeptComment" column="before_dept_comment" />
  15. <result property="beforeDeptLeader" column="before_dept_leader" />
  16. <result property="beforeDeptTime" column="before_dept_time" />
  17. <result property="afterDeptComment" column="after_dept_comment" />
  18. <result property="afterDeptTime" column="after_dept_time" />
  19. <result property="afterDeptLeader" column="after_dept_leader" />
  20. <result property="zhComment" column="zh_comment" />
  21. <result property="zhTime" column="zh_time" />
  22. <result property="zhUserId" column="zh_user_id" />
  23. <result property="managerComment" column="manager_comment" />
  24. <result property="managerTime" column="manager_time" />
  25. <result property="managerUserId" column="manager_user_id" />
  26. <result property="zjlComment" column="zjl_comment" />
  27. <result property="zjlTime" column="zjl_time" />
  28. <result property="zjlUserId" column="zjl_user_id" />
  29. <association property="applierUser" javaType="SysUser" resultMap="ApplierUserResult" />
  30. <association property="beforeDeptUser" javaType="SysUser" resultMap="BeforeDeptUserResult" />
  31. <association property="afterDeptUser" javaType="SysUser" resultMap="AfterDeptUserResult" />
  32. <association property="zhUser" javaType="SysUser" resultMap="ZhUserResult" />
  33. <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
  34. <association property="zjlUser" javaType="SysUser" resultMap="ZjlUserResult" />
  35. <association property="beforePost" javaType="SysPost" resultMap="BeforePostResult" />
  36. <association property="afterPost" javaType="SysPost" resultMap="AfterPostResult" />
  37. <association property="beforeDept" javaType="SysDept" resultMap="BeforeDeptResult" />
  38. <association property="afterDept" javaType="SysDept" resultMap="AfterDeptResult" />
  39. </resultMap>
  40. <resultMap type="SysUser" id="ApplierUserResult">
  41. <result property="userId" column="user_id" />
  42. <result property="nickName" column="applier_nick_name" />
  43. </resultMap>
  44. <resultMap type="SysUser" id="BeforeDeptUserResult">
  45. <result property="userId" column="user_id" />
  46. <result property="nickName" column="before_dept_nick_name" />
  47. </resultMap>
  48. <resultMap type="SysUser" id="AfterDeptUserResult">
  49. <result property="userId" column="user_id" />
  50. <result property="nickName" column="after_dept_nick_name" />
  51. </resultMap>
  52. <resultMap type="SysUser" id="ZhUserResult">
  53. <result property="userId" column="user_id" />
  54. <result property="nickName" column="zh_nick_name" />
  55. </resultMap>
  56. <resultMap type="SysUser" id="ManagerUserResult">
  57. <result property="userId" column="user_id" />
  58. <result property="nickName" column="manager_nick_name" />
  59. </resultMap>
  60. <resultMap type="SysUser" id="ZjlUserResult">
  61. <result property="userId" column="user_id" />
  62. <result property="nickName" column="zjl_nick_name" />
  63. </resultMap>
  64. <resultMap type="SysPost" id="BeforePostResult">
  65. <result property="postId" column="post_id" />
  66. <result property="postName" column="before_post_name" />
  67. </resultMap>
  68. <resultMap type="SysPost" id="AfterPostResult">
  69. <result property="postId" column="post_id" />
  70. <result property="postName" column="after_post_name" />
  71. </resultMap>
  72. <resultMap type="SysDept" id="BeforeDeptResult">
  73. <result property="deptId" column="dept_id" />
  74. <result property="deptName" column="before_dept_name" />
  75. </resultMap>
  76. <resultMap type="SysDept" id="AfterDeptResult">
  77. <result property="deptId" column="dept_id" />
  78. <result property="deptName" column="after_dept_name" />
  79. </resultMap>
  80. <sql id="selectCmcTransferVo">
  81. select t.transfer_id, t.applier, u.nick_name as applier_nick_name, t.apply_date, d.dept_name as before_dept_name, t.before_dept_id, p.post_name as before_post_name, t.before_post_id, d1.dept_name as after_dept_name, t.after_dept_id,
  82. p1.post_name as after_post_name, t.after_post_id, t.before_dept_comment, t.before_dept_leader, u1.nick_name as before_dept_nick_name, t.before_dept_time, t.after_dept_comment, t.after_dept_time, t.after_dept_leader,
  83. u2.nick_name as after_dept_nick_name, t.zh_comment, t.zh_time, t.zh_user_id, u3.nick_name as zh_nick_name, t.manager_comment, t.manager_time, t.manager_user_id, u4.nick_name as manager_nick_name,
  84. t.zjl_comment, t.zjl_time, t.zjl_user_id, u5.nick_name as zjl_nick_name from cmc_transfer as t
  85. left join sys_user as u on u.user_id = t.applier
  86. left join sys_user as u1 on u1.user_id = t.before_dept_leader
  87. left join sys_user as u2 on u2.user_id = t.after_dept_leader
  88. left join sys_user as u3 on u3.user_id = t.zh_user_id
  89. left join sys_user as u4 on u4.user_id = t.manager_user_id
  90. left join sys_user as u5 on u5.user_id = t.zjl_user_id
  91. left join sys_post as p on p.post_id = t.before_post_id
  92. left join sys_post as p1 on p1.post_id = t.after_post_id
  93. left join sys_dept as d on d.dept_id = t.before_dept_id
  94. left join sys_dept as d1 on d1.dept_id = t.after_dept_id
  95. </sql>
  96. <select id="selectCmcTransferList" parameterType="CmcTransfer" resultMap="CmcTransferResult">
  97. <include refid="selectCmcTransferVo"/>
  98. <where>
  99. <if test="applier != null "> and t.applier = #{applier}</if>
  100. <if test="applyDate != null "> and t.apply_date = #{applyDate}</if>
  101. <if test="beforeDeptId != null "> and t.before_dept_id = #{beforeDeptId}</if>
  102. <if test="beforePostId != null "> and t.before_post_id = #{beforePostId}</if>
  103. <if test="afterDeptId != null "> and t.after_dept_id = #{afterDeptId}</if>
  104. <if test="afterPostId != null "> and t.after_post_id = #{afterPostId}</if>
  105. <if test="beforeDeptComment != null and beforeDeptComment != ''"> and t.before_dept_comment = #{beforeDeptComment}</if>
  106. <if test="beforeDeptLeader != null "> and t.before_dept_leader = #{beforeDeptLeader}</if>
  107. <if test="beforeDeptTime != null "> and t.before_dept_time = #{beforeDeptTime}</if>
  108. <if test="afterDeptComment != null and afterDeptComment != ''"> and t.after_dept_comment = #{afterDeptComment}</if>
  109. <if test="afterDeptTime != null "> and t.after_dept_time = #{afterDeptTime}</if>
  110. <if test="afterDeptLeader != null "> and t.after_dept_leader = #{afterDeptLeader}</if>
  111. <if test="zhComment != null and zhComment != ''"> and t.zh_comment = #{zhComment}</if>
  112. <if test="zhTime != null "> and t.zh_time = #{zhTime}</if>
  113. <if test="zhUserId != null "> and t.zh_user_id = #{zhUserId}</if>
  114. <if test="managerComment != null and managerComment != ''"> and t.manager_comment = #{managerComment}</if>
  115. <if test="managerTime != null "> and t.manager_time = #{managerTime}</if>
  116. <if test="managerUserId != null "> and t.manager_user_id = #{managerUserId}</if>
  117. <if test="zjlComment != null and zjlComment != ''"> and t.zjl_comment = #{zjlComment}</if>
  118. <if test="zjlTime != null "> and t.zjl_time = #{zjlTime}</if>
  119. <if test="zjlUserId != null "> and t.zjl_user_id = #{zjlUserId}</if>
  120. </where>
  121. </select>
  122. <select id="selectCmcTransferByTransferId" parameterType="String" resultMap="CmcTransferResult">
  123. <include refid="selectCmcTransferVo"/>
  124. where transfer_id = #{transferId}
  125. </select>
  126. <insert id="insertCmcTransfer" parameterType="CmcTransfer">
  127. insert into cmc_transfer
  128. <trim prefix="(" suffix=")" suffixOverrides=",">
  129. <if test="transferId != null">transfer_id,</if>
  130. <if test="applier != null">applier,</if>
  131. <if test="applyDate != null">apply_date,</if>
  132. <if test="beforeDeptId != null">before_dept_id,</if>
  133. <if test="beforePostId != null">before_post_id,</if>
  134. <if test="afterDeptId != null">after_dept_id,</if>
  135. <if test="afterPostId != null">after_post_id,</if>
  136. <if test="beforeDeptComment != null">before_dept_comment,</if>
  137. <if test="beforeDeptLeader != null">before_dept_leader,</if>
  138. <if test="beforeDeptTime != null">before_dept_time,</if>
  139. <if test="afterDeptComment != null">after_dept_comment,</if>
  140. <if test="afterDeptTime != null">after_dept_time,</if>
  141. <if test="afterDeptLeader != null">after_dept_leader,</if>
  142. <if test="zhComment != null">zh_comment,</if>
  143. <if test="zhTime != null">zh_time,</if>
  144. <if test="zhUserId != null">zh_user_id,</if>
  145. <if test="managerComment != null">manager_comment,</if>
  146. <if test="managerTime != null">manager_time,</if>
  147. <if test="managerUserId != null">manager_user_id,</if>
  148. <if test="zjlComment != null">zjl_comment,</if>
  149. <if test="zjlTime != null">zjl_time,</if>
  150. <if test="zjlUserId != null">zjl_user_id,</if>
  151. </trim>
  152. <trim prefix="values (" suffix=")" suffixOverrides=",">
  153. <if test="transferId != null">#{transferId},</if>
  154. <if test="applier != null">#{applier},</if>
  155. <if test="applyDate != null">#{applyDate},</if>
  156. <if test="beforeDeptId != null">#{beforeDeptId},</if>
  157. <if test="beforePostId != null">#{beforePostId},</if>
  158. <if test="afterDeptId != null">#{afterDeptId},</if>
  159. <if test="afterPostId != null">#{afterPostId},</if>
  160. <if test="beforeDeptComment != null">#{beforeDeptComment},</if>
  161. <if test="beforeDeptLeader != null">#{beforeDeptLeader},</if>
  162. <if test="beforeDeptTime != null">#{beforeDeptTime},</if>
  163. <if test="afterDeptComment != null">#{afterDeptComment},</if>
  164. <if test="afterDeptTime != null">#{afterDeptTime},</if>
  165. <if test="afterDeptLeader != null">#{afterDeptLeader},</if>
  166. <if test="zhComment != null">#{zhComment},</if>
  167. <if test="zhTime != null">#{zhTime},</if>
  168. <if test="zhUserId != null">#{zhUserId},</if>
  169. <if test="managerComment != null">#{managerComment},</if>
  170. <if test="managerTime != null">#{managerTime},</if>
  171. <if test="managerUserId != null">#{managerUserId},</if>
  172. <if test="zjlComment != null">#{zjlComment},</if>
  173. <if test="zjlTime != null">#{zjlTime},</if>
  174. <if test="zjlUserId != null">#{zjlUserId},</if>
  175. </trim>
  176. </insert>
  177. <update id="updateCmcTransfer" parameterType="CmcTransfer">
  178. update cmc_transfer
  179. <trim prefix="SET" suffixOverrides=",">
  180. <if test="applier != null">applier = #{applier},</if>
  181. <if test="applyDate != null">apply_date = #{applyDate},</if>
  182. <if test="beforeDeptId != null">before_dept_id = #{beforeDeptId},</if>
  183. <if test="beforePostId != null">before_post_id = #{beforePostId},</if>
  184. <if test="afterDeptId != null">after_dept_id = #{afterDeptId},</if>
  185. <if test="afterPostId != null">after_post_id = #{afterPostId},</if>
  186. <if test="beforeDeptComment != null">before_dept_comment = #{beforeDeptComment},</if>
  187. <if test="beforeDeptLeader != null">before_dept_leader = #{beforeDeptLeader},</if>
  188. <if test="beforeDeptTime != null">before_dept_time = #{beforeDeptTime},</if>
  189. <if test="afterDeptComment != null">after_dept_comment = #{afterDeptComment},</if>
  190. <if test="afterDeptTime != null">after_dept_time = #{afterDeptTime},</if>
  191. <if test="afterDeptLeader != null">after_dept_leader = #{afterDeptLeader},</if>
  192. <if test="zhComment != null">zh_comment = #{zhComment},</if>
  193. <if test="zhTime != null">zh_time = #{zhTime},</if>
  194. <if test="zhUserId != null">zh_user_id = #{zhUserId},</if>
  195. <if test="managerComment != null">manager_comment = #{managerComment},</if>
  196. <if test="managerTime != null">manager_time = #{managerTime},</if>
  197. <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
  198. <if test="zjlComment != null">zjl_comment = #{zjlComment},</if>
  199. <if test="zjlTime != null">zjl_time = #{zjlTime},</if>
  200. <if test="zjlUserId != null">zjl_user_id = #{zjlUserId},</if>
  201. </trim>
  202. where transfer_id = #{transferId}
  203. </update>
  204. <delete id="deleteCmcTransferByTransferId" parameterType="String">
  205. delete from cmc_transfer where transfer_id = #{transferId}
  206. </delete>
  207. <delete id="deleteCmcTransferByTransferIds" parameterType="String">
  208. delete from cmc_transfer where transfer_id in
  209. <foreach item="transferId" collection="array" open="(" separator="," close=")">
  210. #{transferId}
  211. </foreach>
  212. </delete>
  213. </mapper>