综合办公系统
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

CmcCarApprovalMapper.xml 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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.CmcCarApprovalMapper">
  6. <resultMap type="CmcCarApproval" id="CmcCarApprovalResult">
  7. <result property="carApplyId" column="car_apply_id" />
  8. <result property="applier" column="applier" />
  9. <result property="useDept" column="use_dept" />
  10. <result property="cars" column="cars" />
  11. <result property="drivers" column="drivers" />
  12. <result property="projectId" column="project_id" />
  13. <result property="applyReason" column="apply_reason" />
  14. <result property="passengers" column="passengers" />
  15. <result property="applyDate" column="apply_date" />
  16. <result property="beginDate" column="begin_date" />
  17. <result property="endDate" column="end_date" />
  18. <result property="days" column="days" />
  19. <result property="deptUserId" column="dept_user_id" />
  20. <result property="deptComment" column="dept_comment" />
  21. <result property="managerUserId" column="manager_user_id" />
  22. <result property="managerComment" column="manager_comment" />
  23. <result property="carUsage" column="car_usage" />
  24. <result property="unionUserId" column="union_user_id" />
  25. <result property="unionComment" column="union_comment" />
  26. <result property="gmUserId" column="gm_user_id" />
  27. <result property="gmComment" column="gm_comment" />
  28. <result property="dispatcher" column="dispatcher" />
  29. <result property="dispatchComment" column="dispatch_comment" />
  30. <result property="estimateCost" column="estimate_cost" />
  31. <result property="deptTime" column="dept_time" />
  32. <result property="managerTime" column="manager_time" />
  33. <result property="unionTime" column="union_time" />
  34. <result property="gmTime" column="gm_time" />
  35. <result property="dispatchTime" column="dispatch_time" />
  36. <association property="applierUser" javaType="SysUser" resultMap="ApplierUserResult" />
  37. <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
  38. <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
  39. <association property="deptUser" javaType="SysUser" resultMap="DeptUserResult" />
  40. <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
  41. <association property="unionUser" javaType="SysUser" resultMap="UnionUserResult" />
  42. <association property="gmUser" javaType="SysUser" resultMap="GmUserResult" />
  43. <association property="dispatchUser" javaType="SysUser" resultMap="DispatchUserResult" />
  44. </resultMap>
  45. <resultMap type="SysUser" id="ApplierUserResult">
  46. <result property="userId" column="user_id" />
  47. <result property="nickName" column="applier_nick_name" />
  48. </resultMap>
  49. <resultMap type="SysUser" id="DeptUserResult">
  50. <result property="userId" column="user_id" />
  51. <result property="nickName" column="dept_nick_name" />
  52. </resultMap>
  53. <resultMap type="SysUser" id="ManagerUserResult">
  54. <result property="userId" column="user_id" />
  55. <result property="nickName" column="manager_nick_name" />
  56. </resultMap>
  57. <resultMap type="SysUser" id="UnionUserResult">
  58. <result property="userId" column="user_id" />
  59. <result property="nickName" column="union_nick_name" />
  60. </resultMap>
  61. <resultMap type="SysUser" id="GmUserResult">
  62. <result property="userId" column="user_id" />
  63. <result property="nickName" column="gm_nick_name" />
  64. </resultMap>
  65. <resultMap type="SysUser" id="DispatchUserResult">
  66. <result property="userId" column="user_id" />
  67. <result property="nickName" column="dispatch_nick_name" />
  68. </resultMap>
  69. <resultMap type="SysDept" id="SysDeptResult">
  70. <result property="deptId" column="dept_id" />
  71. <result property="deptName" column="dept_name" />
  72. </resultMap>
  73. <resultMap type="CmcProject" id="CmcProjectResult">
  74. <result property="projectId" column="project_id" />
  75. <result property="projectNumber" column="project_number" />
  76. <result property="projectName" column="project_name" />
  77. </resultMap>
  78. <sql id="selectCmcCarApprovalVo">
  79. select ca.car_apply_id, ca.applier, u.nick_name as applier_nick_name, ca.use_dept, d.dept_name, ca.cars, ca.drivers, ca.project_id, p.project_number, p.project_name,
  80. ca.apply_reason, ca.passengers, ca.apply_date, ca.begin_date, ca.end_date, ca.days, ca.dept_user_id, u1.nick_name as dept_nick_name, ca.dept_comment, ca.manager_user_id,
  81. u2.nick_name as manager_nick_name, ca.manager_comment, ca.car_usage, ca.union_user_id, u3.nick_name as union_nick_name, ca.union_comment, ca.gm_user_id, u4.nick_name as gm_nick_name,
  82. ca.gm_comment, ca.dispatcher, u5.nick_name as dispatch_nick_name, ca.dispatch_comment, ca.estimate_cost, ca.dept_time, ca.manager_time, ca.union_time, ca.gm_time, ca.dispatch_time from cmc_car_approval as ca
  83. left join sys_user as u on u.user_id = ca.applier
  84. left join sys_user as u1 on u1.user_id = ca.dept_user_id
  85. left join sys_user as u2 on u2.user_id = ca.manager_user_id
  86. left join sys_user as u3 on u3.user_id = ca.union_user_id
  87. left join sys_user as u4 on u4.user_id = ca.gm_user_id
  88. left join sys_user as u5 on u5.user_id = ca.dispatcher
  89. left join sys_dept as d on d.dept_id = ca.use_dept
  90. left join cmc_project as p on ca.project_id = p.project_id
  91. </sql>
  92. <select id="selectCmcCarApprovalList" parameterType="CmcCarApproval" resultMap="CmcCarApprovalResult">
  93. <include refid="selectCmcCarApprovalVo"/>
  94. <where>
  95. <if test="applier != null "> and ca.applier = #{applier}</if>
  96. <if test="useDept != null "> and ca.use_dept = #{useDept}</if>
  97. <if test="cars != null and cars != ''"> and ca.cars = #{cars}</if>
  98. <if test="drivers != null and drivers != ''"> and ca.drivers = #{drivers}</if>
  99. <if test="projectId != null and projectId != ''"> and ca.project_id = #{projectId}</if>
  100. <if test="applyReason != null and applyReason != ''"> and ca.apply_reason = #{applyReason}</if>
  101. <if test="passengers != null "> and ca.passengers = #{passengers}</if>
  102. <if test="applyDate != null "> and ca.apply_date = #{beginDate}</if>
  103. <if test="beginDate != null "> and ca.begin_date = #{beginDate}</if>
  104. <if test="endDate != null "> and ca.end_date = #{endDate}</if>
  105. <if test="days != null "> and ca.days = #{days}</if>
  106. <if test="deptUserId != null "> and ca.dept_user_id = #{deptUserId}</if>
  107. <if test="deptComment != null and deptComment != ''"> and ca.dept_comment = #{deptComment}</if>
  108. <if test="managerUserId != null "> and ca.manager_user_id = #{managerUserId}</if>
  109. <if test="managerComment != null and managerComment != ''"> and ca.manager_comment = #{managerComment}</if>
  110. <if test="carUsage != null and carUsage != ''"> and ca.car_usage = #{carUsage}</if>
  111. <if test="unionUserId != null "> and ca.union_user_id = #{unionUserId}</if>
  112. <if test="unionComment != null and unionComment != ''"> and ca.union_comment = #{unionComment}</if>
  113. <if test="gmUserId != null "> and ca.gm_user_id = #{gmUserId}</if>
  114. <if test="gmComment != null and gmComment != ''"> and ca.gm_comment = #{gmComment}</if>
  115. <if test="dispatcher != null "> and ca.dispatcher = #{dispatcher}</if>
  116. <if test="dispatchComment != null and dispatchComment != ''"> and ca.dispatch_comment = #{dispatchComment}</if>
  117. <if test="estimateCost != null "> and ca.estimate_cost = #{estimateCost}</if>
  118. </where>
  119. </select>
  120. <select id="selectCmcCarApprovalByCarApplyId" parameterType="String" resultMap="CmcCarApprovalResult">
  121. <include refid="selectCmcCarApprovalVo"/>
  122. where car_apply_id = #{carApplyId}
  123. </select>
  124. <insert id="insertCmcCarApproval" parameterType="CmcCarApproval">
  125. insert into cmc_car_approval
  126. <trim prefix="(" suffix=")" suffixOverrides=",">
  127. <if test="carApplyId != null">car_apply_id,</if>
  128. <if test="applier != null">applier,</if>
  129. <if test="useDept != null">use_dept,</if>
  130. <if test="cars != null">cars,</if>
  131. <if test="drivers != null">drivers,</if>
  132. <if test="projectId != null">project_id,</if>
  133. <if test="applyReason != null">apply_reason,</if>
  134. <if test="passengers != null">passengers,</if>
  135. <if test="applyDate != null">apply_date,</if>
  136. <if test="beginDate != null">begin_date,</if>
  137. <if test="endDate != null">end_date,</if>
  138. <if test="days != null">days,</if>
  139. <if test="deptUserId != null">dept_user_id,</if>
  140. <if test="deptComment != null">dept_comment,</if>
  141. <if test="managerUserId != null">manager_user_id,</if>
  142. <if test="managerComment != null">manager_comment,</if>
  143. <if test="carUsage != null">car_usage,</if>
  144. <if test="unionUserId != null">union_user_id,</if>
  145. <if test="unionComment != null">union_comment,</if>
  146. <if test="gmUserId != null">gm_user_id,</if>
  147. <if test="gmComment != null">gm_comment,</if>
  148. <if test="dispatcher != null">dispatcher,</if>
  149. <if test="dispatchComment != null">dispatch_comment,</if>
  150. <if test="estimateCost != null">estimate_cost,</if>
  151. </trim>
  152. <trim prefix="values (" suffix=")" suffixOverrides=",">
  153. <if test="carApplyId != null">#{carApplyId},</if>
  154. <if test="applier != null">#{applier},</if>
  155. <if test="useDept != null">#{useDept},</if>
  156. <if test="cars != null">#{cars},</if>
  157. <if test="drivers != null">#{drivers},</if>
  158. <if test="projectId != null">#{projectId},</if>
  159. <if test="applyReason != null">#{applyReason},</if>
  160. <if test="passengers != null">#{passengers},</if>
  161. <if test="applyDate != null">#{applyDate},</if>
  162. <if test="beginDate != null">#{beginDate},</if>
  163. <if test="endDate != null">#{endDate},</if>
  164. <if test="days != null">#{days},</if>
  165. <if test="deptUserId != null">#{deptUserId},</if>
  166. <if test="deptComment != null">#{deptComment},</if>
  167. <if test="managerUserId != null">#{managerUserId},</if>
  168. <if test="managerComment != null">#{managerComment},</if>
  169. <if test="carUsage != null">#{carUsage},</if>
  170. <if test="unionUserId != null">#{unionUserId},</if>
  171. <if test="unionComment != null">#{unionComment},</if>
  172. <if test="gmUserId != null">#{gmUserId},</if>
  173. <if test="gmComment != null">#{gmComment},</if>
  174. <if test="dispatcher != null">#{dispatcher},</if>
  175. <if test="dispatchComment != null">#{dispatchComment},</if>
  176. <if test="estimateCost != null">#{estimateCost},</if>
  177. </trim>
  178. </insert>
  179. <update id="updateCmcCarApproval" parameterType="CmcCarApproval">
  180. update cmc_car_approval
  181. <trim prefix="SET" suffixOverrides=",">
  182. <if test="applier != null">applier = #{applier},</if>
  183. <if test="useDept != null">use_dept = #{useDept},</if>
  184. <if test="cars != null">cars = #{cars},</if>
  185. <if test="drivers != null">drivers = #{drivers},</if>
  186. <if test="projectId != null">project_id = #{projectId},</if>
  187. <if test="applyReason != null">apply_reason = #{applyReason},</if>
  188. <if test="passengers != null">passengers = #{passengers},</if>
  189. <if test="applyDate != null">apply_date = #{applyDate},</if>
  190. <if test="beginDate != null">begin_date = #{beginDate},</if>
  191. <if test="endDate != null">end_date = #{endDate},</if>
  192. <if test="days != null">days = #{days},</if>
  193. <if test="deptUserId != null">dept_user_id = #{deptUserId},</if>
  194. <if test="deptComment != null">dept_comment = #{deptComment},</if>
  195. <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
  196. <if test="managerComment != null">manager_comment = #{managerComment},</if>
  197. <if test="carUsage != null">car_usage = #{carUsage},</if>
  198. <if test="unionUserId != null">union_user_id = #{unionUserId},</if>
  199. <if test="unionComment != null">union_comment = #{unionComment},</if>
  200. <if test="gmUserId != null">gm_user_id = #{gmUserId},</if>
  201. <if test="gmComment != null">gm_comment = #{gmComment},</if>
  202. <if test="dispatcher != null">dispatcher = #{dispatcher},</if>
  203. <if test="dispatchComment != null">dispatch_comment = #{dispatchComment},</if>
  204. <if test="estimateCost != null">estimate_cost = #{estimateCost},</if>
  205. <if test="deptTime != null ">dept_time = #{deptTime},</if>
  206. <if test="managerTime != null ">manager_time = #{managerTime},</if>
  207. <if test="unionTime != null ">union_time = #{unionTime},</if>
  208. <if test="gmTime != null ">gm_time = #{gmTime},</if>
  209. <if test="dispatchTime != null ">dispatch_time = #{dispatchTime}</if>
  210. </trim>
  211. where car_apply_id = #{carApplyId}
  212. </update>
  213. <delete id="deleteCmcCarApprovalByCarApplyId" parameterType="String">
  214. delete from cmc_car_approval where car_apply_id = #{carApplyId}
  215. </delete>
  216. <delete id="deleteCmcCarApprovalByCarApplyIds" parameterType="String">
  217. delete from cmc_car_approval where car_apply_id in
  218. <foreach item="carApplyId" collection="array" open="(" separator="," close=")">
  219. #{carApplyId}
  220. </foreach>
  221. </delete>
  222. </mapper>