RouteServiceDaoImplMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="routeServiceDaoImpl">
  5. <!-- 保存路由信息 add by wuxw 2018-07-03 -->
  6. <insert id="saveBusinessRouteInfo" parameterType="Map">
  7. insert into business_route(invoke_limit_times, order_type_cd, operate, app_id, id, service_id, invoke_model)
  8. values (#{invokeLimitTimes}, #{orderTypeCd}, #{operate}, #{appId}, #{id}, #{serviceId}, #{invokeModel})
  9. </insert>
  10. <!-- 查询路由信息(Business) add by wuxw 2018-07-03 -->
  11. <select id="getBusinessRouteInfo" parameterType="Map" resultType="Map">
  12. select t.invoke_limit_times,t.invoke_limit_times invokeLimitTimes,t.order_type_cd,t.order_type_cd
  13. orderTypeCd,t.operate,t.app_id,t.app_id appId,t.id,t.service_id,t.service_id
  14. serviceId,t.invoke_model,t.invoke_model invokeModel
  15. from business_route t
  16. where 1 =1
  17. <if test="invokeLimitTimes !=null and invokeLimitTimes != ''">
  18. and t.invoke_limit_times= #{invokeLimitTimes}
  19. </if>
  20. <if test="orderTypeCd !=null and orderTypeCd != ''">
  21. and t.order_type_cd= #{orderTypeCd}
  22. </if>
  23. <if test="operate !=null and operate != ''">
  24. and t.operate= #{operate}
  25. </if>
  26. <if test="appId !=null and appId != ''">
  27. and t.app_id= #{appId}
  28. </if>
  29. <if test="id !=null and id != ''">
  30. and t.id= #{id}
  31. </if>
  32. <if test="serviceId !=null and serviceId != ''">
  33. and t.service_id= #{serviceId}
  34. </if>
  35. <if test="invokeModel !=null and invokeModel != ''">
  36. and t.invoke_model= #{invokeModel}
  37. </if>
  38. </select>
  39. <!-- 保存路由信息至 instance表中 add by wuxw 2018-07-03 -->
  40. <insert id="saveRouteInfo" parameterType="Map">
  41. insert into c_route(invoke_limit_times, order_type_cd, app_id, id, service_id, invoke_model)
  42. values (#{invokeLimitTimes}, #{orderTypeCd}, #{appId}, #{id}, #{serviceId}, #{invokeModel})
  43. </insert>
  44. <!-- 查询路由信息 add by wuxw 2018-07-03 -->
  45. <select id="getRouteInfo" parameterType="Map" resultType="Map">
  46. select t.invoke_limit_times,t.invoke_limit_times invokeLimitTimes,t.order_type_cd,t.order_type_cd
  47. orderTypeCd,t.app_id,t.app_id appId,t.status_cd,t.status_cd statusCd,t.id,t.service_id,t.service_id
  48. serviceId,t.invoke_model,t.invoke_model invokeModel,s.name serviceName,a.name appName,s.service_code
  49. serviceCode,s.url serviceUrl
  50. from c_route t,c_service s, c_app a
  51. where 1 =1
  52. and t.app_id = a.app_id
  53. and t.service_id = s.service_id
  54. <if test="invokeLimitTimes !=null and invokeLimitTimes != ''">
  55. and t.invoke_limit_times= #{invokeLimitTimes}
  56. </if>
  57. <if test="orderTypeCd !=null and orderTypeCd != ''">
  58. and t.order_type_cd= #{orderTypeCd}
  59. </if>
  60. <if test="appId !=null and appId != ''">
  61. and t.app_id= #{appId}
  62. </if>
  63. <if test="statusCd !=null and statusCd != ''">
  64. and t.status_cd= #{statusCd}
  65. and s.status_cd= #{statusCd}
  66. and a.status_cd= #{statusCd}
  67. </if>
  68. <if test="id !=null and id != ''">
  69. and t.id= #{id}
  70. </if>
  71. <if test="serviceId !=null and serviceId != ''">
  72. and t.service_id= #{serviceId}
  73. </if>
  74. <if test="invokeModel !=null and invokeModel != ''">
  75. and t.invoke_model= #{invokeModel}
  76. </if>
  77. <if test="serviceUrl !=null and serviceUrl != ''">
  78. and s.url like concat('%',#{serviceUrl},'%')
  79. </if>
  80. <if test="serviceName !=null and serviceName != ''">
  81. and s.name like concat('%',#{serviceName},'%')
  82. </if>
  83. <if test="serviceCode !=null and serviceCode != ''">
  84. and s.service_code= #{serviceCode}
  85. </if>
  86. <if test="serviceUrl != null and serviceUrl != ''">
  87. and s.url = #{serviceUrl}
  88. </if>
  89. <if test="appName != null and appName != ''">
  90. and a.name = #{appName}
  91. </if>
  92. <if test="page != -1 and page != null ">
  93. limit #{page}, #{row}
  94. </if>
  95. </select>
  96. <!-- 修改路由信息 add by wuxw 2018-07-03 -->
  97. <update id="updateRouteInfo" parameterType="Map">
  98. update c_route t set t.status_cd = #{statusCd}
  99. <if test="invokeLimitTimes !=null and invokeLimitTimes != ''">
  100. , t.invoke_limit_times= #{invokeLimitTimes}
  101. </if>
  102. <if test="orderTypeCd !=null and orderTypeCd != ''">
  103. , t.order_type_cd= #{orderTypeCd}
  104. </if>
  105. <if test="invokeModel !=null and invokeModel != ''">
  106. , t.invoke_model= #{invokeModel}
  107. </if>
  108. where 1=1
  109. <if test="id !=null and id != ''">
  110. and t.id= #{id}
  111. </if>
  112. </update>
  113. <!-- 查询路由数量 add by wuxw 2018-07-03 -->
  114. <select id="queryRoutesCount" parameterType="Map" resultType="Map">
  115. select count(1) count
  116. from c_route t,c_service s, c_app a
  117. where 1 =1
  118. and t.app_id = a.app_id
  119. and t.service_id = s.service_id
  120. <if test="invokeLimitTimes !=null and invokeLimitTimes != ''">
  121. and t.invoke_limit_times= #{invokeLimitTimes}
  122. </if>
  123. <if test="orderTypeCd !=null and orderTypeCd != ''">
  124. and t.order_type_cd= #{orderTypeCd}
  125. </if>
  126. <if test="appId !=null and appId != ''">
  127. and t.app_id= #{appId}
  128. </if>
  129. <if test="statusCd !=null and statusCd != ''">
  130. and t.status_cd= #{statusCd}
  131. and s.status_cd= #{statusCd}
  132. and a.status_cd= #{statusCd}
  133. </if>
  134. <if test="id !=null and id != ''">
  135. and t.id= #{id}
  136. </if>
  137. <if test="serviceId !=null and serviceId != ''">
  138. and t.service_id= #{serviceId}
  139. </if>
  140. <if test="invokeModel !=null and invokeModel != ''">
  141. and t.invoke_model= #{invokeModel}
  142. </if>
  143. <if test="serviceUrl !=null and serviceUrl != ''">
  144. and s.url like concat('%',#{serviceUrl},'%')
  145. </if>
  146. <if test="serviceName !=null and serviceName != ''">
  147. and s.name like concat('%',#{serviceName},'%')
  148. </if>
  149. <if test="serviceCode !=null and serviceCode != ''">
  150. and s.service_code= #{serviceCode}
  151. </if>
  152. <if test="serviceUrl != null and serviceUrl != ''">
  153. and s.url = #{serviceUrl}
  154. </if>
  155. <if test="appName != null and appName != ''">
  156. and a.name = #{appName}
  157. </if>
  158. </select>
  159. </mapper>