作者 王勇

格式化xml代码规范

... ... @@ -22,7 +22,7 @@
<resultMap id="ExchangeAndHostMap" extends="BaseResultMap"
type="com.sunyo.wlpt.message.bus.service.domain.BusExchange">
<association property="virtualHost" javaType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost">
<id column="id" property="id"></id>
<id column="id" property="id"/>
<result column="virtual_host_name" property="virtualHostName"/>
</association>
</resultMap>
... ... @@ -43,17 +43,27 @@
<!-- 获取交换机列表 -->
<select id="selectBusExchangeList" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusExchange"
resultMap="ExchangeAndHostMap">
select
e.id, e.exchange_name, e.virtual_host_id, e.exchange_type, e.durability, e.auto_delete, e.internal,
e.arguments, e.description, e.gmt_create, e.gmt_modified,v.virtual_host_name
from bus_exchange as e,virtual_host as v
select e.id,
e.exchange_name,
e.virtual_host_id,
e.exchange_type,
e.durability,
e.auto_delete,
e.internal,
e.arguments,
e.description,
e.gmt_create,
e.gmt_modified,
v.virtual_host_name
from bus_exchange as e,
virtual_host as v
<where>
<!-- 所属虚拟主机ID -->
<if test="virtualHostId != null and virtualHostId !=''">
<if test="virtualHostId != null and virtualHostId != ''">
e.virtual_host_id = #{virtualHostId,jdbcType=VARCHAR}
</if>
<!-- 交换机名称 -->
<if test="exchangeName != null and exchangeName !=''">
<if test="exchangeName != null and exchangeName != ''">
and e.exchange_name = #{exchangeName,jdbcType=VARCHAR}
</if>
and e.virtual_host_id = v.id
... ... @@ -67,7 +77,7 @@
from bus_exchange
<where>
<!-- 交换机名称 -->
<if test="exchangeName != null and exchangeName !=''">
<if test="exchangeName != null and exchangeName != ''">
exchange_name = #{exchangeName,jdbcType=VARCHAR}
</if>
</where>
... ... @@ -79,7 +89,7 @@
from bus_exchange
<where>
<!-- 所属虚拟主机ID -->
<if test="virtualHostId != null and virtualHostId !=''">
<if test="virtualHostId != null and virtualHostId != ''">
virtual_host_id = #{virtualHostId,jdbcType=VARCHAR}
</if>
</where>
... ... @@ -87,7 +97,8 @@
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from bus_exchange
delete
from bus_exchange
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusExchange">
... ... @@ -227,5 +238,4 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
... ...
... ... @@ -4,17 +4,17 @@
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.BusQueue">
<!--@mbg.generated-->
<!--@Table bus_queue-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="queue_name" jdbcType="VARCHAR" property="queueName" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId" />
<result column="durability" jdbcType="BOOLEAN" property="durability" />
<result column="auto_delete" jdbcType="BOOLEAN" property="autoDelete" />
<result column="arguments" jdbcType="VARCHAR" property="arguments" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="queue_name" jdbcType="VARCHAR" property="queueName"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId"/>
<result column="durability" jdbcType="BOOLEAN" property="durability"/>
<result column="auto_delete" jdbcType="BOOLEAN" property="autoDelete"/>
<result column="arguments" jdbcType="VARCHAR" property="arguments"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
... ... @@ -24,13 +24,14 @@
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from bus_queue
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from bus_queue
delete
from bus_queue
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue">
... ... @@ -174,55 +175,71 @@
<!-- 该Mapper映射关系的作用,是队列与虚拟主机的1:1的关系映射 -->
<resultMap extends="BaseResultMap" id="QueueAndHostMap" type="com.sunyo.wlpt.message.bus.service.domain.BusQueue">
<association javaType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost" property="virtualHost">
<id column="id" property="id" />
<result column="virtual_host_name" property="virtualHostName" />
<id column="id" property="id"/>
<result column="virtual_host_name" property="virtualHostName"/>
</association>
</resultMap>
<!-- 获取消息队列,列表 -->
<select id="selectBusQueueList" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue" resultMap="QueueAndHostMap">
select
q.id, q.queue_name, q.virtual_host_id, q.durability, q.auto_delete, q.arguments, q.description,q.user_id,q.username,
q.gmt_create, q.gmt_modified,v.virtual_host_name
from bus_queue as q,virtual_host v
<select id="selectBusQueueList" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue"
resultMap="QueueAndHostMap">
select q.id,
q.queue_name,
q.virtual_host_id,
q.durability,
q.auto_delete,
q.arguments,
q.description,
q.user_id,
q.username,
q.gmt_create,
q.gmt_modified,
v.virtual_host_name
from bus_queue as q,
virtual_host v
<where>
<!-- 所属虚拟主机Id -->
<if test="virtualHostId != null and virtualHostId !=''">
<if test="virtualHostId != null and virtualHostId != ''">
virtual_host_id = #{virtualHostId,jdbcType=VARCHAR}
</if>
<!-- 用户名称 -->
<if test="username != null and username != ''">
and username = #{username,jdbcType=VARCHAR}
</if>
<!-- 消息队列名称 -->
<if test="queueName != null and queueName !=''">
<if test="queueName != null and queueName != ''">
and queue_name = #{queueName,jdbcType=VARCHAR}
</if>
and v.id = q.virtual_host_id
</where>
</select>
<!-- 校验消息队列是否已存在-->
<select id="validateBusQueue" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue" resultMap="BaseResultMap">
<select id="validateBusQueue" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from bus_queue
<where>
<!-- 消息队列名称 -->
<if test="queueName != null and queueName !=''">
<if test="queueName != null and queueName != ''">
queue_name = #{queueName,jdbcType=VARCHAR}
</if>
</where>
</select>
<!-- 仅,查询队列列表 -->
<select id="getQueueList" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue" resultMap="BaseResultMap">
<select id="getQueueList" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusQueue"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from bus_queue
<where>
<!-- 所属虚拟主机Id -->
<if test="virtualHostId != null and virtualHostId !=''">
<if test="virtualHostId != null and virtualHostId != ''">
virtual_host_id = #{virtualHostId,jdbcType=VARCHAR}
</if>
<if test="userId != null and userId !=''">
<if test="userId != null and userId != ''">
and user_id = #{userId,jdbcType=VARCHAR}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -60,17 +60,26 @@
<!-- 查询服务器和虚拟主机基本信息(id,名称) -->
<select id="getServerAndHostList" resultMap="ServerAndVirtualHostMap">
select
s.id,s.server_name,v.id as vid,v.virtual_host_name
from bus_server as s, virtual_host as v
select s.id,
s.server_name,
v.id as vid,
v.virtual_host_name
from bus_server as s,
virtual_host as v
where s.id = v.server_id
</select>
<!-- 查询服务器和虚拟主机以及虚拟机基本信息(id,名称) -->
<select id="getServerAndHostAndExchangeList" resultMap="ServerAndHostAndExchangeMap">
select
s.id,s.server_name,v.id as vid,v.virtual_host_name,e.id as eid,e.exchange_name
from bus_server as s, virtual_host as v,bus_exchange as e
select s.id,
s.server_name,
v.id as vid,
v.virtual_host_name,
e.id as eid,
e.exchange_name
from bus_server as s,
virtual_host as v,
bus_exchange as e
where s.id = v.server_id
and v.id = e.virtual_host_id
</select>
... ... @@ -82,7 +91,7 @@
from bus_server
<where>
<!-- 服务器名称 -->
<if test="serverName != null and serverName !=''">
<if test="serverName != null and serverName != ''">
server_name = #{serverName,jdbcType=VARCHAR}
</if>
</where>
... ... @@ -96,7 +105,7 @@
from bus_server
<where>
<!-- 服务器名称 -->
<if test="serverName != null and serverName !=''">
<if test="serverName != null and serverName != ''">
server_name = #{serverName,jdbcType=VARCHAR}
</if>
</where>
... ... @@ -109,11 +118,11 @@
from bus_server
<where>
<!-- 服务器的ip -->
<if test="serverIp != null and serverIp !=''">
<if test="serverIp != null and serverIp != ''">
server_ip = #{serverIp,jdbcType=VARCHAR}
</if>
<!-- 服务器的port -->
<if test="serverPort != null and serverPort !=''">
<if test="serverPort != null and serverPort != ''">
AND server_port = #{serverPort,jdbcType=VARCHAR}
</if>
</where>
... ... @@ -121,7 +130,8 @@
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from bus_server
delete
from bus_server
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.BusServer">
... ... @@ -219,6 +229,4 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
... ...
... ... @@ -4,25 +4,25 @@
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.MessageNote">
<!--@mbg.generated-->
<!--@Table message_note-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="server_id" jdbcType="VARCHAR" property="serverId" />
<result column="server_name" jdbcType="VARCHAR" property="serverName" />
<result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId" />
<result column="virtual_host_name" jdbcType="VARCHAR" property="virtualHostName" />
<result column="exchange_id" jdbcType="VARCHAR" property="exchangeId" />
<result column="exchange_name" jdbcType="VARCHAR" property="exchangeName" />
<result column="queue_id" jdbcType="VARCHAR" property="queueId" />
<result column="queue_name" jdbcType="VARCHAR" property="queueName" />
<result column="routing_key_id" jdbcType="VARCHAR" property="routingKeyId" />
<result column="routing_key_name" jdbcType="VARCHAR" property="routingKeyName" />
<result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
<result column="receive_time" jdbcType="TIMESTAMP" property="receiveTime" />
<result column="send_content" jdbcType="BLOB" property="sendContent" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="server_id" jdbcType="VARCHAR" property="serverId"/>
<result column="server_name" jdbcType="VARCHAR" property="serverName"/>
<result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId"/>
<result column="virtual_host_name" jdbcType="VARCHAR" property="virtualHostName"/>
<result column="exchange_id" jdbcType="VARCHAR" property="exchangeId"/>
<result column="exchange_name" jdbcType="VARCHAR" property="exchangeName"/>
<result column="queue_id" jdbcType="VARCHAR" property="queueId"/>
<result column="queue_name" jdbcType="VARCHAR" property="queueName"/>
<result column="routing_key_id" jdbcType="VARCHAR" property="routingKeyId"/>
<result column="routing_key_name" jdbcType="VARCHAR" property="routingKeyName"/>
<result column="send_time" jdbcType="TIMESTAMP" property="sendTime"/>
<result column="receive_time" jdbcType="TIMESTAMP" property="receiveTime"/>
<result column="send_content" jdbcType="BLOB" property="sendContent"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
... ... @@ -33,13 +33,14 @@
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from message_note
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from message_note
delete
from message_note
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.MessageNote">
... ... @@ -267,48 +268,50 @@
</update>
<!-- 获取,消息收发记录列表 -->
<select id="selectMessageNoteList" parameterType="com.sunyo.wlpt.message.bus.service.domain.MessageNote" resultMap="BaseResultMap">
<select id="selectMessageNoteList" parameterType="com.sunyo.wlpt.message.bus.service.domain.MessageNote"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from message_note
<where>
<!-- 所属用户登陆名称 -->
<if test="username != null and username !=''">
<if test="username != null and username != ''">
username = #{username,jdbcType=VARCHAR}
</if>
<!-- 所属服务器名称 -->
<if test="serverName != null and serverName !=''">
<if test="serverName != null and serverName != ''">
AND server_name = #{serverName,jdbcType=VARCHAR}
</if>
<!-- 所属虚拟主机名称 -->
<if test="virtualHostName != null and virtualHostName !=''">
<if test="virtualHostName != null and virtualHostName != ''">
AND virtual_host_name = #{virtualHostName,jdbcType=VARCHAR}
</if>
<!-- 所属交换机名称 -->
<if test="exchangeName != null and exchangeName !=''">
<if test="exchangeName != null and exchangeName != ''">
AND exchange_name = #{exchangeName,jdbcType=VARCHAR}
</if>
<!-- 所属路由键名称 -->
<if test="routingKeyName != null and routingKeyName !=''">
<if test="routingKeyName != null and routingKeyName != ''">
AND routing_key_name = #{routingKeyName,jdbcType=VARCHAR}
</if>
<!-- 所属队列名称 -->
<if test="queueName != null and queueName !=''">
<if test="queueName != null and queueName != ''">
AND queue_name = #{queueName,jdbcType=VARCHAR}
</if>
<!-- 消息发送时间 -->
<if test="sendTime != null">
AND DATE_FORMAT(send_time,'%Y-%m-%d') = #{sendTime,jdbcType=DATE}
AND DATE_FORMAT(send_time, '%Y-%m-%d') = #{sendTime,jdbcType=DATE}
</if>
<!-- 消息接收时间 -->
<if test="receiveTime != null">
AND DATE_FORMAT(receive_time,'%Y-%m-%d') = #{receiveTime,jdbcType=DATE}
AND DATE_FORMAT(receive_time, '%Y-%m-%d') = #{receiveTime,jdbcType=DATE}
</if>
</where>
</select>
<!-- 自动删除 message_note记录 -->
<delete id="autoDelete" parameterType="java.lang.Integer">
delete from message_note
where to_days(now())-to_days(gmt_create) &gt;= #{deleteTime,jdbcType=INTEGER}
delete
from message_note
where to_days(now()) - to_days(gmt_create) &gt;= #{deleteTime,jdbcType=INTEGER}
</delete>
</mapper>
\ No newline at end of file
... ...
... ... @@ -17,7 +17,7 @@
<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>
<id column="id" property="id"/>
<result column="exchange_name" property="exchangeName"/>
</association>
</resultMap>
... ... @@ -37,16 +37,22 @@
<!-- 查询路由键列表 -->
<select id="selectRoutingKeyList" parameterType="com.sunyo.wlpt.message.bus.service.domain.RoutingKey"
resultMap="RoutingKeyAndExchangeMap">
select
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
select 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 !=''">
<if test="exchangeId != null and exchangeId != ''">
exchange_id = #{exchangeId,jdbcType=VARCHAR}
</if>
<!-- 路由键名称 -->
<if test="routingKeyName != null and routingKeyName !=''">
<if test="routingKeyName != null and routingKeyName != ''">
and routing_key_name = #{routingKeyName,jdbcType=VARCHAR}
</if>
and r.exchange_id = e.id
... ... @@ -60,7 +66,7 @@
from routing_key
<where>
<!-- 路由键名称 -->
<if test="routingKeyName != null and routingKeyName !=''">
<if test="routingKeyName != null and routingKeyName != ''">
routing_key_name = #{routingKeyName,jdbcType=VARCHAR}
</if>
</where>
... ... @@ -73,7 +79,7 @@
from routing_key
<where>
<!-- 所属交换机ID -->
<if test="exchangeId != null and exchangeId !=''">
<if test="exchangeId != null and exchangeId != ''">
exchange_id = #{exchangeId,jdbcType=VARCHAR}
</if>
</where>
... ... @@ -81,17 +87,16 @@
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from routing_key
delete
from routing_key
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.RoutingKey">
<!--@mbg.generated-->
insert into routing_key (id, routing_key_name, exchange_id,
description, gmt_create, gmt_modified
)
description, gmt_create, gmt_modified)
values (#{id,jdbcType=VARCHAR}, #{routingKeyName,jdbcType=VARCHAR}, #{exchangeId,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}
)
#{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.RoutingKey">
<!--@mbg.generated-->
... ... @@ -169,5 +174,4 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
... ...
... ... @@ -4,10 +4,10 @@
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.SchedulingDelete">
<!--@mbg.generated-->
<!--@Table scheduling_delete-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="delete_time" jdbcType="INTEGER" property="deleteTime" />
<result column="delete_type" jdbcType="VARCHAR" property="deleteType" />
<result column="description" jdbcType="VARCHAR" property="description" />
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="delete_time" jdbcType="INTEGER" property="deleteTime"/>
<result column="delete_type" jdbcType="VARCHAR" property="deleteType"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
... ... @@ -16,13 +16,14 @@
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from scheduling_delete
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from scheduling_delete
delete
from scheduling_delete
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.SchedulingDelete">
... ... @@ -91,11 +92,11 @@
<select id="selectByType" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from scheduling_delete
<where>
<!-- 删除类型 -->
<if test="deleteType != null and deleteType !=''">
<if test="deleteType != null and deleteType != ''">
delete_type = #{deleteType,jdbcType=VARCHAR}
</if>
</where>
... ...
... ... @@ -4,12 +4,12 @@
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.UserInfo">
<!--@mbg.generated-->
<!--@Table user_info-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
... ... @@ -18,31 +18,33 @@
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from user_info
where id = #{id,jdbcType=VARCHAR}
</select>
<select id="getUserInfoList" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
id, username, description, gmt_create, gmt_modified
select id,
username,
description,
gmt_create,
gmt_modified
from user_info
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from user_info
delete
from user_info
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserInfo">
<!--@mbg.generated-->
insert into user_info (id, username, `password`,
description, gmt_create, gmt_modified
)
description, gmt_create, gmt_modified)
values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}
)
#{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserInfo">
<!--@mbg.generated-->
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sunyo.wlpt.message.bus.service.mapper.UserMessageBindingMapper">
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding">
<!--@mbg.generated-->
<!--@Table user_message_binding-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="server_id" jdbcType="VARCHAR" property="serverId" />
<result column="server_name" jdbcType="VARCHAR" property="serverName" />
<result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId" />
<result column="virtual_host_name" jdbcType="VARCHAR" property="virtualHostName" />
<result column="exchange_id" jdbcType="VARCHAR" property="exchangeId" />
<result column="exchange_name" jdbcType="VARCHAR" property="exchangeName" />
<result column="queue_id" jdbcType="VARCHAR" property="queueId" />
<result column="queue_name" jdbcType="VARCHAR" property="queueName" />
<result column="routing_key_id" jdbcType="VARCHAR" property="routingKeyId" />
<result column="routing_key_name" jdbcType="VARCHAR" property="routingKeyName" />
<result column="subscriber" jdbcType="VARCHAR" property="subscriber" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
<!--@mbg.generated--><!--@Table user_message_binding-->
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="server_id" jdbcType="VARCHAR" property="serverId"/>
<result column="server_name" jdbcType="VARCHAR" property="serverName"/>
<result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId"/>
<result column="virtual_host_name" jdbcType="VARCHAR" property="virtualHostName"/>
<result column="exchange_id" jdbcType="VARCHAR" property="exchangeId"/>
<result column="exchange_name" jdbcType="VARCHAR" property="exchangeName"/>
<result column="queue_id" jdbcType="VARCHAR" property="queueId"/>
<result column="queue_name" jdbcType="VARCHAR" property="queueName"/>
<result column="routing_key_id" jdbcType="VARCHAR" property="routingKeyId"/>
<result column="routing_key_name" jdbcType="VARCHAR" property="routingKeyName"/>
<result column="subscriber" jdbcType="VARCHAR" property="subscriber"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, user_id, username, server_id, `server_name`, virtual_host_id, virtual_host_name,
<!--@mbg.generated-->id, user_id, username, server_id, `server_name`, virtual_host_id, virtual_host_name,
exchange_id, exchange_name, queue_id, queue_name, routing_key_id, routing_key_name,
subscriber, description, gmt_create, gmt_modified
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
<!--@mbg.generated-->select
<include refid="Base_Column_List"/>
from user_message_binding
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from user_message_binding
<!--@mbg.generated-->delete
from user_message_binding
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding">
<!--@mbg.generated-->
insert into user_message_binding (id, user_id, username,
<!--@mbg.generated-->insert into user_message_binding (id, user_id, username,
server_id, `server_name`, virtual_host_id,
virtual_host_name, exchange_id, exchange_name,
queue_id, queue_name, routing_key_id,
routing_key_name, subscriber, description,
gmt_create, gmt_modified)
values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR},
#{serverId,jdbcType=VARCHAR}, #{serverName,jdbcType=VARCHAR}, #{virtualHostId,jdbcType=VARCHAR},
#{virtualHostName,jdbcType=VARCHAR}, #{exchangeId,jdbcType=VARCHAR}, #{exchangeName,jdbcType=VARCHAR},
#{queueId,jdbcType=VARCHAR}, #{queueName,jdbcType=VARCHAR}, #{routingKeyId,jdbcType=VARCHAR},
#{routingKeyName,jdbcType=VARCHAR}, #{subscriber,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{serverId,jdbcType=VARCHAR}, #{serverName,jdbcType=VARCHAR},
#{virtualHostId,jdbcType=VARCHAR},
#{virtualHostName,jdbcType=VARCHAR}, #{exchangeId,jdbcType=VARCHAR},
#{exchangeName,jdbcType=VARCHAR},
#{queueId,jdbcType=VARCHAR}, #{queueName,jdbcType=VARCHAR},
#{routingKeyId,jdbcType=VARCHAR},
#{routingKeyName,jdbcType=VARCHAR}, #{subscriber,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR},
#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding">
<!--@mbg.generated-->
insert into user_message_binding
<!--@mbg.generated-->insert into user_message_binding
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="username != null">
username,
</if>
<if test="serverId != null">
server_id,
</if>
<if test="serverName != null">
`server_name`,
</if>
<if test="virtualHostId != null">
virtual_host_id,
</if>
<if test="virtualHostName != null">
virtual_host_name,
</if>
<if test="exchangeId != null">
exchange_id,
</if>
<if test="exchangeName != null">
exchange_name,
</if>
<if test="queueId != null">
queue_id,
</if>
<if test="queueName != null">
queue_name,
</if>
<if test="routingKeyId != null">
routing_key_id,
</if>
<if test="routingKeyName != null">
routing_key_name,
</if>
<if test="subscriber != null">
subscriber,
</if>
<if test="description != null">
description,
</if>
<if test="gmtCreate != null">
gmt_create,
</if>
<if test="gmtModified != null">
gmt_modified,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="serverId != null">
#{serverId,jdbcType=VARCHAR},
</if>
<if test="serverName != null">
#{serverName,jdbcType=VARCHAR},
</if>
<if test="virtualHostId != null">
#{virtualHostId,jdbcType=VARCHAR},
</if>
<if test="virtualHostName != null">
#{virtualHostName,jdbcType=VARCHAR},
</if>
<if test="exchangeId != null">
#{exchangeId,jdbcType=VARCHAR},
</if>
<if test="exchangeName != null">
#{exchangeName,jdbcType=VARCHAR},
</if>
<if test="queueId != null">
#{queueId,jdbcType=VARCHAR},
</if>
<if test="queueName != null">
#{queueName,jdbcType=VARCHAR},
</if>
<if test="routingKeyId != null">
#{routingKeyId,jdbcType=VARCHAR},
</if>
<if test="routingKeyName != null">
#{routingKeyName,jdbcType=VARCHAR},
</if>
<if test="subscriber != null">
#{subscriber,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
#{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
#{gmtModified,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding">
<!--@mbg.generated-->
update user_message_binding
<!--@mbg.generated-->update user_message_binding
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="serverId != null">
server_id = #{serverId,jdbcType=VARCHAR},
</if>
<if test="serverName != null">
`server_name` = #{serverName,jdbcType=VARCHAR},
</if>
<if test="virtualHostId != null">
virtual_host_id = #{virtualHostId,jdbcType=VARCHAR},
</if>
<if test="virtualHostName != null">
virtual_host_name = #{virtualHostName,jdbcType=VARCHAR},
</if>
<if test="exchangeId != null">
exchange_id = #{exchangeId,jdbcType=VARCHAR},
</if>
<if test="exchangeName != null">
exchange_name = #{exchangeName,jdbcType=VARCHAR},
</if>
<if test="queueId != null">
queue_id = #{queueId,jdbcType=VARCHAR},
</if>
<if test="queueName != null">
queue_name = #{queueName,jdbcType=VARCHAR},
</if>
<if test="routingKeyId != null">
routing_key_id = #{routingKeyId,jdbcType=VARCHAR},
</if>
<if test="routingKeyName != null">
routing_key_name = #{routingKeyName,jdbcType=VARCHAR},
</if>
<if test="subscriber != null">
subscriber = #{subscriber,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding">
<!--@mbg.generated-->
update user_message_binding
<!--@mbg.generated-->update user_message_binding
set user_id = #{userId,jdbcType=VARCHAR},
username = #{username,jdbcType=VARCHAR},
server_id = #{serverId,jdbcType=VARCHAR},
... ... @@ -240,47 +340,81 @@
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=VARCHAR}
</update>
<!-- 查询列表,选择性 -->
<select id="selectUserMessageBindingList" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding" resultMap="BaseResultMap">
select
user_id, username, server_id, `server_name`, virtual_host_id, virtual_host_name,
exchange_id, exchange_name, routing_key_id, routing_key_name,
GROUP_CONCAT(id) as id, GROUP_CONCAT(queue_id) as queue_id, GROUP_CONCAT(queue_name) as queue_name,
<select id="selectUserMessageBindingList"
parameterType="com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding" resultMap="BaseResultMap">
select user_id,
username,
server_id,
`server_name`,
virtual_host_id,
virtual_host_name,
exchange_id,
exchange_name,
routing_key_id,
routing_key_name,
GROUP_CONCAT(id) as id,
GROUP_CONCAT(queue_id) as queue_id,
GROUP_CONCAT(queue_name) as queue_name,
GROUP_CONCAT(description) as description
from user_message_binding
<where>
<!-- 所属用户登陆名称 -->
<if test="username != null and username !=''">
<if test="username != null and username != ''">
username = #{username,jdbcType=VARCHAR}
</if>
<!-- 所属服务器名称 -->
<if test="serverName != null and serverName !=''">
<if test="serverName != null and serverName != ''">
AND `server_name` = #{serverName,jdbcType=VARCHAR}
</if>
<!-- 所属虚拟主机名称 -->
<if test="virtualHostName != null and virtualHostName !=''">
<if test="virtualHostName != null and virtualHostName != ''">
AND virtual_host_name = #{virtualHostName,jdbcType=VARCHAR}
</if>
<!-- 所属交换机名称 -->
<if test="exchangeName != null and exchangeName !=''">
<if test="exchangeName != null and exchangeName != ''">
AND exchange_name = #{exchangeName,jdbcType=VARCHAR}
</if>
<!-- 所属队列名称 -->
<if test="queueName != null and queueName !=''">
<if test="queueName != null and queueName != ''">
AND queue_name = #{queueName,jdbcType=VARCHAR}
</if>
<!-- 所属路由键名称 -->
<if test="routingKeyName != null and routingKeyName !=''">
<if test="routingKeyName != null and routingKeyName != ''">
AND routing_key_name = #{routingKeyName,jdbcType=VARCHAR}
</if>
<!-- 订阅者 -->
<!-- <if test="subscriber != null and subscriber !=''">-->
<!-- AND subscriber = #{subscriber,jdbcType=VARCHAR}-->
<!-- </if>-->
<!-- <if test="subscriber != null and subscriber !=''">-->
<!-- AND subscriber = #{subscriber,jdbcType=VARCHAR}-->
<!-- </if>-->
</where>
group by user_id, username, server_id, `server_name`, virtual_host_id, virtual_host_name,
exchange_id, exchange_name, routing_key_id, routing_key_name
</select>
<!-- 校验是否已存在 -->
<select id="validateBinding" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from user_message_binding
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -4,12 +4,12 @@
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost">
<!--@mbg.generated-->
<!--@Table user_server_virtual_host-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="server_id" jdbcType="VARCHAR" property="serverId" />
<result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId" />
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="server_id" jdbcType="VARCHAR" property="serverId"/>
<result column="virtual_host_id" jdbcType="VARCHAR" property="virtualHostId"/>
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
... ... @@ -18,23 +18,22 @@
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from user_server_virtual_host
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from user_server_virtual_host
delete
from user_server_virtual_host
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost">
<!--@mbg.generated-->
insert into user_server_virtual_host (id, username, server_id,
virtual_host_id, gmt_create, gmt_modified
)
virtual_host_id, gmt_create, gmt_modified)
values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{serverId,jdbcType=VARCHAR},
#{virtualHostId,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}
)
#{virtualHostId,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost">
<!--@mbg.generated-->
... ... @@ -80,7 +79,8 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost">
<update id="updateByPrimaryKeySelective"
parameterType="com.sunyo.wlpt.message.bus.service.domain.UserServerVirtualHost">
<!--@mbg.generated-->
update user_server_virtual_host
<set>
... ...
... ... @@ -15,8 +15,8 @@
<resultMap id="HostAndServerMap" extends="BaseResultMap"
type="com.sunyo.wlpt.message.bus.service.domain.VirtualHost">
<association property="busServer" javaType="com.sunyo.wlpt.message.bus.service.domain.BusServer">
<id column="id" property="id"></id>
<result column="server_name" property="serverName"></result>
<id column="id" property="id"/>
<result column="server_name" property="serverName"/>
</association>
</resultMap>
... ... @@ -35,19 +35,25 @@
<!-- 查询虚拟主机列表,选择性 -->
<select id="selectVirtualHostList" parameterType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost"
resultMap="HostAndServerMap">
select
v.id, v.virtual_host_name, v.server_id, v.description, v.gmt_create, v.gmt_modified, s.server_name
from virtual_host as v,bus_server as s
select v.id,
v.virtual_host_name,
v.server_id,
v.description,
v.gmt_create,
v.gmt_modified,
s.server_name
from virtual_host as v,
bus_server as s
<where>
<!-- 所属服务器ID -->
<if test="serverId != null and serverId !=''">
<if test="serverId != null and serverId != ''">
v.server_id = #{serverId,jdbcType=VARCHAR}
</if>
<!-- 虚拟主机名称 -->
<if test="virtualHostName != null and virtualHostName !=''">
<if test="virtualHostName != null and virtualHostName != ''">
and v.virtual_host_name = #{virtualHostName,jdbcType=VARCHAR}
</if>
and v.server_id=s.id
and v.server_id = s.id
</where>
</select>
... ... @@ -78,7 +84,7 @@
from virtual_host
<where>
<!-- 虚拟主机名称 -->
<if test="virtualHostName != null and virtualHostName !=''">
<if test="virtualHostName != null and virtualHostName != ''">
virtual_host_name = #{virtualHostName,jdbcType=VARCHAR}
</if>
</where>
... ... @@ -90,7 +96,7 @@
from virtual_host
<where>
<!-- 所属服务器ID -->
<if test="serverId != null and serverId !=''">
<if test="serverId != null and serverId != ''">
server_id = #{serverId,jdbcType=VARCHAR}
</if>
</where>
... ... @@ -98,17 +104,16 @@
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from virtual_host
delete
from virtual_host
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost">
<!--@mbg.generated-->
insert into virtual_host (id, virtual_host_name, server_id,
description, gmt_create, gmt_modified
)
description, gmt_create, gmt_modified)
values (#{id,jdbcType=VARCHAR}, #{virtualHostName,jdbcType=VARCHAR}, #{serverId,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}
)
#{description,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.domain.VirtualHost">
<!--@mbg.generated-->
... ... @@ -186,5 +191,4 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
... ...