...
|
...
|
@@ -6,11 +6,22 @@ |
|
|
<!--@Table routing_key-->
|
|
|
<id column="id" jdbcType="VARCHAR" property="id"/>
|
|
|
<result column="routing_key_name" jdbcType="VARCHAR" property="routingKeyName"/>
|
|
|
<result column="routing_key_name" jdbcType="VARCHAR" property="aliasName"/>
|
|
|
<result column="exchange_id" jdbcType="VARCHAR" property="exchangeId"/>
|
|
|
<result column="description" jdbcType="VARCHAR" property="description"/>
|
|
|
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
|
|
|
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 该Mapper映射关系的作用,是 路由键 与 交换机 的 1:1 的关系映射 -->
|
|
|
<resultMap id="RoutingKeyAndExchangeMap" extends="BaseResultMap"
|
|
|
type="com.sunyo.wlpt.message.bus.service.domain.RoutingKey">
|
|
|
<association property="busExchange" javaType="com.sunyo.wlpt.message.bus.service.domain.BusExchange">
|
|
|
<id column="id" property="id"></id>
|
|
|
<result column="exchange_name" property="exchangeName"/>
|
|
|
</association>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
<!--@mbg.generated-->
|
|
|
id, routing_key_name, exchange_id, description, gmt_create, gmt_modified
|
...
|
...
|
@@ -27,13 +38,18 @@ |
|
|
<select id="selectRoutingKeyList" parameterType="com.sunyo.wlpt.message.bus.service.domain.RoutingKey"
|
|
|
resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>
|
|
|
from routing_key
|
|
|
r.id, r.routing_key_name, r.exchange_id, r.description, r.gmt_create, r.gmt_modified, e.exchange_name
|
|
|
from routing_key as r,bus_exchange as e
|
|
|
<where>
|
|
|
<!-- 所属交换机ID -->
|
|
|
<if test="exchangeId != null and exchangeId !=''">
|
|
|
exchange_id = #{exchangeId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<!-- 路由键名称 -->
|
|
|
<if test="routingKeyName != null and routingKeyName !=''">
|
|
|
routing_key_name = #{routingKeyName,jdbcType=VARCHAR}
|
|
|
and routing_key_name = #{routingKeyName,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
and r.exchange_id = e.id
|
|
|
</where>
|
|
|
</select>
|
|
|
<!-- 校验路由键是否已存在 -->
|
...
|
...
|
|