WorkflowStepStaffServiceDaoImplMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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="workflowStepStaffServiceDaoImpl">
  6. <!-- 保存工作流节点信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessWorkflowStepStaffInfo" parameterType="Map">
  8. insert into business_workflow_step_staff(
  9. wss_id,operate,step_id,staff_name,b_id,community_id,staff_id,staff_role
  10. ) values (
  11. #{wssId},#{operate},#{stepId},#{staffName},#{bId},#{communityId},#{staffId},#{staffRole}
  12. )
  13. </insert>
  14. <!-- 查询工作流节点信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessWorkflowStepStaffInfo" parameterType="Map" resultType="Map">
  16. select t.wss_id,t.wss_id wssId,t.operate,t.step_id,t.step_id stepId,t.staff_name,t.staff_name
  17. staffName,t.b_id,t.b_id bId,t.community_id,t.community_id communityId,t.staff_id,t.staff_id staffId,t.staff_role,
  18. t.staff_role staffRole
  19. from business_workflow_step_staff t
  20. where 1 =1
  21. <if test="wssId !=null and wssId != ''">
  22. and t.wss_id= #{wssId}
  23. </if>
  24. <if test="operate !=null and operate != ''">
  25. and t.operate= #{operate}
  26. </if>
  27. <if test="stepId !=null and stepId != ''">
  28. and t.step_id= #{stepId}
  29. </if>
  30. <if test="staffName !=null and staffName != ''">
  31. and t.staff_name= #{staffName}
  32. </if>
  33. <if test="bId !=null and bId != ''">
  34. and t.b_id= #{bId}
  35. </if>
  36. <if test="communityId !=null and communityId != ''">
  37. and t.community_id= #{communityId}
  38. </if>
  39. <if test="staffId !=null and staffId != ''">
  40. and t.staff_id= #{staffId}
  41. </if>
  42. </select>
  43. <!-- 保存工作流节点信息至 instance表中 add by wuxw 2018-07-03 -->
  44. <insert id="saveWorkflowStepStaffInfoInstance" parameterType="Map">
  45. insert into workflow_step_staff(
  46. wss_id,step_id,staff_name,status_cd,b_id,community_id,staff_id,staff_role
  47. ) select t.wss_id,t.step_id,t.staff_name,'0',t.b_id,t.community_id,t.staff_id,t.staff_role
  48. from business_workflow_step_staff
  49. t where 1=1
  50. <if test="wssId !=null and wssId != ''">
  51. and t.wss_id= #{wssId}
  52. </if>
  53. and t.operate= 'ADD'
  54. <if test="stepId !=null and stepId != ''">
  55. and t.step_id= #{stepId}
  56. </if>
  57. <if test="staffName !=null and staffName != ''">
  58. and t.staff_name= #{staffName}
  59. </if>
  60. <if test="bId !=null and bId != ''">
  61. and t.b_id= #{bId}
  62. </if>
  63. <if test="communityId !=null and communityId != ''">
  64. and t.community_id= #{communityId}
  65. </if>
  66. <if test="staffId !=null and staffId != ''">
  67. and t.staff_id= #{staffId}
  68. </if>
  69. </insert>
  70. <!-- 查询工作流节点信息 add by wuxw 2018-07-03 -->
  71. <select id="getWorkflowStepStaffInfo" parameterType="Map" resultType="Map">
  72. select t.wss_id,t.wss_id wssId,t.step_id,t.step_id stepId,t.staff_name,t.staff_name
  73. staffName,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.community_id,t.community_id
  74. communityId,t.staff_id,t.staff_id staffId,t.staff_role,t.staff_role staffRole
  75. from workflow_step_staff t
  76. where 1 =1
  77. <if test="wssId !=null and wssId != ''">
  78. and t.wss_id= #{wssId}
  79. </if>
  80. <if test="stepId !=null and stepId != ''">
  81. and t.step_id= #{stepId}
  82. </if>
  83. <if test="staffName !=null and staffName != ''">
  84. and t.staff_name= #{staffName}
  85. </if>
  86. <if test="statusCd !=null and statusCd != ''">
  87. and t.status_cd= #{statusCd}
  88. </if>
  89. <if test="bId !=null and bId != ''">
  90. and t.b_id= #{bId}
  91. </if>
  92. <if test="communityId !=null and communityId != ''">
  93. and t.community_id= #{communityId}
  94. </if>
  95. <if test="staffId !=null and staffId != ''">
  96. and t.staff_id= #{staffId}
  97. </if>
  98. <if test="staffRole !=null and staffRole != ''">
  99. and t.staff_role= #{staffRole}
  100. </if>
  101. order by t.create_time desc
  102. <if test="page != -1 and page != null ">
  103. limit #{page}, #{row}
  104. </if>
  105. </select>
  106. <!-- 修改工作流节点信息 add by wuxw 2018-07-03 -->
  107. <update id="updateWorkflowStepStaffInfoInstance" parameterType="Map">
  108. update workflow_step_staff t set t.status_cd = #{statusCd}
  109. <if test="newBId != null and newBId != ''">
  110. ,t.b_id = #{newBId}
  111. </if>
  112. <if test="stepId !=null and stepId != ''">
  113. , t.step_id= #{stepId}
  114. </if>
  115. <if test="staffName !=null and staffName != ''">
  116. , t.staff_name= #{staffName}
  117. </if>
  118. <if test="communityId !=null and communityId != ''">
  119. , t.community_id= #{communityId}
  120. </if>
  121. <if test="staffId !=null and staffId != ''">
  122. , t.staff_id= #{staffId}
  123. </if>
  124. <if test="staffRole !=null and staffRole != ''">
  125. , t.staff_role= #{staffRole}
  126. </if>
  127. where 1=1
  128. <if test="wssId !=null and wssId != ''">
  129. and t.wss_id= #{wssId}
  130. </if>
  131. <if test="bId !=null and bId != ''">
  132. and t.b_id= #{bId}
  133. </if>
  134. </update>
  135. <!-- 查询工作流节点数量 add by wuxw 2018-07-03 -->
  136. <select id="queryWorkflowStepStaffsCount" parameterType="Map" resultType="Map">
  137. select count(1) count
  138. from workflow_step_staff t
  139. where 1 =1
  140. <if test="wssId !=null and wssId != ''">
  141. and t.wss_id= #{wssId}
  142. </if>
  143. <if test="stepId !=null and stepId != ''">
  144. and t.step_id= #{stepId}
  145. </if>
  146. <if test="staffName !=null and staffName != ''">
  147. and t.staff_name= #{staffName}
  148. </if>
  149. <if test="statusCd !=null and statusCd != ''">
  150. and t.status_cd= #{statusCd}
  151. </if>
  152. <if test="bId !=null and bId != ''">
  153. and t.b_id= #{bId}
  154. </if>
  155. <if test="communityId !=null and communityId != ''">
  156. and t.community_id= #{communityId}
  157. </if>
  158. <if test="staffId !=null and staffId != ''">
  159. and t.staff_id= #{staffId}
  160. </if>
  161. </select>
  162. </mapper>