综合办公系统
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.

CmcSettleMapper.xml 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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.CmcSettleMapper">
  6. <resultMap type="CmcSettle" id="CmcSettleResult">
  7. <result property="settleId" column="settle_id" />
  8. <result property="projectId" column="project_id" />
  9. <result property="projectNumber" column="project_number" />
  10. <result property="undertakingDept" column="undertaking_dept" />
  11. <result property="reportDept" column="report_dept" />
  12. <result property="xmName" column="xm_name" />
  13. <result property="workloadReport" column="workload_report" />
  14. <result property="reporter" column="reporter" />
  15. <result property="reportTime" column="report_time" />
  16. <result property="settleComment" column="settle_comment" />
  17. <result property="zhUserId" column="zh_user_id" />
  18. <result property="zhTime" column="zh_time" />
  19. <result property="zhComment" column="zh_comment" />
  20. <result property="jsUserId" column="js_user_id" />
  21. <result property="jsTime" column="js_time" />
  22. <result property="jsComment" column="js_comment" />
  23. <result property="jyUserId" column="jy_user_id" />
  24. <result property="jyTime" column="jy_time" />
  25. <result property="jyComment" column="jy_comment" />
  26. <result property="managerUserId" column="manager_user_id" />
  27. <result property="managerTime" column="manager_time" />
  28. <result property="managerComment" column="manager_comment" />
  29. <result property="gmUserId" column="gm_user_id" />
  30. <result property="gmTime" column="gm_time" />
  31. <result property="gmComment" column="gm_comment" />
  32. <result property="dszUserId" column="dsz_user_id" />
  33. <result property="dszTime" column="dsz_time" />
  34. <result property="dszComment" column="dsz_comment" />
  35. <result property="settleDocument" column="settle_document" />
  36. <result property="modifyDocument" column="modify_document" />
  37. <result property="finalDocument" column="final_document" />
  38. <association property="reportUser" javaType="SysUser" resultMap="ReportUserResult" />
  39. <association property="zhUser" javaType="SysUser" resultMap="ZhUserResult" />
  40. <association property="jsUser" javaType="SysUser" resultMap="JsUserResult" />
  41. <association property="jyUser" javaType="SysUser" resultMap="JyUserResult" />
  42. <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
  43. <association property="gmUser" javaType="SysUser" resultMap="GmUserResult" />
  44. <association property="dszUser" javaType="SysUser" resultMap="DszUserResult" />
  45. <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
  46. <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
  47. </resultMap>
  48. <resultMap type="SysUser" id="ReportUserResult">
  49. <result property="userId" column="user_id" />
  50. <result property="nickName" column="report_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="JsUserResult">
  57. <result property="userId" column="user_id" />
  58. <result property="nickName" column="js_nick_name" />
  59. </resultMap>
  60. <resultMap type="SysUser" id="JyUserResult">
  61. <result property="userId" column="user_id" />
  62. <result property="nickName" column="jy_nick_name" />
  63. </resultMap>
  64. <resultMap type="SysUser" id="ManagerUserResult">
  65. <result property="userId" column="user_id" />
  66. <result property="nickName" column="manager_nick_name" />
  67. </resultMap>
  68. <resultMap type="SysUser" id="GmUserResult">
  69. <result property="userId" column="user_id" />
  70. <result property="nickName" column="gm_nick_name" />
  71. </resultMap>
  72. <resultMap type="SysUser" id="DszUserResult">
  73. <result property="userId" column="user_id" />
  74. <result property="nickName" column="dsz_nick_name" />
  75. </resultMap>
  76. <resultMap type="CmcProject" id="CmcProjectResult">
  77. <result property="projectId" column="project_id" />
  78. <result property="projectNumber" column="project_number" />
  79. <result property="projectName" column="project_name" />
  80. <result property="undertakingDept" column="undertaking_dept" />
  81. </resultMap>
  82. <resultMap type="SysDept" id="SysDeptResult">
  83. <result property="deptId" column="dept_id" />
  84. <result property="deptName" column="dept_name" />
  85. </resultMap>
  86. <sql id="selectCmcSettleVo">
  87. select s.settle_id, s.project_id, p.project_number, p.project_name, p.undertaking_dept, s.xm_name, s.workload_report, s.reporter, u.nick_name as report_nick_name, s.report_time, s.settle_comment, s.zh_user_id, u1.nick_name as zh_nick_name,
  88. s.zh_time, s.zh_comment, s.js_user_id, u2.nick_name as js_nick_name, s.js_time, s.js_comment, s.jy_user_id, u3.nick_name as jy_nick_name, s.jy_time, s.jy_comment,
  89. s.manager_user_id, u4.nick_name as manager_nick_name, s.manager_time, s.manager_comment, s.gm_user_id, u5.nick_name as gm_nick_name, s.gm_time, s.gm_comment,
  90. s.dsz_user_id, u6.nick_name as dsz_nick_name, s.dsz_time, s.dsz_comment, s.settle_document, s.modify_document, s.final_document, s.report_dept, d.dept_name from cmc_settle as s
  91. left join sys_user as u on u.user_id = s.reporter
  92. left join sys_user as u1 on u1.user_id = s.zh_user_id
  93. left join sys_user as u2 on u2.user_id = s.js_user_id
  94. left join sys_user as u3 on u3.user_id = s.jy_user_id
  95. left join sys_user as u4 on u4.user_id = s.manager_user_id
  96. left join sys_user as u5 on u5.user_id = s.gm_user_id
  97. left join sys_user as u6 on u6.user_id = s.dsz_user_id
  98. left join cmc_project as p on p.project_id = s.project_id
  99. left join sys_dept as d on d.dept_id = s.report_dept
  100. </sql>
  101. <select id="selectCmcSettleList" parameterType="CmcSettle" resultMap="CmcSettleResult">
  102. <include refid="selectCmcSettleVo"/>
  103. <where>
  104. <if test="settleId != null and settleId != ''"> and s.settle_id = #{settleId}</if>
  105. <if test="projectId != null"> and s.project_id = #{projectId}</if>
  106. <if test="projectNumber != null and projectNumber != ''"> and p.project_number like concat('%', #{projectNumber}, '%')</if>
  107. <if test="undertakingDept != null and undertakingDept != ''"> and find_in_set(#{undertakingDept}, p.undertaking_dept)</if>
  108. <if test="reportDept != null and reportDept != ''"> and s.report_dept = #{reportDept}</if>
  109. <if test="xmName != null"> and s.xm_name like concat('%', #{xmName}, '%')</if>
  110. <if test="workloadReport != null and workloadReport != ''"> and s.workload_report = #{workloadReport}</if>
  111. <if test="reporter != null "> and s.reporter = #{reporter}</if>
  112. <if test="reportTime != null "> and s.report_time = #{reportTime}</if>
  113. <if test="settleComment != null and settleComment != ''"> and s.settle_comment = #{settleComment}</if>
  114. <if test="zhUserId != null "> and s.zh_user_id = #{zhUserId}</if>
  115. <if test="zhTime != null "> and s.zh_time = #{zhTime}</if>
  116. <if test="zhComment != null and zhComment != ''"> and s.zh_comment = #{zhComment}</if>
  117. <if test="jsUserId != null "> and s.js_user_id = #{jsUserId}</if>
  118. <if test="jsTime != null "> and s.js_time = #{jsTime}</if>
  119. <if test="jsComment != null and jsComment != ''"> and s.js_comment = #{jsComment}</if>
  120. <if test="jyUserId != null "> and s.jy_user_id = #{jyUserId}</if>
  121. <if test="jyTime != null "> and s.jy_time = #{jyTime}</if>
  122. <if test="jyComment != null and jyComment != ''"> and s.jy_comment = #{jyComment}</if>
  123. <if test="managerUserId != null "> and s.manager_user_id = #{managerUserId}</if>
  124. <if test="managerTime != null "> and s.manager_time = #{managerTime}</if>
  125. <if test="managerComment != null and managerComment != ''"> and s.manager_comment = #{managerComment}</if>
  126. <if test="gmUserId != null "> and s.gm_user_id = #{gmUserId}</if>
  127. <if test="gmTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', gmTime) == '2000' "> and s.gm_time is not null</if>
  128. <if test="gmComment != null and gmComment != ''"> and s.gm_comment = #{gmComment}</if>
  129. </where>
  130. order by s.report_time desc
  131. </select>
  132. <select id="selectCmcSettleBySettleId" parameterType="String" resultMap="CmcSettleResult">
  133. <include refid="selectCmcSettleVo"/>
  134. where s.settle_id = #{settleId}
  135. </select>
  136. <insert id="insertCmcSettle" parameterType="CmcSettle">
  137. insert into cmc_settle
  138. <trim prefix="(" suffix=")" suffixOverrides=",">
  139. <if test="settleId != null">settle_id,</if>
  140. <if test="projectId != null">project_id,</if>
  141. <if test="xmName != null">xm_name,</if>
  142. <if test="workloadReport != null">workload_report,</if>
  143. <if test="reporter != null">reporter,</if>
  144. <if test="reportTime != null">report_time,</if>
  145. <if test="settleComment != null">settle_comment,</if>
  146. <if test="zhUserId != null">zh_user_id,</if>
  147. <if test="zhTime != null">zh_time,</if>
  148. <if test="zhComment != null">zh_comment,</if>
  149. <if test="jsUserId != null">js_user_id,</if>
  150. <if test="jsTime != null">js_time,</if>
  151. <if test="jsComment != null">js_comment,</if>
  152. <if test="jyUserId != null">jy_user_id,</if>
  153. <if test="jyTime != null">jy_time,</if>
  154. <if test="jyComment != null">jy_comment,</if>
  155. <if test="managerUserId != null">manager_user_id,</if>
  156. <if test="managerTime != null">manager_time,</if>
  157. <if test="managerComment != null">manager_comment,</if>
  158. <if test="gmUserId != null">gm_user_id,</if>
  159. <if test="gmTime != null">gm_time,</if>
  160. <if test="gmComment != null">gm_comment,</if>
  161. <if test="dszUserId != null">dsz_user_id,</if>
  162. <if test="dszTime != null">dsz_time,</if>
  163. <if test="dszComment != null">dsz_comment,</if>
  164. <if test="settleDocument != null">settle_document,</if>
  165. <if test="modifyDocument != null">modify_document,</if>
  166. <if test="finalDocument != null">final_document,</if>
  167. <if test="reportDept != null">report_dept,</if>
  168. </trim>
  169. <trim prefix="values (" suffix=")" suffixOverrides=",">
  170. <if test="settleId != null">#{settleId},</if>
  171. <if test="projectId != null">#{projectId},</if>
  172. <if test="xmName != null">#{xmName},</if>
  173. <if test="workloadReport != null">#{workloadReport},</if>
  174. <if test="reporter != null">#{reporter},</if>
  175. <if test="reportTime != null">#{reportTime},</if>
  176. <if test="settleComment != null">#{settleComment},</if>
  177. <if test="zhUserId != null">#{zhUserId},</if>
  178. <if test="zhTime != null">#{zhTime},</if>
  179. <if test="zhComment != null">#{zhComment},</if>
  180. <if test="jsUserId != null">#{jsUserId},</if>
  181. <if test="jsTime != null">#{jsTime},</if>
  182. <if test="jsComment != null">#{jsComment},</if>
  183. <if test="jyUserId != null">#{jyUserId},</if>
  184. <if test="jyTime != null">#{jyTime},</if>
  185. <if test="jyComment != null">#{jyComment},</if>
  186. <if test="managerUserId != null">#{managerUserId},</if>
  187. <if test="managerTime != null">#{managerTime},</if>
  188. <if test="managerComment != null">#{managerComment},</if>
  189. <if test="gmUserId != null">#{gmUserId},</if>
  190. <if test="gmTime != null">#{gmTime},</if>
  191. <if test="gmComment != null">#{gmComment},</if>
  192. <if test="dszUserId != null">#{dszUserId},</if>
  193. <if test="dszTime != null">#{dszTime},</if>
  194. <if test="dszComment != null">#{dszComment},</if>
  195. <if test="settleDocument != null">#{settleDocument},</if>
  196. <if test="modifyDocument != null">#{modifyDocument},</if>
  197. <if test="finalDocument != null">#{finalDocument},</if>
  198. <if test="reportDept != null">#{reportDept},</if>
  199. </trim>
  200. </insert>
  201. <update id="updateCmcSettle" parameterType="CmcSettle">
  202. update cmc_settle
  203. <trim prefix="SET" suffixOverrides=",">
  204. <if test="projectId != null">project_id = #{projectId},</if>
  205. <if test="xmName != null">xm_name = #{xmName},</if>
  206. <if test="workloadReport != null">workload_report = #{workloadReport},</if>
  207. <if test="reporter != null">reporter = #{reporter},</if>
  208. <if test="reportTime != null">report_time = #{reportTime},</if>
  209. <if test="settleComment != null">settle_comment = #{settleComment},</if>
  210. <if test="zhUserId != null">zh_user_id = #{zhUserId},</if>
  211. <if test="zhTime != null">zh_time = #{zhTime},</if>
  212. <if test="zhComment != null">zh_comment = #{zhComment},</if>
  213. <if test="jsUserId != null">js_user_id = #{jsUserId},</if>
  214. <if test="jsTime != null">js_time = #{jsTime},</if>
  215. <if test="jsComment != null">js_comment = #{jsComment},</if>
  216. <if test="jyUserId != null">jy_user_id = #{jyUserId},</if>
  217. <if test="jyTime != null">jy_time = #{jyTime},</if>
  218. <if test="jyComment != null">jy_comment = #{jyComment},</if>
  219. <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
  220. <if test="managerTime != null">manager_time = #{managerTime},</if>
  221. <if test="managerComment != null">manager_comment = #{managerComment},</if>
  222. <if test="gmUserId != null">gm_user_id = #{gmUserId},</if>
  223. <if test="gmTime != null">gm_time = #{gmTime},</if>
  224. <if test="gmComment != null">gm_comment = #{gmComment},</if>
  225. <if test="dszUserId != null">dsz_user_id = #{dszUserId},</if>
  226. <if test="dszTime != null">dsz_time = #{dszTime},</if>
  227. <if test="dszComment != null">dsz_comment = #{dszComment},</if>
  228. <if test="settleDocument != null">settle_document = #{settleDocument},</if>
  229. <if test="modifyDocument != null">modify_document = #{modifyDocument},</if>
  230. <if test="finalDocument != null">final_document = #{finalDocument},</if>
  231. <if test="reportDept != null">report_dept = #{reportDept},</if>
  232. </trim>
  233. where settle_id = #{settleId}
  234. </update>
  235. <delete id="deleteCmcSettleBySettleId" parameterType="String">
  236. delete from cmc_settle where settle_id = #{settleId}
  237. </delete>
  238. <delete id="deleteCmcSettleBySettleIds" parameterType="String">
  239. delete from cmc_settle where settle_id in
  240. <foreach item="settleId" collection="array" open="(" separator="," close=")">
  241. #{settleId}
  242. </foreach>
  243. </delete>
  244. </mapper>