综合办公系统
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

CmcBorrowMapper.xml 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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.CmcBorrowMapper">
  6. <resultMap type="CmcBorrow" id="CmcBorrowResult">
  7. <result property="borrowId" column="borrow_id" />
  8. <result property="projectId" column="project_id" />
  9. <result property="undertakingDept" column="undertaking_dept" />
  10. <result property="applyReason" column="apply_reason" />
  11. <result property="borrowUsage" column="borrow_usage" />
  12. <result property="applier" column="applier" />
  13. <result property="applyDept" column="apply_dept" />
  14. <result property="applyDate" column="apply_date" />
  15. <result property="remark" column="remark" />
  16. <result property="applyAmount" column="apply_amount" />
  17. <result property="managerAmount" column="manager_amount" />
  18. <result property="deptComment" column="dept_comment" />
  19. <result property="deptUserId" column="dept_user_id" />
  20. <result property="managerComment" column="manager_comment" />
  21. <result property="managerUserId" column="manager_user_id" />
  22. <result property="zjlUserId" column="zjl_user_id" />
  23. <result property="zjlComment" column="zjl_comment" />
  24. <result property="dszUserId" column="dsz_user_id" />
  25. <result property="dszComment" column="dsz_comment" />
  26. <result property="unionUserId" column="union_user_id" />
  27. <result property="unionComment" column="union_comment" />
  28. <result property="cwUserId" column="cw_user_id" />
  29. <result property="cwComment" column="cw_comment" />
  30. <result property="deptTime" column="dept_time" />
  31. <result property="managerTime" column="manager_time" />
  32. <result property="zjlTime" column="zjl_time" />
  33. <result property="dszTime" column="dsz_time" />
  34. <result property="lendTime" column="lend_time" />
  35. <result property="lendDocument" column="lend_document" />
  36. <result property="borrowDocument" column="borrow_document" />
  37. <result property="unionTime" column="union_time" />
  38. <association property="applierUser" javaType="SysUser" resultMap="ApplierUserResult" />
  39. <association property="deptUser" javaType="SysUser" resultMap="DeptUserResult" />
  40. <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
  41. <association property="zjlUser" javaType="SysUser" resultMap="ZjlUserResult" />
  42. <association property="dszUser" javaType="SysUser" resultMap="DszUserResult" />
  43. <association property="unionUser" javaType="SysUser" resultMap="UnionUserResult" />
  44. <association property="cwUser" javaType="SysUser" resultMap="CwUserResult" />
  45. <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
  46. <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
  47. </resultMap>
  48. <resultMap type="SysUser" id="ApplierUserResult">
  49. <result property="userId" column="user_id" />
  50. <result property="nickName" column="applier_nick_name" />
  51. </resultMap>
  52. <resultMap type="SysUser" id="DeptUserResult">
  53. <result property="userId" column="user_id" />
  54. <result property="nickName" column="dept_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="SysUser" id="DszUserResult">
  65. <result property="userId" column="user_id" />
  66. <result property="nickName" column="dsz_nick_name" />
  67. </resultMap>
  68. <resultMap type="SysUser" id="UnionUserResult">
  69. <result property="userId" column="user_id" />
  70. <result property="nickName" column="union_nick_name" />
  71. </resultMap>
  72. <resultMap type="SysUser" id="CwUserResult">
  73. <result property="userId" column="user_id" />
  74. <result property="nickName" column="cw_nick_name" />
  75. </resultMap>
  76. <resultMap type="SysDept" id="SysDeptResult">
  77. <result property="deptId" column="dept_id" />
  78. <result property="deptName" column="dept_name" />
  79. </resultMap>
  80. <resultMap type="CmcProject" id="CmcProjectResult">
  81. <result property="projectId" column="project_id" />
  82. <result property="projectNumber" column="project_number" />
  83. <result property="projectName" column="project_name" />
  84. <result property="undertakingDept" column="undertaking_dept" />
  85. </resultMap>
  86. <sql id="selectCmcBorrowVo">
  87. select b.borrow_id, b.project_id, p.project_number, p.project_name, p.undertaking_dept, b.apply_reason, b.applier, u.nick_name as applier_nick_name, d.dept_name, b.apply_dept, b.remark, b.borrow_usage,
  88. b.apply_date, b.apply_amount, b.manager_amount, b.dept_comment, b.dept_user_id, u1.nick_name as dept_nick_name, b.manager_comment, b.manager_user_id, u2.nick_name as manager_nick_name,
  89. b.zjl_user_id, u3.nick_name as zjl_nick_name, b.zjl_comment, b.dsz_comment, b.union_user_id, u4.nick_name as union_nick_name, b.union_comment, b.cw_user_id, u5.nick_name as cw_nick_name,
  90. b.dsz_user_id, u6.nick_name as dsz_nick_name, b.cw_comment, b.dept_time, b.manager_time, b.zjl_time, b.dsz_time, b.lend_time, b.lend_document, b.borrow_document, b.union_time from cmc_borrow as b
  91. left join sys_user as u on u.user_id = b.applier
  92. left join sys_user as u1 on u1.user_id = b.dept_user_id
  93. left join sys_user as u2 on u2.user_id = b.manager_user_id
  94. left join sys_user as u3 on u3.user_id = b.zjl_user_id
  95. left join sys_user as u4 on u4.user_id = b.union_user_id
  96. left join sys_user as u5 on u5.user_id = b.cw_user_id
  97. left join sys_user as u6 on u6.user_id = b.dsz_user_id
  98. left join sys_dept as d on d.dept_id = b.apply_dept
  99. left join cmc_project as p on b.project_id = p.project_id
  100. </sql>
  101. <select id="selectCmcBorrowList" parameterType="CmcBorrow" resultMap="CmcBorrowResult">
  102. <include refid="selectCmcBorrowVo"/>
  103. <where>
  104. <if test="projectId != null and projectId != ''"> and b.project_id = #{projectId}</if>
  105. <if test="undertakingDept != null and undertakingDept != ''"> and find_in_set(#{undertakingDept}, p.undertaking_dept)</if>
  106. <if test="applyReason != null and applyReason != ''"> and b.apply_reason = #{applyReason}</if>
  107. <if test="borrowUsage != null and borrowUsage != ''"> and b.borrow_usage = #{borrowUsage}</if>
  108. <if test="applyDept != null and applyDept != ''"> and b.apply_dept = #{applyDept}</if>
  109. <if test="applier != null "> and b.applier = #{applier}</if>
  110. <if test="remark != null "> and b.remark = #{remark}</if>
  111. <if test="applyDate != null "> and YEAR(b.apply_date) = YEAR(#{applyDate})</if>
  112. <if test="applyAmount != null "> and b.apply_amount = #{applyAmount}</if>
  113. <if test="managerAmount != null "> and b.manager_amount = #{managerAmount}</if>
  114. <if test="deptComment != null and deptComment != ''"> and b.dept_comment = #{deptComment}</if>
  115. <if test="deptUserId != null "> and b.dept_user_id = #{deptUserId}</if>
  116. <if test="managerComment != null and managerComment != ''"> and b.manager_comment = #{managerComment}</if>
  117. <if test="managerUserId != null "> and b.manager_user_id = #{managerUserId}</if>
  118. <if test="zjlUserId != null "> and b.zjl_user_id = #{zjlUserId}</if>
  119. <if test="zjlComment != null and zjlComment != ''"> and b.zjl_comment = #{zjlComment}</if>
  120. <if test="dszUserId != null "> and b.dsz_user_id = #{dszUserId}</if>
  121. <if test="dszComment != null and dszComment != ''"> and b.dsz_comment = #{dszComment}</if>
  122. <if test="unionUserId != null "> and b.union_user_id = #{unionUserId}</if>
  123. <if test="unionComment != null and unionComment != ''"> and b.union_comment = #{unionComment}</if>
  124. <if test="cwUserId != null "> and b.cw_user_id = #{cwUserId}</if>
  125. <if test="cwComment != null and cwComment != ''"> and b.cw_comment = #{cwComment}</if>
  126. <if test="deptTime != null "> and b.dept_time = #{deptTime}</if>
  127. <if test="managerTime != null "> and b.manager_time = #{managerTime}</if>
  128. <if test="zjlTime != null "> and b.zjl_time = #{zjlTime}</if>
  129. <if test="dszTime != null "> and b.dsz_time = #{dszTime}</if>
  130. <if test="lendTime != null "> and b.lend_time = #{lendTime}</if>
  131. <if test="unionTime != null "> and b.union_time = #{unionTime}</if>
  132. </where>
  133. order by b.apply_date desc
  134. </select>
  135. <select id="selectCmcBorrowByBorrowId" parameterType="String" resultMap="CmcBorrowResult">
  136. <include refid="selectCmcBorrowVo"/>
  137. where b.borrow_id = #{borrowId}
  138. </select>
  139. <insert id="insertCmcBorrow" parameterType="CmcBorrow">
  140. insert into cmc_borrow
  141. <trim prefix="(" suffix=")" suffixOverrides=",">
  142. <if test="borrowId != null">borrow_id,</if>
  143. <if test="projectId != null">project_id,</if>
  144. <if test="applyReason != null">apply_reason,</if>
  145. <if test="borrowUsage != null">borrow_usage,</if>
  146. <if test="applier != null">applier,</if>
  147. <if test="remark != null">remark,</if>
  148. <if test="applyDept != null">apply_dept,</if>
  149. <if test="applyDate != null">apply_date,</if>
  150. <if test="applyAmount != null">apply_amount,</if>
  151. <if test="managerAmount != null">manager_amount,</if>
  152. <if test="deptComment != null">dept_comment,</if>
  153. <if test="deptUserId != null">dept_user_id,</if>
  154. <if test="managerComment != null">manager_comment,</if>
  155. <if test="managerUserId != null">manager_user_id,</if>
  156. <if test="zjlUserId != null">zjl_user_id,</if>
  157. <if test="zjlComment != null">zjl_comment,</if>
  158. <if test="dszUserId != null">dsz_user_id,</if>
  159. <if test="dszComment != null">dsz_comment,</if>
  160. <if test="unionUserId != null">union_user_id,</if>
  161. <if test="unionComment != null">union_comment,</if>
  162. <if test="cwUserId != null">cw_user_id,</if>
  163. <if test="cwComment != null">cw_comment,</if>
  164. <if test="deptTime != null">dept_time,</if>
  165. <if test="managerTime != null">manager_time,</if>
  166. <if test="zjlTime != null">zjl_time,</if>
  167. <if test="dszTime != null">dsz_time,</if>
  168. <if test="lendTime != null">lend_time,</if>
  169. <if test="unionTime != null">union_time,</if>
  170. <if test="lendDocument != null">lend_document,</if>
  171. <if test="borrowDocument != null">borrow_document,</if>
  172. </trim>
  173. <trim prefix="values (" suffix=")" suffixOverrides=",">
  174. <if test="borrowId != null">#{borrowId},</if>
  175. <if test="projectId != null">#{projectId},</if>
  176. <if test="applyReason != null">#{applyReason},</if>
  177. <if test="borrowUsage != null">#{borrowUsage},</if>
  178. <if test="applier != null">#{applier},</if>
  179. <if test="remark != null">#{remark},</if>
  180. <if test="applyDept != null">#{applyDept},</if>
  181. <if test="applyDate != null">#{applyDate},</if>
  182. <if test="applyAmount != null">#{applyAmount},</if>
  183. <if test="managerAmount != null">#{managerAmount},</if>
  184. <if test="deptComment != null">#{deptComment},</if>
  185. <if test="deptUserId != null">#{deptUserId},</if>
  186. <if test="managerComment != null">#{managerComment},</if>
  187. <if test="managerUserId != null">#{managerUserId},</if>
  188. <if test="zjlUserId != null">#{zjlUserId},</if>
  189. <if test="zjlComment != null">#{zjlComment},</if>
  190. <if test="dszUserId != null">#{dszUserId},</if>
  191. <if test="dszComment != null">#{dszComment},</if>
  192. <if test="unionUserId != null">#{unionUserId},</if>
  193. <if test="unionComment != null">#{unionComment},</if>
  194. <if test="cwUserId != null">#{cwUserId},</if>
  195. <if test="cwComment != null">#{cwComment},</if>
  196. <if test="deptTime != null">#{deptTime},</if>
  197. <if test="managerTime != null">#{managerTime},</if>
  198. <if test="zjlTime != null">#{zjlTime},</if>
  199. <if test="dszTime != null">#{dszTime},</if>
  200. <if test="unionTime != null">#{unionTime},</if>
  201. <if test="lendTime != null">#{lendTime},</if>
  202. <if test="lendDocument != null">#{lendDocument},</if>
  203. <if test="borrowDocument != null">#{borrowDocument},</if>
  204. </trim>
  205. </insert>
  206. <update id="updateCmcBorrow" parameterType="CmcBorrow">
  207. update cmc_borrow
  208. <trim prefix="SET" suffixOverrides=",">
  209. <if test="projectId != null">project_id = #{projectId},</if>
  210. <if test="applyReason != null">apply_reason = #{applyReason},</if>
  211. <if test="borrowUsage != null">borrow_usage = #{borrowUsage},</if>
  212. <if test="applier != null">applier = #{applier},</if>
  213. <if test="remark != null">remark = #{remark},</if>
  214. <if test="applyDept != null">apply_dept = #{applyDept},</if>
  215. <if test="applyDate != null">apply_date = #{applyDate},</if>
  216. <if test="applyAmount != null">apply_amount = #{applyAmount},</if>
  217. <if test="managerAmount != null">manager_amount = #{managerAmount},</if>
  218. <if test="deptComment != null">dept_comment = #{deptComment},</if>
  219. <if test="deptUserId != null">dept_user_id = #{deptUserId},</if>
  220. <if test="managerComment != null">manager_comment = #{managerComment},</if>
  221. <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
  222. <if test="zjlUserId != null">zjl_user_id = #{zjlUserId},</if>
  223. <if test="zjlComment != null">zjl_comment = #{zjlComment},</if>
  224. <if test="dszUserId != null">dsz_user_id = #{dszUserId},</if>
  225. <if test="dszComment != null">dsz_comment = #{dszComment},</if>
  226. <if test="unionUserId != null">union_user_id = #{unionUserId},</if>
  227. <if test="unionComment != null">zjl_comment = #{unionComment},</if>
  228. <if test="cwUserId != null">cw_user_id = #{cwUserId},</if>
  229. <if test="cwComment != null">cw_comment = #{cwComment},</if>
  230. <if test="deptTime != null">dept_time = #{deptTime},</if>
  231. <if test="managerTime != null">manager_time = #{managerTime},</if>
  232. <if test="zjlTime != null">zjl_time = #{zjlTime},</if>
  233. <if test="dszTime != null">dsz_time = #{dszTime},</if>
  234. <if test="unionTime != null">union_time = #{unionTime},</if>
  235. <if test="lendTime != null">lend_time = #{lendTime},</if>
  236. <if test="lendDocument != null">lend_document = #{lendDocument},</if>
  237. <if test="borrowDocument != null">borrow_document = #{borrowDocument},</if>
  238. </trim>
  239. where borrow_id = #{borrowId}
  240. </update>
  241. <delete id="deleteCmcBorrowByBorrowId" parameterType="String">
  242. delete from cmc_borrow where borrow_id = #{borrowId}
  243. </delete>
  244. <delete id="deleteCmcBorrowByBorrowIds" parameterType="String">
  245. delete from cmc_borrow where borrow_id in
  246. <foreach item="borrowId" collection="array" open="(" separator="," close=")">
  247. #{borrowId}
  248. </foreach>
  249. </delete>
  250. </mapper>