综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CmcCarApprovalMapper.xml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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="beginHalfday" column="begin_halfday" />
  18. <result property="endDate" column="end_date" />
  19. <result property="endHalfday" column="end_halfday" />
  20. <result property="days" column="days" />
  21. <result property="deptUserId" column="dept_user_id" />
  22. <result property="deptComment" column="dept_comment" />
  23. <result property="managerUserId" column="manager_user_id" />
  24. <result property="managerComment" column="manager_comment" />
  25. <result property="unionUserId" column="union_user_id" />
  26. <result property="unionComment" column="union_comment" />
  27. <result property="dispatcher" column="dispatcher" />
  28. <result property="dispatchComment" column="dispatch_comment" />
  29. <result property="estimateCost" column="estimate_cost" />
  30. <association property="applierUser" javaType="SysUser" resultMap="SysUserResult" />
  31. <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
  32. <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
  33. </resultMap>
  34. <resultMap type="SysUser" id="SysUserResult">
  35. <result property="userId" column="user_id" />
  36. <result property="nickName" column="nick_name" />
  37. </resultMap>
  38. <resultMap type="SysDept" id="SysDeptResult">
  39. <result property="deptId" column="dept_id" />
  40. <result property="deptName" column="dept_name" />
  41. </resultMap>
  42. <resultMap type="CmcProject" id="CmcProjectResult">
  43. <result property="projectId" column="project_id" />
  44. <result property="projectNumber" column="project_number" />
  45. <result property="projectName" column="project_name" />
  46. </resultMap>
  47. <sql id="selectCmcCarApprovalVo">
  48. select ca.car_apply_id, ca.applier, u.nick_name, ca.use_dept, d.dept_name, ca.cars, ca.drivers, ca.project_id, p.project_number, p.project_name, ca.apply_reason, ca.passengers, ca.apply_date, ca.begin_date, ca.begin_halfday, ca.end_date, ca.end_halfday, ca.days, ca.dept_user_id, ca.dept_comment, ca.manager_user_id, ca.manager_comment, ca.union_user_id, ca.union_comment, ca.dispatcher, ca.dispatch_comment, ca.estimate_cost from cmc_car_approval as ca
  49. left join sys_user as u on u.user_id = ca.applier
  50. left join sys_dept as d on d.dept_id = ca.use_dept
  51. left join cmc_project as p on ca.project_id = p.project_id
  52. </sql>
  53. <select id="selectCmcCarApprovalList" parameterType="CmcCarApproval" resultMap="CmcCarApprovalResult">
  54. <include refid="selectCmcCarApprovalVo"/>
  55. <where>
  56. <if test="applier != null "> and ca.applier = #{applier}</if>
  57. <if test="useDept != null "> and ca.use_dept = #{useDept}</if>
  58. <if test="cars != null and cars != ''"> and ca.cars = #{cars}</if>
  59. <if test="drivers != null and drivers != ''"> and ca.drivers = #{drivers}</if>
  60. <if test="projectId != null and projectId != ''"> and ca.project_id = #{projectId}</if>
  61. <if test="applyReason != null and applyReason != ''"> and ca.apply_reason = #{applyReason}</if>
  62. <if test="passengers != null "> and ca.passengers = #{passengers}</if>
  63. <if test="applyDate != null "> and ca.apply_date = #{beginDate}</if>
  64. <if test="beginDate != null "> and ca.begin_date = #{beginDate}</if>
  65. <if test="beginHalfday != null and beginHalfday != ''"> and ca.begin_halfday = #{beginHalfday}</if>
  66. <if test="endDate != null "> and ca.end_date = #{endDate}</if>
  67. <if test="endHalfday != null and endHalfday != ''"> and ca.end_halfday = #{endHalfday}</if>
  68. <if test="days != null "> and ca.days = #{days}</if>
  69. <if test="deptUserId != null "> and ca.dept_user_id = #{deptUserId}</if>
  70. <if test="deptComment != null and deptComment != ''"> and ca.dept_comment = #{deptComment}</if>
  71. <if test="managerUserId != null "> and ca.manager_user_id = #{managerUserId}</if>
  72. <if test="managerComment != null and managerComment != ''"> and ca.manager_comment = #{managerComment}</if>
  73. <if test="unionUserId != null "> and ca.union_user_id = #{unionUserId}</if>
  74. <if test="unionComment != null and unionComment != ''"> and ca.union_comment = #{unionComment}</if>
  75. <if test="dispatcher != null "> and ca.dispatcher = #{dispatcher}</if>
  76. <if test="dispatchComment != null and dispatchComment != ''"> and ca.dispatch_comment = #{dispatchComment}</if>
  77. <if test="estimateCost != null "> and ca.estimate_cost = #{estimateCost}</if>
  78. </where>
  79. </select>
  80. <select id="selectCmcCarApprovalByCarApplyId" parameterType="String" resultMap="CmcCarApprovalResult">
  81. <include refid="selectCmcCarApprovalVo"/>
  82. where car_apply_id = #{carApplyId}
  83. </select>
  84. <insert id="insertCmcCarApproval" parameterType="CmcCarApproval">
  85. insert into cmc_car_approval
  86. <trim prefix="(" suffix=")" suffixOverrides=",">
  87. <if test="carApplyId != null">car_apply_id,</if>
  88. <if test="applier != null">applier,</if>
  89. <if test="useDept != null">use_dept,</if>
  90. <if test="cars != null">cars,</if>
  91. <if test="drivers != null">drivers,</if>
  92. <if test="projectId != null">project_id,</if>
  93. <if test="applyReason != null">apply_reason,</if>
  94. <if test="passengers != null">passengers,</if>
  95. <if test="applyDate != null">apply_date,</if>
  96. <if test="beginDate != null">begin_date,</if>
  97. <if test="beginHalfday != null">begin_halfday,</if>
  98. <if test="endDate != null">end_date,</if>
  99. <if test="endHalfday != null">end_halfday,</if>
  100. <if test="days != null">days,</if>
  101. <if test="deptUserId != null">dept_user_id,</if>
  102. <if test="deptComment != null">dept_comment,</if>
  103. <if test="managerUserId != null">manager_user_id,</if>
  104. <if test="managerComment != null">manager_comment,</if>
  105. <if test="unionUserId != null">union_user_id,</if>
  106. <if test="unionComment != null">union_comment,</if>
  107. <if test="dispatcher != null">dispatcher,</if>
  108. <if test="dispatchComment != null">dispatch_comment,</if>
  109. <if test="estimateCost != null">estimate_cost,</if>
  110. </trim>
  111. <trim prefix="values (" suffix=")" suffixOverrides=",">
  112. <if test="carApplyId != null">#{carApplyId},</if>
  113. <if test="applier != null">#{applier},</if>
  114. <if test="useDept != null">#{useDept},</if>
  115. <if test="cars != null">#{cars},</if>
  116. <if test="drivers != null">#{drivers},</if>
  117. <if test="projectId != null">#{projectId},</if>
  118. <if test="applyReason != null">#{applyReason},</if>
  119. <if test="passengers != null">#{passengers},</if>
  120. <if test="applyDate != null">#{applyDate},</if>
  121. <if test="beginDate != null">#{beginDate},</if>
  122. <if test="beginHalfday != null">#{beginHalfday},</if>
  123. <if test="endDate != null">#{endDate},</if>
  124. <if test="endHalfday != null">#{endHalfday},</if>
  125. <if test="days != null">#{days},</if>
  126. <if test="deptUserId != null">#{deptUserId},</if>
  127. <if test="deptComment != null">#{deptComment},</if>
  128. <if test="managerUserId != null">#{managerUserId},</if>
  129. <if test="managerComment != null">#{managerComment},</if>
  130. <if test="unionUserId != null">#{unionUserId},</if>
  131. <if test="unionComment != null">#{unionComment},</if>
  132. <if test="dispatcher != null">#{dispatcher},</if>
  133. <if test="dispatchComment != null">#{dispatchComment},</if>
  134. <if test="estimateCost != null">#{estimateCost},</if>
  135. </trim>
  136. </insert>
  137. <update id="updateCmcCarApproval" parameterType="CmcCarApproval">
  138. update cmc_car_approval
  139. <trim prefix="SET" suffixOverrides=",">
  140. <if test="applier != null">applier = #{applier},</if>
  141. <if test="useDept != null">use_dept = #{useDept},</if>
  142. <if test="cars != null">cars = #{cars},</if>
  143. <if test="drivers != null">drivers = #{drivers},</if>
  144. <if test="projectId != null">project_id = #{projectId},</if>
  145. <if test="applyReason != null">apply_reason = #{applyReason},</if>
  146. <if test="passengers != null">passengers = #{passengers},</if>
  147. <if test="applyDate != null">apply_date = #{applyDate},</if>
  148. <if test="beginDate != null">begin_date = #{beginDate},</if>
  149. <if test="beginHalfday != null">begin_halfday = #{beginHalfday},</if>
  150. <if test="endDate != null">end_date = #{endDate},</if>
  151. <if test="endHalfday != null">end_halfday = #{endHalfday},</if>
  152. <if test="days != null">days = #{days},</if>
  153. <if test="deptUserId != null">dept_user_id = #{deptUserId},</if>
  154. <if test="deptComment != null">dept_comment = #{deptComment},</if>
  155. <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
  156. <if test="managerComment != null">manager_comment = #{managerComment},</if>
  157. <if test="unionUserId != null">union_user_id = #{unionUserId},</if>
  158. <if test="unionComment != null">union_comment = #{unionComment},</if>
  159. <if test="dispatcher != null">dispatcher = #{dispatcher},</if>
  160. <if test="dispatchComment != null">dispatch_comment = #{dispatchComment},</if>
  161. <if test="estimateCost != null">estimate_cost = #{estimateCost},</if>
  162. </trim>
  163. where car_apply_id = #{carApplyId}
  164. </update>
  165. <delete id="deleteCmcCarApprovalByCarApplyId" parameterType="String">
  166. delete from cmc_car_approval where car_apply_id = #{carApplyId}
  167. </delete>
  168. <delete id="deleteCmcCarApprovalByCarApplyIds" parameterType="String">
  169. delete from cmc_car_approval where car_apply_id in
  170. <foreach item="carApplyId" collection="array" open="(" separator="," close=")">
  171. #{carApplyId}
  172. </foreach>
  173. </delete>
  174. </mapper>