综合办公系统
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

CmcProcureApprovalMapper.xml 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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.CmcProcureApprovalMapper">
  6. <resultMap type="CmcProcureApproval" id="CmcProcureApprovalResult">
  7. <result property="procureApplyId" column="procure_apply_id" />
  8. <result property="applyReason" column="apply_reason" />
  9. <result property="applier" column="applier" />
  10. <result property="applyDept" column="apply_dept" />
  11. <result property="applyTime" column="apply_time" />
  12. <result property="managerUserId" column="manager_user_id" />
  13. <result property="managerComment" column="manager_comment" />
  14. <result property="managerTime" column="manager_time" />
  15. <result property="zjlUserId" column="zjl_user_id" />
  16. <result property="zjlComment" column="zjl_comment" />
  17. <result property="zjlTime" column="zjl_time" />
  18. <result property="planUserId" column="plan_user_id" />
  19. <result property="planTime" column="plan_time" />
  20. <result property="planComment" column="plan_comment" />
  21. <association property="applierUser" javaType="SysUser" resultMap="ApplierUserResult" />
  22. <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
  23. <association property="zjlUser" javaType="SysUser" resultMap="ZjlUserResult" />
  24. <association property="planUser" javaType="SysUser" resultMap="PlanUserResult" />
  25. <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
  26. </resultMap>
  27. <resultMap type="SysUser" id="ApplierUserResult">
  28. <result property="userId" column="user_id" />
  29. <result property="nickName" column="applier_nick_name" />
  30. </resultMap>
  31. <resultMap type="SysUser" id="ManagerUserResult">
  32. <result property="userId" column="user_id" />
  33. <result property="nickName" column="manager_nick_name" />
  34. </resultMap>
  35. <resultMap type="SysUser" id="ZjlUserResult">
  36. <result property="userId" column="user_id" />
  37. <result property="nickName" column="zjl_nick_name" />
  38. </resultMap>
  39. <resultMap type="SysUser" id="PlanUserResult">
  40. <result property="userId" column="user_id" />
  41. <result property="nickName" column="plan_nick_name" />
  42. </resultMap>
  43. <resultMap type="SysDept" id="SysDeptResult">
  44. <result property="deptId" column="dept_id" />
  45. <result property="deptName" column="dept_name" />
  46. </resultMap>
  47. <sql id="selectCmcProcureApprovalVo">
  48. select pa.procure_apply_id, pa.apply_reason, pa.applier, u.nick_name as applier_nick_name, pa.apply_dept, d.dept_name, pa.apply_time,
  49. pa.manager_user_id, u1.nick_name as manager_nick_name, pa.manager_comment, pa.manager_time, pa.zjl_user_id, u2.nick_name as zjl_nick_name,
  50. pa.zjl_comment, pa.zjl_time, pa.plan_user_id, u3.nick_name as plan_nick_name, pa.plan_time, pa.plan_comment from cmc_procure_approval as pa
  51. left join sys_user as u on u.user_id = pa.applier
  52. left join sys_user as u1 on u1.user_id = pa.manager_user_id
  53. left join sys_user as u2 on u2.user_id = pa.zjl_user_id
  54. left join sys_user as u3 on u3.user_id = pa.plan_user_id
  55. left join sys_dept as d on d.dept_id = pa.apply_dept
  56. </sql>
  57. <select id="selectCmcProcureApprovalList" parameterType="CmcProcureApproval" resultMap="CmcProcureApprovalResult">
  58. <include refid="selectCmcProcureApprovalVo"/>
  59. <where>
  60. <if test="applyReason != null and applyReason != ''"> and pa.apply_reason = #{applyReason}</if>
  61. <if test="applier != null "> and pa.applier = #{applier}</if>
  62. <if test="applyDept != null "> and pa.apply_dept = #{applyDept}</if>
  63. <if test="applyTime != null "> and pa.apply_time = #{applyTime}</if>
  64. <if test="managerUserId != null "> and pa.manager_user_id = #{managerUserId}</if>
  65. <if test="managerComment != null and managerComment != ''"> and pa.manager_comment = #{managerComment}</if>
  66. <if test="managerTime != null "> and pa.manager_time = #{managerTime}</if>
  67. <if test="zjlUserId != null "> and pa.zjl_user_id = #{zjlUserId}</if>
  68. <if test="zjlComment != null and zjlComment != ''"> and pa.zjl_comment = #{zjlComment}</if>
  69. <if test="zjlTime != null "> and pa.zjl_time = #{zjlTime}</if>
  70. <if test="planUserId != null "> and pa.plan_user_id = #{planUserId}</if>
  71. <if test="planTime != null "> and pa.plan_time = #{planTime}</if>
  72. <if test="planComment != null and planComment != ''"> and pa.plan_comment = #{planComment}</if>
  73. </where>
  74. order by pa.apply_time desc
  75. </select>
  76. <select id="selectCmcProcureApprovalByProcureApplyId" parameterType="String" resultMap="CmcProcureApprovalResult">
  77. <include refid="selectCmcProcureApprovalVo"/>
  78. where pa.procure_apply_id = #{procureApplyId}
  79. </select>
  80. <insert id="insertCmcProcureApproval" parameterType="CmcProcureApproval">
  81. insert into cmc_procure_approval
  82. <trim prefix="(" suffix=")" suffixOverrides=",">
  83. <if test="procureApplyId != null">procure_apply_id,</if>
  84. <if test="applyReason != null">apply_reason,</if>
  85. <if test="applier != null">applier,</if>
  86. <if test="applyDept != null">apply_dept,</if>
  87. <if test="applyTime != null">apply_time,</if>
  88. <if test="managerUserId != null">manager_user_id,</if>
  89. <if test="managerComment != null">manager_comment,</if>
  90. <if test="managerTime != null">manager_time,</if>
  91. <if test="zjlUserId != null">zjl_user_id,</if>
  92. <if test="zjlComment != null">zjl_comment,</if>
  93. <if test="zjlTime != null">zjl_time,</if>
  94. <if test="planUserId != null">plan_user_id,</if>
  95. <if test="planTime != null">plan_time,</if>
  96. <if test="planComment != null">plan_comment,</if>
  97. </trim>
  98. <trim prefix="values (" suffix=")" suffixOverrides=",">
  99. <if test="procureApplyId != null">#{procureApplyId},</if>
  100. <if test="applyReason != null">#{applyReason},</if>
  101. <if test="applier != null">#{applier},</if>
  102. <if test="applyDept != null">#{applyDept},</if>
  103. <if test="applyTime != null">#{applyTime},</if>
  104. <if test="managerUserId != null">#{managerUserId},</if>
  105. <if test="managerComment != null">#{managerComment},</if>
  106. <if test="managerTime != null">#{managerTime},</if>
  107. <if test="zjlUserId != null">#{zjlUserId},</if>
  108. <if test="zjlComment != null">#{zjlComment},</if>
  109. <if test="zjlTime != null">#{zjlTime},</if>
  110. <if test="planUserId != null">#{planUserId},</if>
  111. <if test="planTime != null">#{planTime},</if>
  112. <if test="planComment != null">#{planComment},</if>
  113. </trim>
  114. </insert>
  115. <update id="updateCmcProcureApproval" parameterType="CmcProcureApproval">
  116. update cmc_procure_approval
  117. <trim prefix="SET" suffixOverrides=",">
  118. <if test="applyReason != null">apply_reason = #{applyReason},</if>
  119. <if test="applier != null">applier = #{applier},</if>
  120. <if test="applyDept != null">apply_dept = #{applyDept},</if>
  121. <if test="applyTime != null">apply_time = #{applyTime},</if>
  122. <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
  123. <if test="managerComment != null">manager_comment = #{managerComment},</if>
  124. <if test="managerTime != null">manager_time = #{managerTime},</if>
  125. <if test="zjlUserId != null">zjl_user_id = #{zjlUserId},</if>
  126. <if test="zjlComment != null">zjl_comment = #{zjlComment},</if>
  127. <if test="zjlTime != null">zjl_time = #{zjlTime},</if>
  128. <if test="planUserId != null">plan_user_id = #{planUserId},</if>
  129. <if test="planTime != null">plan_time = #{planTime},</if>
  130. <if test="planComment != null">plan_comment = #{planComment},</if>
  131. </trim>
  132. where procure_apply_id = #{procureApplyId}
  133. </update>
  134. <delete id="deleteCmcProcureApprovalByProcureApplyId" parameterType="String">
  135. delete from cmc_procure_approval where procure_apply_id = #{procureApplyId}
  136. </delete>
  137. <delete id="deleteCmcProcureApprovalByProcureApplyIds" parameterType="String">
  138. delete from cmc_procure_approval where procure_apply_id in
  139. <foreach item="procureApplyId" collection="array" open="(" separator="," close=")">
  140. #{procureApplyId}
  141. </foreach>
  142. </delete>
  143. </mapper>