WorkflowServiceDaoImplMapper.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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="workflowServiceDaoImpl">
  6. <!-- 保存工作流信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessWorkflowInfo" parameterType="Map">
  8. insert into business_workflow(
  9. skip_level,operate,describle,b_id,community_id,store_id,flow_id,flow_name,flow_type,process_definition_key
  10. ) values (
  11. #{skipLevel},#{operate},#{describle},#{bId},#{communityId},#{storeId},#{flowId},#{flowName},#{flowType},#{processDefinitionKey}
  12. )
  13. </insert>
  14. <!-- 查询工作流信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessWorkflowInfo" parameterType="Map" resultType="Map">
  16. select t.skip_level,t.skip_level skipLevel,t.operate,t.describle,t.b_id,t.b_id bId,t.community_id,t.community_id
  17. communityId,t.store_id,t.store_id storeId,t.flow_id,t.flow_id flowId,t.flow_name,t.flow_name
  18. flowName,t.flow_type,t.flow_type flowType,t.process_definition_key,t.process_definition_key processDefinitionKey
  19. from business_workflow t
  20. where 1 =1
  21. <if test="skipLevel !=null and skipLevel != ''">
  22. and t.skip_level= #{skipLevel}
  23. </if>
  24. <if test="operate !=null and operate != ''">
  25. and t.operate= #{operate}
  26. </if>
  27. <if test="describle !=null and describle != ''">
  28. and t.describle= #{describle}
  29. </if>
  30. <if test="bId !=null and bId != ''">
  31. and t.b_id= #{bId}
  32. </if>
  33. <if test="communityId !=null and communityId != ''">
  34. and t.community_id in (#{communityId},'9999')
  35. </if>
  36. <if test="storeId !=null and storeId != ''">
  37. and t.store_id= #{storeId}
  38. </if>
  39. <if test="flowId !=null and flowId != ''">
  40. and t.flow_id= #{flowId}
  41. </if>
  42. <if test="flowName !=null and flowName != ''">
  43. and t.flow_name= #{flowName}
  44. </if>
  45. <if test="flowType !=null and flowType != ''">
  46. and t.flow_type= #{flowType}
  47. </if>
  48. </select>
  49. <!-- 保存工作流信息至 instance表中 add by wuxw 2018-07-03 -->
  50. <insert id="saveWorkflowInfoInstance" parameterType="Map">
  51. insert into workflow(
  52. skip_level,describle,status_cd,b_id,community_id,store_id,flow_id,flow_name,flow_type,process_definition_key
  53. ) select t.skip_level,t.describle,'0',t.b_id,t.community_id,t.store_id,t.flow_id,t.flow_name,t.flow_type ,t.process_definition_key
  54. from
  55. business_workflow t where 1=1
  56. <if test="skipLevel !=null and skipLevel != ''">
  57. and t.skip_level= #{skipLevel}
  58. </if>
  59. and t.operate= 'ADD'
  60. <if test="describle !=null and describle != ''">
  61. and t.describle= #{describle}
  62. </if>
  63. <if test="bId !=null and bId != ''">
  64. and t.b_id= #{bId}
  65. </if>
  66. <if test="communityId !=null and communityId != ''">
  67. and t.community_id in (#{communityId},'9999')
  68. </if>
  69. <if test="storeId !=null and storeId != ''">
  70. and t.store_id= #{storeId}
  71. </if>
  72. <if test="flowId !=null and flowId != ''">
  73. and t.flow_id= #{flowId}
  74. </if>
  75. <if test="flowName !=null and flowName != ''">
  76. and t.flow_name= #{flowName}
  77. </if>
  78. <if test="flowType !=null and flowType != ''">
  79. and t.flow_type= #{flowType}
  80. </if>
  81. </insert>
  82. <!-- 查询工作流信息 add by wuxw 2018-07-03 -->
  83. <select id="getWorkflowInfo" parameterType="Map" resultType="Map">
  84. select t.skip_level,t.skip_level skipLevel,t.describle,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id
  85. bId,t.community_id,t.community_id communityId,t.store_id,t.store_id storeId,t.flow_id,t.flow_id
  86. flowId,t.flow_name,t.flow_name flowName,t.flow_type,t.flow_type flowType,t.create_time createTime,d.name flowTypeName,
  87. t.process_definition_key,t.process_definition_key processDefinitionKey
  88. from workflow t
  89. left join t_dict d on t.flow_type = d.status_cd and d.table_name = 'workflow' and d.table_columns = 'flow_type'
  90. where 1 =1
  91. <if test="skipLevel !=null and skipLevel != ''">
  92. and t.skip_level= #{skipLevel}
  93. </if>
  94. <if test="describle !=null and describle != ''">
  95. and t.describle= #{describle}
  96. </if>
  97. <if test="statusCd !=null and statusCd != ''">
  98. and t.status_cd= #{statusCd}
  99. </if>
  100. <if test="bId !=null and bId != ''">
  101. and t.b_id= #{bId}
  102. </if>
  103. <if test="communityId !=null and communityId != '' and operationType==null ">
  104. and t.community_id in (#{communityId},'9999')
  105. </if>
  106. <if test="storeId !=null and storeId != ''">
  107. and t.store_id= #{storeId}
  108. </if>
  109. <if test="flowId !=null and flowId != ''">
  110. and t.flow_id= #{flowId}
  111. </if>
  112. <if test="flowName !=null and flowName != ''">
  113. and t.flow_name= #{flowName}
  114. </if>
  115. <if test="flowType !=null and flowType != ''">
  116. and t.flow_type= #{flowType}
  117. </if>
  118. <if test="flowTypes !=null">
  119. and t.flow_type in
  120. <foreach collection="flowTypes" item="item" open="(" close=")" separator=",">
  121. #{item}
  122. </foreach>
  123. </if>
  124. order by t.create_time desc
  125. <if test="page != -1 and page != null ">
  126. limit #{page}, #{row}
  127. </if>
  128. </select>
  129. <!-- 修改工作流信息 add by wuxw 2018-07-03 -->
  130. <update id="updateWorkflowInfoInstance" parameterType="Map">
  131. update workflow t set t.status_cd = #{statusCd}
  132. <if test="newBId != null and newBId != ''">
  133. ,t.b_id = #{newBId}
  134. </if>
  135. <if test="skipLevel !=null and skipLevel != ''">
  136. , t.skip_level= #{skipLevel}
  137. </if>
  138. <if test="describle !=null and describle != ''">
  139. , t.describle= #{describle}
  140. </if>
  141. <if test="communityId !=null and communityId != ''">
  142. , t.community_id= #{communityId}
  143. </if>
  144. <if test="storeId !=null and storeId != ''">
  145. , t.store_id= #{storeId}
  146. </if>
  147. <if test="flowName !=null and flowName != ''">
  148. , t.flow_name= #{flowName}
  149. </if>
  150. <if test="flowType !=null and flowType != ''">
  151. , t.flow_type= #{flowType}
  152. </if>
  153. <if test="processDefinitionKey !=null and processDefinitionKey != ''">
  154. , t.process_definition_key= #{processDefinitionKey}
  155. </if>
  156. where 1=1
  157. <if test="bId !=null and bId != ''">
  158. and t.b_id= #{bId}
  159. </if>
  160. <if test="flowId !=null and flowId != ''">
  161. and t.flow_id= #{flowId}
  162. </if>
  163. </update>
  164. <!-- 查询工作流数量 add by wuxw 2018-07-03 -->
  165. <select id="queryWorkflowsCount" parameterType="Map" resultType="Map">
  166. select count(1) count
  167. from workflow t
  168. where 1 =1
  169. <if test="skipLevel !=null and skipLevel != ''">
  170. and t.skip_level= #{skipLevel}
  171. </if>
  172. <if test="describle !=null and describle != ''">
  173. and t.describle= #{describle}
  174. </if>
  175. <if test="statusCd !=null and statusCd != ''">
  176. and t.status_cd= #{statusCd}
  177. </if>
  178. <if test="bId !=null and bId != ''">
  179. and t.b_id= #{bId}
  180. </if>
  181. <if test="communityId !=null and communityId != ''">
  182. and t.community_id in (#{communityId},'9999')
  183. </if>
  184. <if test="storeId !=null and storeId != ''">
  185. and t.store_id= #{storeId}
  186. </if>
  187. <if test="flowId !=null and flowId != ''">
  188. and t.flow_id= #{flowId}
  189. </if>
  190. <if test="flowName !=null and flowName != ''">
  191. and t.flow_name= #{flowName}
  192. </if>
  193. <if test="flowType !=null and flowType != ''">
  194. and t.flow_type= #{flowType}
  195. </if>
  196. <if test="flowTypes !=null">
  197. and t.flow_type in
  198. <foreach collection="flowTypes" item="item" open="(" close=")" separator=",">
  199. #{item}
  200. </foreach>
  201. </if>
  202. </select>
  203. </mapper>