ServiceBusinessServiceDaoImplMapper.xml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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="serviceBusinessServiceDaoImpl">
  6. <!-- 保存服务实现信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveServiceBusiness" parameterType="Map">
  8. insert into c_service_business(
  9. business_type_cd,invoke_type,message_topic,retry_count,url,timeout
  10. ) values (
  11. #{businessTypeCd},#{invokeType},#{messageTopic},#{retryCount},#{url},#{timeout}
  12. )
  13. </insert>
  14. <!-- 查询服务实现信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessServiceBusinessInfo" parameterType="Map" resultType="Map">
  16. select t.business_type_cd,t.business_type_cd businessTypeCd,t.invoke_type,t.invoke_type
  17. invokeType,t.message_topic,t.message_topic messageTopic,t.operate,t.retry_count,t.retry_count
  18. retryCount,t.service_business_id,t.service_business_id serviceBusinessId,t.url,t.timeout
  19. from c_service_business t
  20. where 1 =1
  21. <if test="businessTypeCd !=null and businessTypeCd != ''">
  22. and t.business_type_cd= #{businessTypeCd}
  23. </if>
  24. <if test="invokeType !=null and invokeType != ''">
  25. and t.invoke_type= #{invokeType}
  26. </if>
  27. <if test="messageTopic !=null and messageTopic != ''">
  28. and t.message_topic= #{messageTopic}
  29. </if>
  30. <if test="operate !=null and operate != ''">
  31. and t.operate= #{operate}
  32. </if>
  33. <if test="retryCount !=null and retryCount != ''">
  34. and t.retry_count= #{retryCount}
  35. </if>
  36. <if test="serviceBusinessId !=null and serviceBusinessId != ''">
  37. and t.service_business_id= #{serviceBusinessId}
  38. </if>
  39. <if test="url !=null and url != ''">
  40. and t.url= #{url}
  41. </if>
  42. <if test="timeout !=null and timeout != ''">
  43. and t.timeout= #{timeout}
  44. </if>
  45. </select>
  46. <!-- 保存服务实现信息至 instance表中 add by wuxw 2018-07-03 -->
  47. <insert id="saveServiceBusinessInfoInstance" parameterType="Map">
  48. insert into c_service_business(
  49. business_type_cd,invoke_type,message_topic,retry_count,status_cd,service_business_id,url,timeout
  50. ) select
  51. t.business_type_cd,t.invoke_type,t.message_topic,t.retry_count,'0',t.service_business_id,t.url,t.timeout from
  52. c_service_business t where 1=1
  53. <if test="businessTypeCd !=null and businessTypeCd != ''">
  54. and t.business_type_cd= #{businessTypeCd}
  55. </if>
  56. <if test="invokeType !=null and invokeType != ''">
  57. and t.invoke_type= #{invokeType}
  58. </if>
  59. <if test="messageTopic !=null and messageTopic != ''">
  60. and t.message_topic= #{messageTopic}
  61. </if>
  62. and t.operate= 'ADD'
  63. <if test="retryCount !=null and retryCount != ''">
  64. and t.retry_count= #{retryCount}
  65. </if>
  66. <if test="serviceBusinessId !=null and serviceBusinessId != ''">
  67. and t.service_business_id= #{serviceBusinessId}
  68. </if>
  69. <if test="url !=null and url != ''">
  70. and t.url= #{url}
  71. </if>
  72. <if test="timeout !=null and timeout != ''">
  73. and t.timeout= #{timeout}
  74. </if>
  75. </insert>
  76. <!-- 查询服务实现信息 add by wuxw 2018-07-03 -->
  77. <select id="getServiceBusinessInfo" parameterType="Map" resultType="Map">
  78. select t.business_type_cd,c.name,c.description,t.business_type_cd businessTypeCd,t.invoke_type,t.invoke_type
  79. invokeType,t.message_topic,t.message_topic messageTopic,t.retry_count,t.retry_count
  80. retryCount,t.status_cd,t.status_cd statusCd,t.service_business_id,t.service_business_id
  81. serviceBusinessId,t.url,t.timeout
  82. from c_service_business t ,c_business_type c
  83. where 1 =1
  84. and t.business_type_cd = c.business_type_cd
  85. <if test="name != null and name !=''">
  86. and c.name like concat('%',#{name},'%')
  87. </if>
  88. <if test="description != null and description !=''">
  89. and c.description like concat('%',#{description},'%')
  90. </if>
  91. <if test="businessTypeCd !=null and businessTypeCd != ''">
  92. and t.business_type_cd= #{businessTypeCd}
  93. </if>
  94. <if test="invokeType !=null and invokeType != ''">
  95. and t.invoke_type= #{invokeType}
  96. </if>
  97. <if test="messageTopic !=null and messageTopic != ''">
  98. and t.message_topic= #{messageTopic}
  99. </if>
  100. <if test="retryCount !=null and retryCount != ''">
  101. and t.retry_count= #{retryCount}
  102. </if>
  103. <if test="statusCd !=null and statusCd != ''">
  104. and t.status_cd= #{statusCd}
  105. </if>
  106. <if test="serviceBusinessId !=null and serviceBusinessId != ''">
  107. and t.service_business_id= #{serviceBusinessId}
  108. </if>
  109. <if test="url !=null and url != ''">
  110. and t.url= #{url}
  111. </if>
  112. <if test="timeout !=null and timeout != ''">
  113. and t.timeout= #{timeout}
  114. </if>
  115. <if test="page != -1 and page != null ">
  116. limit #{page}, #{row}
  117. </if>
  118. </select>
  119. <!-- 修改服务实现信息 add by wuxw 2018-07-03 -->
  120. <update id="updateServiceBusiness" parameterType="Map">
  121. update c_service_business t set t.status_cd = #{statusCd}
  122. <if test="newBId != null and newBId != ''">
  123. ,t.b_id = #{newBId}
  124. </if>
  125. <if test="businessTypeCd !=null and businessTypeCd != ''">
  126. , t.business_type_cd= #{businessTypeCd}
  127. </if>
  128. <if test="invokeType !=null and invokeType != ''">
  129. , t.invoke_type= #{invokeType}
  130. </if>
  131. <if test="messageTopic !=null and messageTopic != ''">
  132. , t.message_topic= #{messageTopic}
  133. </if>
  134. <if test="retryCount !=null and retryCount != ''">
  135. , t.retry_count= #{retryCount}
  136. </if>
  137. <if test="url !=null and url != ''">
  138. , t.url= #{url}
  139. </if>
  140. <if test="timeout !=null and timeout != ''">
  141. , t.timeout= #{timeout}
  142. </if>
  143. where 1=1
  144. <if test="serviceBusinessId !=null and serviceBusinessId != ''">
  145. and t.service_business_id= #{serviceBusinessId}
  146. </if>
  147. </update>
  148. <!-- 查询服务实现数量 add by wuxw 2018-07-03 -->
  149. <select id="queryServiceBusinesssCount" parameterType="Map" resultType="Map">
  150. select count(1) count
  151. from c_service_business t ,c_business_type c
  152. where 1 =1
  153. and t.business_type_cd = c.business_type_cd
  154. <if test="name != null and name !=''">
  155. and c.name like concat('%',#{name},'%')
  156. </if>
  157. <if test="description != null and description !=''">
  158. and c.description like concat('%',#{description},'%')
  159. </if>
  160. <if test="businessTypeCd !=null and businessTypeCd != ''">
  161. and t.business_type_cd= #{businessTypeCd}
  162. </if>
  163. <if test="invokeType !=null and invokeType != ''">
  164. and t.invoke_type= #{invokeType}
  165. </if>
  166. <if test="messageTopic !=null and messageTopic != ''">
  167. and t.message_topic= #{messageTopic}
  168. </if>
  169. <if test="retryCount !=null and retryCount != ''">
  170. and t.retry_count= #{retryCount}
  171. </if>
  172. <if test="statusCd !=null and statusCd != ''">
  173. and t.status_cd= #{statusCd}
  174. </if>
  175. <if test="serviceBusinessId !=null and serviceBusinessId != ''">
  176. and t.service_business_id= #{serviceBusinessId}
  177. </if>
  178. <if test="url !=null and url != ''">
  179. and t.url= #{url}
  180. </if>
  181. <if test="timeout !=null and timeout != ''">
  182. and t.timeout= #{timeout}
  183. </if>
  184. </select>
  185. <select id="queryBusinessType" parameterType="Map" resultType="Map">
  186. select ct.* from c_business_type ct
  187. where ct.business_type_cd = #{businessTypeCd}
  188. </select>
  189. <insert id="saveBusinessType" parameterType="Map">
  190. insert into c_business_type(business_type_cd,name,description)
  191. values(#{businessTypeCd},#{name},#{description})
  192. </insert>
  193. <update id="updateBusinessType" parameterType="Map">
  194. update c_business_type ct
  195. <set>
  196. <if test="name !=null and name != ''">
  197. ct.name= #{name},
  198. </if>
  199. <if test="businessTypeCd !=null and businessTypeCd != ''">
  200. ct.business_type_cd= #{businessTypeCd},
  201. </if>
  202. <if test="description !=null and description != ''">
  203. ct.description= #{description}
  204. </if>
  205. </set>
  206. where ct.business_type_cd= #{businessTypeCd}
  207. </update>
  208. </mapper>