WorkflowServiceDaoImplMapper.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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
  10. ) values (
  11. #{skipLevel},#{operate},#{describle},#{bId},#{communityId},#{storeId},#{flowId},#{flowName},#{flowType}
  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
  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= #{communityId}
  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
  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 from
  54. business_workflow t where 1=1
  55. <if test="skipLevel !=null and skipLevel != ''">
  56. and t.skip_level= #{skipLevel}
  57. </if>
  58. and t.operate= 'ADD'
  59. <if test="describle !=null and describle != ''">
  60. and t.describle= #{describle}
  61. </if>
  62. <if test="bId !=null and bId != ''">
  63. and t.b_id= #{bId}
  64. </if>
  65. <if test="communityId !=null and communityId != ''">
  66. and t.community_id= #{communityId}
  67. </if>
  68. <if test="storeId !=null and storeId != ''">
  69. and t.store_id= #{storeId}
  70. </if>
  71. <if test="flowId !=null and flowId != ''">
  72. and t.flow_id= #{flowId}
  73. </if>
  74. <if test="flowName !=null and flowName != ''">
  75. and t.flow_name= #{flowName}
  76. </if>
  77. <if test="flowType !=null and flowType != ''">
  78. and t.flow_type= #{flowType}
  79. </if>
  80. </insert>
  81. <!-- 查询工作流信息 add by wuxw 2018-07-03 -->
  82. <select id="getWorkflowInfo" parameterType="Map" resultType="Map">
  83. select t.skip_level,t.skip_level skipLevel,t.describle,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id
  84. bId,t.community_id,t.community_id communityId,t.store_id,t.store_id storeId,t.flow_id,t.flow_id
  85. flowId,t.flow_name,t.flow_name flowName,t.flow_type,t.flow_type flowType,t.create_time createTime,d.name flowTypeName
  86. from workflow t
  87. left join t_dict d on t.flow_type = d.status_cd and d.table_name = 'workflow' and d.table_columns = 'flow_type'
  88. where 1 =1
  89. <if test="skipLevel !=null and skipLevel != ''">
  90. and t.skip_level= #{skipLevel}
  91. </if>
  92. <if test="describle !=null and describle != ''">
  93. and t.describle= #{describle}
  94. </if>
  95. <if test="statusCd !=null and statusCd != ''">
  96. and t.status_cd= #{statusCd}
  97. </if>
  98. <if test="bId !=null and bId != ''">
  99. and t.b_id= #{bId}
  100. </if>
  101. <if test="communityId !=null and communityId != ''">
  102. and t.community_id= #{communityId}
  103. </if>
  104. <if test="storeId !=null and storeId != ''">
  105. and t.store_id= #{storeId}
  106. </if>
  107. <if test="flowId !=null and flowId != ''">
  108. and t.flow_id= #{flowId}
  109. </if>
  110. <if test="flowName !=null and flowName != ''">
  111. and t.flow_name= #{flowName}
  112. </if>
  113. <if test="flowType !=null and flowType != ''">
  114. and t.flow_type= #{flowType}
  115. </if>
  116. order by t.create_time desc
  117. <if test="page != -1 and page != null ">
  118. limit #{page}, #{row}
  119. </if>
  120. </select>
  121. <!-- 修改工作流信息 add by wuxw 2018-07-03 -->
  122. <update id="updateWorkflowInfoInstance" parameterType="Map">
  123. update workflow t set t.status_cd = #{statusCd}
  124. <if test="newBId != null and newBId != ''">
  125. ,t.b_id = #{newBId}
  126. </if>
  127. <if test="skipLevel !=null and skipLevel != ''">
  128. , t.skip_level= #{skipLevel}
  129. </if>
  130. <if test="describle !=null and describle != ''">
  131. , t.describle= #{describle}
  132. </if>
  133. <if test="communityId !=null and communityId != ''">
  134. , t.community_id= #{communityId}
  135. </if>
  136. <if test="storeId !=null and storeId != ''">
  137. , t.store_id= #{storeId}
  138. </if>
  139. <if test="flowName !=null and flowName != ''">
  140. , t.flow_name= #{flowName}
  141. </if>
  142. <if test="flowType !=null and flowType != ''">
  143. , t.flow_type= #{flowType}
  144. </if>
  145. where 1=1
  146. <if test="bId !=null and bId != ''">
  147. and t.b_id= #{bId}
  148. </if>
  149. <if test="flowId !=null and flowId != ''">
  150. and t.flow_id= #{flowId}
  151. </if>
  152. </update>
  153. <!-- 查询工作流数量 add by wuxw 2018-07-03 -->
  154. <select id="queryWorkflowsCount" parameterType="Map" resultType="Map">
  155. select count(1) count
  156. from workflow t
  157. where 1 =1
  158. <if test="skipLevel !=null and skipLevel != ''">
  159. and t.skip_level= #{skipLevel}
  160. </if>
  161. <if test="describle !=null and describle != ''">
  162. and t.describle= #{describle}
  163. </if>
  164. <if test="statusCd !=null and statusCd != ''">
  165. and t.status_cd= #{statusCd}
  166. </if>
  167. <if test="bId !=null and bId != ''">
  168. and t.b_id= #{bId}
  169. </if>
  170. <if test="communityId !=null and communityId != ''">
  171. and t.community_id= #{communityId}
  172. </if>
  173. <if test="storeId !=null and storeId != ''">
  174. and t.store_id= #{storeId}
  175. </if>
  176. <if test="flowId !=null and flowId != ''">
  177. and t.flow_id= #{flowId}
  178. </if>
  179. <if test="flowName !=null and flowName != ''">
  180. and t.flow_name= #{flowName}
  181. </if>
  182. <if test="flowType !=null and flowType != ''">
  183. and t.flow_type= #{flowType}
  184. </if>
  185. </select>
  186. </mapper>