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

CmcDeviceApprovalMapper.xml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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.CmcDeviceApprovalMapper">
  6. <resultMap type="CmcDeviceApproval" id="CmcDeviceApprovalResult">
  7. <result property="deviceApplyId" column="device_apply_id" />
  8. <result property="applier" column="applier" />
  9. <result property="useDept" column="use_dept" />
  10. <result property="devices" column="devices" />
  11. <result property="modifyDevices" column="modify_devices" />
  12. <result property="projectId" column="project_id" />
  13. <result property="applyReason" column="apply_reason" />
  14. <result property="applyDate" column="apply_date" />
  15. <result property="returnDate" column="return_date" />
  16. <result property="beginDate" column="begin_date" />
  17. <result property="endDate" column="end_date" />
  18. <result property="days" column="days" />
  19. <result property="managerUserId" column="manager_user_id" />
  20. <result property="managerComment" column="manager_comment" />
  21. <result property="dispatcher" column="dispatcher" />
  22. <result property="dispatchComment" column="dispatch_comment" />
  23. <result property="estimateCost" column="estimate_cost" />
  24. <result property="remark" column="remark" />
  25. <result property="state" column="state" />
  26. <result property="managerTime" column="manager_time" />
  27. <result property="dispatchTime" column="dispatch_time" />
  28. <association property="applierUser" javaType="SysUser" resultMap="SysUserResult" />
  29. <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
  30. <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
  31. <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
  32. <association property="dispatchUser" javaType="SysUser" resultMap="DispatchUserResult" />
  33. </resultMap>
  34. <resultMap type="SysUser" id="SysUserResult">
  35. <result property="userId" column="user_id" />
  36. <result property="nickName" column="applier_nick_name" />
  37. </resultMap>
  38. <resultMap type="SysUser" id="ManagerUserResult">
  39. <result property="userId" column="user_id" />
  40. <result property="nickName" column="manager_nick_name" />
  41. </resultMap>
  42. <resultMap type="SysUser" id="DispatchUserResult">
  43. <result property="userId" column="user_id" />
  44. <result property="nickName" column="dispatch_nick_name" />
  45. </resultMap>
  46. <resultMap type="SysDept" id="SysDeptResult">
  47. <result property="deptId" column="dept_id" />
  48. <result property="deptName" column="dept_name" />
  49. </resultMap>
  50. <resultMap type="CmcProject" id="CmcProjectResult">
  51. <result property="projectId" column="project_id" />
  52. <result property="projectNumber" column="project_number" />
  53. <result property="projectName" column="project_name" />
  54. </resultMap>
  55. <sql id="selectCmcDeviceApprovalVo">
  56. select da.device_apply_id, da.applier, u.nick_name as applier_nick_name, da.use_dept, d.dept_name, da.devices, da.modify_devices, da.project_id, p.project_number, p.project_name,
  57. da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.end_date, da.days, da.state, da.manager_user_id, u1.nick_name as manager_nick_name, da.manager_comment,
  58. da.dispatcher, u2.nick_name as dispatch_nick_name, da.dispatch_comment, da.estimate_cost, da.remark, da.manager_time, da.dispatch_time from cmc_device_approval as da
  59. left join sys_user as u on u.user_id = da.applier
  60. left join sys_user as u1 on u1.user_id = da.manager_user_id
  61. left join sys_user as u2 on u2.user_id = da.dispatcher
  62. left join sys_dept as d on d.dept_id = da.use_dept
  63. left join cmc_project as p on da.project_id = p.project_id
  64. </sql>
  65. <select id="selectCmcDeviceApprovalList" parameterType="CmcDeviceApproval" resultMap="CmcDeviceApprovalResult">
  66. <include refid="selectCmcDeviceApprovalVo"/>
  67. <where>
  68. <if test="applier != null "> and da.applier = #{applier}</if>
  69. <if test="useDept != null "> and da.use_dept = #{useDept}</if>
  70. <if test="devices != null and devices != ''"> and da.devices like concat('%', #{devices}, '%')</if>
  71. <if test="modifyDevices != null and modifyDevices != ''"> and da.modify_devices like concat('%', #{modifyDevices}, '%')</if>
  72. <if test="projectId != null and projectId != ''"> and da.project_id = #{projectId}</if>
  73. <if test="applyReason != null and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
  74. <if test="applyDate != null "> and da.apply_date = #{applyDate}</if>
  75. <if test="returnDate != null "> and da.return_date = #{returnDate}</if>
  76. <if test="beginDate != null "> and da.begin_date = #{beginDate}</if>
  77. <if test="endDate != null "> and da.end_date = #{endDate}</if>
  78. <if test="days != null "> and da.days = #{days}</if>
  79. <if test="managerUserId != null "> and da.manager_user_id = #{managerUserId}</if>
  80. <if test="managerComment != null and managerComment != ''"> and da.manager_comment = #{managerComment}</if>
  81. <if test="dispatcher != null "> and da.dispatcher = #{dispatcher}</if>
  82. <if test="dispatchComment != null and dispatchComment != ''"> and da.dispatch_comment = #{dispatchComment}</if>
  83. <if test="estimateCost != null "> and da.estimate_cost = #{estimateCost}</if>
  84. <if test="managerTime != null "> and da.manager_time = #{managerTime}</if>
  85. <if test="dispatchTime != null "> and da.dispatch_time = #{dispatchTime}</if>
  86. </where>
  87. </select>
  88. <select id="selectCmcDeviceApprovalByDeviceApplyId" parameterType="String" resultMap="CmcDeviceApprovalResult">
  89. <include refid="selectCmcDeviceApprovalVo"/>
  90. where da.device_apply_id = #{deviceApplyId}
  91. </select>
  92. <insert id="insertCmcDeviceApproval" parameterType="CmcDeviceApproval">
  93. insert into cmc_device_approval
  94. <trim prefix="(" suffix=")" suffixOverrides=",">
  95. <if test="deviceApplyId != null">device_apply_id,</if>
  96. <if test="applier != null">applier,</if>
  97. <if test="useDept != null">use_dept,</if>
  98. <if test="devices != null">devices,</if>
  99. <if test="modifyDevices != null">modify_devices,</if>
  100. <if test="projectId != null">project_id,</if>
  101. <if test="applyReason != null">apply_reason,</if>
  102. <if test="applyDate != null">apply_date,</if>
  103. <if test="returnDate != null">return_date,</if>
  104. <if test="beginDate != null">begin_date,</if>
  105. <if test="endDate != null">end_date,</if>
  106. <if test="days != null">days,</if>
  107. <if test="managerUserId != null">manager_user_id,</if>
  108. <if test="managerComment != null">manager_comment,</if>
  109. <if test="dispatcher != null">dispatcher,</if>
  110. <if test="dispatchComment != null">dispatch_comment,</if>
  111. <if test="estimateCost != null">estimate_cost,</if>
  112. <if test="remark != null">remark,</if>
  113. <if test="state != null">state,</if>
  114. <if test="managerTime != null">manager_time,</if>
  115. <if test="dispatchTime != null">dispatch_time,</if>
  116. </trim>
  117. <trim prefix="values (" suffix=")" suffixOverrides=",">
  118. <if test="deviceApplyId != null">#{deviceApplyId},</if>
  119. <if test="applier != null">#{applier},</if>
  120. <if test="useDept != null">#{useDept},</if>
  121. <if test="devices != null">#{devices},</if>
  122. <if test="modifyDevices != null">#{modifyDevices},</if>
  123. <if test="projectId != null">#{projectId},</if>
  124. <if test="applyReason != null">#{applyReason},</if>
  125. <if test="applyDate != null">#{applyDate},</if>
  126. <if test="returnDate != null">#{returnDate},</if>
  127. <if test="beginDate != null">#{beginDate},</if>
  128. <if test="endDate != null">#{endDate},</if>
  129. <if test="days != null">#{days},</if>
  130. <if test="managerUserId != null">#{managerUserId},</if>
  131. <if test="managerComment != null">#{managerComment},</if>
  132. <if test="dispatcher != null">#{dispatcher},</if>
  133. <if test="dispatchComment != null">#{dispatchComment},</if>
  134. <if test="estimateCost != null">#{estimateCost},</if>
  135. <if test="remark != null">#{remark},</if>
  136. <if test="state != null">#{state},</if>
  137. <if test="managerTime != null">#{managerTime},</if>
  138. <if test="dispatchTime != null">#{dispatchTime},</if>
  139. </trim>
  140. </insert>
  141. <update id="updateCmcDeviceApproval" parameterType="CmcDeviceApproval">
  142. update cmc_device_approval
  143. <trim prefix="SET" suffixOverrides=",">
  144. <if test="applier != null">applier = #{applier},</if>
  145. <if test="useDept != null">use_dept = #{useDept},</if>
  146. <if test="devices != null">devices = #{devices},</if>
  147. <if test="modifyDevices != null">modify_devices = #{modifyDevices},</if>
  148. <if test="projectId != null">project_id = #{projectId},</if>
  149. <if test="applyReason != null">apply_reason = #{applyReason},</if>
  150. <if test="applyDate != null">apply_date = #{applyDate},</if>
  151. <if test="returnDate != null">return_date = #{returnDate},</if>
  152. <if test="beginDate != null">begin_date = #{beginDate},</if>
  153. <if test="endDate != null">end_date = #{endDate},</if>
  154. <if test="days != null">days = #{days},</if>
  155. <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
  156. <if test="managerComment != null">manager_comment = #{managerComment},</if>
  157. <if test="dispatcher != null">dispatcher = #{dispatcher},</if>
  158. <if test="dispatchComment != null">dispatch_comment = #{dispatchComment},</if>
  159. <if test="estimateCost != null">estimate_cost = #{estimateCost},</if>
  160. <if test="remark != null">remark = #{remark},</if>
  161. <if test="state != null">state = #{state},</if>
  162. <if test="managerTime != null">manager_time = #{managerTime},</if>
  163. <if test="dispatchTime != null">dispatch_time = #{dispatchTime},</if>
  164. </trim>
  165. where device_apply_id = #{deviceApplyId}
  166. </update>
  167. <delete id="deleteCmcDeviceApprovalByDeviceApplyId" parameterType="String">
  168. delete from cmc_device_approval where device_apply_id = #{deviceApplyId}
  169. </delete>
  170. <delete id="deleteCmcDeviceApprovalByDeviceApplyIds" parameterType="String">
  171. delete from cmc_device_approval where device_apply_id in
  172. <foreach item="deviceApplyId" collection="array" open="(" separator="," close=")">
  173. #{deviceApplyId}
  174. </foreach>
  175. </delete>
  176. </mapper>