正在显示
15 个修改的文件
包含
233 行增加
和
24 行删除
| 1 | package com.sunyo.wlpt.message.bus.service.controller; | 1 | package com.sunyo.wlpt.message.bus.service.controller; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import com.github.pagehelper.PageInfo; | ||
| 4 | import com.sunyo.wlpt.message.bus.service.model.MessageRouter; | 5 | import com.sunyo.wlpt.message.bus.service.model.MessageRouter; |
| 6 | +import com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver; | ||
| 7 | +import com.sunyo.wlpt.message.bus.service.model.MessageRouterReciverFilter; | ||
| 5 | import com.sunyo.wlpt.message.bus.service.response.ResultJson; | 8 | import com.sunyo.wlpt.message.bus.service.response.ResultJson; |
| 9 | +import com.sunyo.wlpt.message.bus.service.service.MessageRouterReciverFilterService; | ||
| 10 | +import com.sunyo.wlpt.message.bus.service.service.MessageRouterReciverService; | ||
| 11 | +import com.sunyo.wlpt.message.bus.service.service.MessageRouterService; | ||
| 6 | import com.sunyo.wlpt.message.bus.service.service.RouterService; | 12 | import com.sunyo.wlpt.message.bus.service.service.RouterService; |
| 7 | import io.swagger.annotations.ApiOperation; | 13 | import io.swagger.annotations.ApiOperation; |
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.web.bind.annotation.*; | 15 | import org.springframework.web.bind.annotation.*; |
| 16 | +import org.springframework.transaction.annotation.Transactional; | ||
| 17 | +import org.springframework.web.bind.annotation.*; | ||
| 10 | 18 | ||
| 11 | import java.util.List; | 19 | import java.util.List; |
| 20 | +import java.util.UUID; | ||
| 12 | 21 | ||
| 13 | @RequestMapping("/bus/router") | 22 | @RequestMapping("/bus/router") |
| 14 | @RestController | 23 | @RestController |
| @@ -17,6 +26,12 @@ public class RouterController { | @@ -17,6 +26,12 @@ public class RouterController { | ||
| 17 | @Autowired | 26 | @Autowired |
| 18 | RouterService routerService; | 27 | RouterService routerService; |
| 19 | 28 | ||
| 29 | + @Autowired | ||
| 30 | + MessageRouterService messageRouterService; | ||
| 31 | + @Autowired | ||
| 32 | + MessageRouterReciverService messageRouterReciverService; | ||
| 33 | + @Autowired | ||
| 34 | + MessageRouterReciverFilterService messageRouterReciverFilterService; | ||
| 20 | 35 | ||
| 21 | @ApiOperation(value = "批量添加消息路由", notes = "超级管理修改其他用户密码") | 36 | @ApiOperation(value = "批量添加消息路由", notes = "超级管理修改其他用户密码") |
| 22 | @PostMapping("batchAdd") | 37 | @PostMapping("batchAdd") |
| @@ -31,4 +46,51 @@ public class RouterController { | @@ -31,4 +46,51 @@ public class RouterController { | ||
| 31 | return new ResultJson<>("200","success",all); | 46 | return new ResultJson<>("200","success",all); |
| 32 | } | 47 | } |
| 33 | 48 | ||
| 49 | + | ||
| 50 | + @PostMapping("/addRouter") | ||
| 51 | + @Transactional | ||
| 52 | + public ResultJson addRouter(@RequestBody MessageRouter messageRouter) throws Exception { | ||
| 53 | + String routerid=UUID.randomUUID().toString(); | ||
| 54 | + String reciverid=UUID.randomUUID().toString(); | ||
| 55 | + messageRouter.setId(routerid); | ||
| 56 | + int result=messageRouterService.addRouter(messageRouter); | ||
| 57 | + if(messageRouter.getReciver()!=null){ | ||
| 58 | + MessageRouterReciver routerReciver=new MessageRouterReciver(); | ||
| 59 | + routerReciver.setId(reciverid); | ||
| 60 | + routerReciver.setMessageRouterId(routerid); | ||
| 61 | + routerReciver.setRcvrTopic(messageRouter.getReciver().getRcvrTopic()); | ||
| 62 | + messageRouterReciverService.addMessageRouterReciver(routerReciver); | ||
| 63 | + if(messageRouter.getReciver().getReciverFilter()!=null){ | ||
| 64 | + MessageRouterReciverFilter routerReciverFilter=new MessageRouterReciverFilter(); | ||
| 65 | + routerReciverFilter.setId(UUID.randomUUID().toString()); | ||
| 66 | + routerReciverFilter.setMessageRouterReciverId(reciverid); | ||
| 67 | + routerReciverFilter.setFilter(messageRouter.getReciver().getReciverFilter().getFilter()); | ||
| 68 | + messageRouterReciverFilterService.addMessageRouterReciverFilter(routerReciverFilter); | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + return result>0?new ResultJson("200","路由消息新增成功"):new ResultJson("500","路由消息新增失败"); | ||
| 72 | + } | ||
| 73 | + @RequestMapping("/delRouter") | ||
| 74 | + public ResultJson delRouter(@RequestParam(value = "id", required = false) String id)throws Exception{ | ||
| 75 | + int result=messageRouterService.delRouter(id); | ||
| 76 | + return result>0?new ResultJson("200","路由消息删除成功"):new ResultJson("500","路由消息删除失败"); | ||
| 77 | + } | ||
| 78 | + @PutMapping("/ediRouter") | ||
| 79 | + public ResultJson edi(@RequestBody MessageRouter messageRouter)throws Exception { | ||
| 80 | + int result=messageRouterService.ediRouter(messageRouter); | ||
| 81 | + return result>0?new ResultJson("200","路由消息修改成功"):new ResultJson("500","路由消息修改失败"); | ||
| 82 | + } | ||
| 83 | + @RequestMapping("/queRouter") | ||
| 84 | + public ResultJson<PageInfo> queRouter(@RequestParam(value = "sndr", required = false) String sndr, | ||
| 85 | + @RequestParam(value = "btype", required = false) String btype, | ||
| 86 | + @RequestParam(value = "stype", required = false) String stype, | ||
| 87 | + @RequestParam(value = "currentPage",required = false,defaultValue = "1") int currentPage, | ||
| 88 | + @RequestParam(value = "pageSize",required = false,defaultValue = "10") int pageSize)throws Exception{ | ||
| 89 | + MessageRouter messageRouter=new MessageRouter(); | ||
| 90 | + messageRouter.setSndr(sndr); | ||
| 91 | + messageRouter.setBtype(btype); | ||
| 92 | + messageRouter.setStype(stype); | ||
| 93 | + PageInfo<MessageRouter> pageInfo=messageRouterService.queRouterList(messageRouter,currentPage,pageSize); | ||
| 94 | + return new ResultJson<>("200","success",pageInfo); | ||
| 95 | + } | ||
| 34 | } | 96 | } |
| 1 | package com.sunyo.wlpt.message.bus.service.mapper; | 1 | package com.sunyo.wlpt.message.bus.service.mapper; |
| 2 | 2 | ||
| 3 | +import com.github.pagehelper.PageInfo; | ||
| 3 | import com.sunyo.wlpt.message.bus.service.model.MessageRouter; | 4 | import com.sunyo.wlpt.message.bus.service.model.MessageRouter; |
| 4 | 5 | ||
| 5 | import java.util.List; | 6 | import java.util.List; |
| @@ -18,4 +19,6 @@ public interface MessageRouterMapper { | @@ -18,4 +19,6 @@ public interface MessageRouterMapper { | ||
| 18 | int updateByPrimaryKeySelective(MessageRouter record); | 19 | int updateByPrimaryKeySelective(MessageRouter record); |
| 19 | 20 | ||
| 20 | int updateByPrimaryKey(MessageRouter record); | 21 | int updateByPrimaryKey(MessageRouter record); |
| 21 | -} | ||
| 22 | + | ||
| 23 | + List<MessageRouter> queRouterList(MessageRouter messageRouter); | ||
| 24 | +} |
| @@ -2,6 +2,8 @@ package com.sunyo.wlpt.message.bus.service.mapper; | @@ -2,6 +2,8 @@ package com.sunyo.wlpt.message.bus.service.mapper; | ||
| 2 | 2 | ||
| 3 | import com.sunyo.wlpt.message.bus.service.model.MessageRouterReciverFilter; | 3 | import com.sunyo.wlpt.message.bus.service.model.MessageRouterReciverFilter; |
| 4 | 4 | ||
| 5 | +import java.util.List; | ||
| 6 | + | ||
| 5 | public interface MessageRouterReciverFilterMapper { | 7 | public interface MessageRouterReciverFilterMapper { |
| 6 | int deleteByPrimaryKey(String id); | 8 | int deleteByPrimaryKey(String id); |
| 7 | 9 | ||
| @@ -11,7 +13,9 @@ public interface MessageRouterReciverFilterMapper { | @@ -11,7 +13,9 @@ public interface MessageRouterReciverFilterMapper { | ||
| 11 | 13 | ||
| 12 | MessageRouterReciverFilter selectByPrimaryKey(String id); | 14 | MessageRouterReciverFilter selectByPrimaryKey(String id); |
| 13 | 15 | ||
| 16 | + List<MessageRouterReciverFilter> selectByFilterKey(String id); | ||
| 17 | + | ||
| 14 | int updateByPrimaryKeySelective(MessageRouterReciverFilter record); | 18 | int updateByPrimaryKeySelective(MessageRouterReciverFilter record); |
| 15 | 19 | ||
| 16 | int updateByPrimaryKey(MessageRouterReciverFilter record); | 20 | int updateByPrimaryKey(MessageRouterReciverFilter record); |
| 17 | -} | ||
| 21 | +} |
| 1 | package com.sunyo.wlpt.message.bus.service.model; | 1 | package com.sunyo.wlpt.message.bus.service.model; |
| 2 | 2 | ||
| 3 | +import lombok.Data; | ||
| 4 | + | ||
| 3 | import java.util.Date; | 5 | import java.util.Date; |
| 4 | import java.util.List; | 6 | import java.util.List; |
| 5 | - | 7 | +@Data |
| 6 | public class MessageRouter { | 8 | public class MessageRouter { |
| 7 | private String id; | 9 | private String id; |
| 8 | 10 | ||
| @@ -32,6 +34,8 @@ public class MessageRouter { | @@ -32,6 +34,8 @@ public class MessageRouter { | ||
| 32 | 34 | ||
| 33 | private List<MessageRouterReciver> rcvrList; | 35 | private List<MessageRouterReciver> rcvrList; |
| 34 | 36 | ||
| 37 | + private MessageRouterReciver reciver; | ||
| 38 | + | ||
| 35 | private List<String> sndrs; | 39 | private List<String> sndrs; |
| 36 | 40 | ||
| 37 | private List<MessageType> types; | 41 | private List<MessageType> types; |
| @@ -173,4 +177,4 @@ public class MessageRouter { | @@ -173,4 +177,4 @@ public class MessageRouter { | ||
| 173 | public void setRcvrList(List<MessageRouterReciver> rcvrList) { | 177 | public void setRcvrList(List<MessageRouterReciver> rcvrList) { |
| 174 | this.rcvrList = rcvrList; | 178 | this.rcvrList = rcvrList; |
| 175 | } | 179 | } |
| 176 | -} | ||
| 180 | +} |
| 1 | package com.sunyo.wlpt.message.bus.service.model; | 1 | package com.sunyo.wlpt.message.bus.service.model; |
| 2 | 2 | ||
| 3 | +import lombok.Data; | ||
| 4 | + | ||
| 3 | import java.util.Date; | 5 | import java.util.Date; |
| 6 | +import java.util.List; | ||
| 4 | 7 | ||
| 8 | +@Data | ||
| 5 | public class MessageRouterReciver { | 9 | public class MessageRouterReciver { |
| 6 | private String id; | 10 | private String id; |
| 7 | 11 | ||
| @@ -12,6 +16,8 @@ public class MessageRouterReciver { | @@ -12,6 +16,8 @@ public class MessageRouterReciver { | ||
| 12 | private Date creatTime; | 16 | private Date creatTime; |
| 13 | 17 | ||
| 14 | private Date updateTime; | 18 | private Date updateTime; |
| 19 | + private MessageRouterReciverFilter reciverFilter; | ||
| 20 | + private List<MessageRouterReciverFilter> filterList; | ||
| 15 | 21 | ||
| 16 | public String getId() { | 22 | public String getId() { |
| 17 | return id; | 23 | return id; |
| @@ -52,4 +58,4 @@ public class MessageRouterReciver { | @@ -52,4 +58,4 @@ public class MessageRouterReciver { | ||
| 52 | public void setUpdateTime(Date updateTime) { | 58 | public void setUpdateTime(Date updateTime) { |
| 53 | this.updateTime = updateTime; | 59 | this.updateTime = updateTime; |
| 54 | } | 60 | } |
| 55 | -} | ||
| 61 | +} |
| 1 | package com.sunyo.wlpt.message.bus.service.model; | 1 | package com.sunyo.wlpt.message.bus.service.model; |
| 2 | 2 | ||
| 3 | -import java.util.Date; | 3 | +import lombok.Data; |
| 4 | 4 | ||
| 5 | +import java.util.Date; | ||
| 6 | +@Data | ||
| 5 | public class MessageRouterReciverFilter { | 7 | public class MessageRouterReciverFilter { |
| 6 | private String id; | 8 | private String id; |
| 7 | 9 | ||
| @@ -82,4 +84,4 @@ public class MessageRouterReciverFilter { | @@ -82,4 +84,4 @@ public class MessageRouterReciverFilter { | ||
| 82 | public void setUpdateTime(Date updateTime) { | 84 | public void setUpdateTime(Date updateTime) { |
| 83 | this.updateTime = updateTime; | 85 | this.updateTime = updateTime; |
| 84 | } | 86 | } |
| 85 | -} | ||
| 87 | +} |
| 1 | +package com.sunyo.wlpt.message.bus.service.service; | ||
| 2 | + | ||
| 3 | +import com.github.pagehelper.PageInfo; | ||
| 4 | +import com.sunyo.wlpt.message.bus.service.model.MessageRouter; | ||
| 5 | + | ||
| 6 | +public interface MessageRouterService { | ||
| 7 | + int addRouter(MessageRouter messageRouter)throws Exception; | ||
| 8 | + int delRouter(String id)throws Exception; | ||
| 9 | + int ediRouter(MessageRouter messageRouter)throws Exception; | ||
| 10 | + PageInfo<MessageRouter> queRouterList(MessageRouter messageRouter,int pageNum,int pageSize)throws Exception; | ||
| 11 | +} |
| 1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
| 2 | + | ||
| 3 | +import com.github.pagehelper.PageHelper; | ||
| 4 | +import com.github.pagehelper.PageInfo; | ||
| 5 | +import com.sunyo.wlpt.message.bus.service.mapper.MessageRouterMapper; | ||
| 6 | +import com.sunyo.wlpt.message.bus.service.model.MessageRouter; | ||
| 7 | +import com.sunyo.wlpt.message.bus.service.service.MessageRouterService; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.stereotype.Service; | ||
| 10 | + | ||
| 11 | +import java.util.List; | ||
| 12 | +import java.util.UUID; | ||
| 13 | + | ||
| 14 | +@Service | ||
| 15 | +public class MessageRouterImpl implements MessageRouterService { | ||
| 16 | + @Autowired | ||
| 17 | + MessageRouterMapper messageRouterMapper; | ||
| 18 | + @Override | ||
| 19 | + public int addRouter(MessageRouter messageRouter) throws Exception { | ||
| 20 | + return messageRouterMapper.insertSelective(messageRouter); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + @Override | ||
| 24 | + public int delRouter(String id) throws Exception { | ||
| 25 | + return messageRouterMapper.deleteByPrimaryKey(id); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + @Override | ||
| 29 | + public int ediRouter(MessageRouter messageRouter) throws Exception { | ||
| 30 | + return messageRouterMapper.updateByPrimaryKeySelective(messageRouter); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + @Override | ||
| 34 | + public PageInfo<MessageRouter> queRouterList(MessageRouter messageRouter,int pageNum,int pageSize) throws Exception { | ||
| 35 | + PageHelper.startPage(pageNum,pageSize); | ||
| 36 | + List<MessageRouter> list=messageRouterMapper.queRouterList(messageRouter); | ||
| 37 | + PageInfo<MessageRouter> result=new PageInfo<>(list); | ||
| 38 | + return result; | ||
| 39 | + } | ||
| 40 | +} |
src/main/java/com/sunyo/wlpt/message/bus/service/service/impl/MessageRouterReciverFilterImpl.java
0 → 100644
| 1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
| 2 | + | ||
| 3 | +import com.sunyo.wlpt.message.bus.service.mapper.MessageRouterReciverFilterMapper; | ||
| 4 | +import com.sunyo.wlpt.message.bus.service.model.MessageRouterReciverFilter; | ||
| 5 | +import com.sunyo.wlpt.message.bus.service.service.MessageRouterReciverFilterService; | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.stereotype.Service; | ||
| 8 | + | ||
| 9 | +@Service | ||
| 10 | +public class MessageRouterReciverFilterImpl implements MessageRouterReciverFilterService { | ||
| 11 | + @Autowired | ||
| 12 | + MessageRouterReciverFilterMapper messageRouterReciverFilterMapper; | ||
| 13 | + | ||
| 14 | + @Override | ||
| 15 | + public int addMessageRouterReciverFilter(MessageRouterReciverFilter messageRouterReciverFilter) { | ||
| 16 | + return messageRouterReciverFilterMapper.insertSelective(messageRouterReciverFilter); | ||
| 17 | + } | ||
| 18 | +} |
src/main/java/com/sunyo/wlpt/message/bus/service/service/impl/MessageRouterReciverImpl.java
0 → 100644
| 1 | +package com.sunyo.wlpt.message.bus.service.service.impl; | ||
| 2 | + | ||
| 3 | +import com.sunyo.wlpt.message.bus.service.mapper.MessageRouterReciverMapper; | ||
| 4 | +import com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver; | ||
| 5 | +import com.sunyo.wlpt.message.bus.service.service.MessageRouterReciverService; | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.stereotype.Service; | ||
| 8 | + | ||
| 9 | +@Service | ||
| 10 | +public class MessageRouterReciverImpl implements MessageRouterReciverService { | ||
| 11 | + @Autowired | ||
| 12 | + MessageRouterReciverMapper messageRouterReciverMapper; | ||
| 13 | + @Override | ||
| 14 | + public int addMessageRouterReciver(MessageRouterReciver messageRouterReciver) throws Exception { | ||
| 15 | + return messageRouterReciverMapper.insertSelective(messageRouterReciver); | ||
| 16 | + } | ||
| 17 | +} |
| @@ -15,17 +15,32 @@ | @@ -15,17 +15,32 @@ | ||
| 15 | <result column="ver" property="ver" jdbcType="VARCHAR" /> | 15 | <result column="ver" property="ver" jdbcType="VARCHAR" /> |
| 16 | <result column="creat_time" property="creatTime" jdbcType="TIMESTAMP" /> | 16 | <result column="creat_time" property="creatTime" jdbcType="TIMESTAMP" /> |
| 17 | <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> | 17 | <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| 18 | + <collection column="id" javaType="java.util.ArrayList" ofType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver" property="rcvrList" select="com.sunyo.wlpt.message.bus.service.mapper.MessageRouterReciverMapper.selectByRouterKey" /> | ||
| 18 | </resultMap> | 19 | </resultMap> |
| 19 | <sql id="Base_Column_List" > | 20 | <sql id="Base_Column_List" > |
| 20 | id, sndr, btype, stype, optype, msg_limit, `character`, status, `usage`, des, ver, creat_time, | 21 | id, sndr, btype, stype, optype, msg_limit, `character`, status, `usage`, des, ver, creat_time, |
| 21 | update_time | 22 | update_time |
| 22 | </sql> | 23 | </sql> |
| 23 | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > | 24 | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > |
| 24 | - select | 25 | + select |
| 25 | <include refid="Base_Column_List" /> | 26 | <include refid="Base_Column_List" /> |
| 26 | from message_router | 27 | from message_router |
| 27 | where id = #{id,jdbcType=VARCHAR} | 28 | where id = #{id,jdbcType=VARCHAR} |
| 28 | </select> | 29 | </select> |
| 30 | + <select id="queRouterList" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouter" resultMap="BaseResultMap"> | ||
| 31 | + select | ||
| 32 | + <include refid="Base_Column_List" /> | ||
| 33 | + from message_router where 1=1 | ||
| 34 | + <if test="sndr != null" > | ||
| 35 | + and sndr = #{sndr,jdbcType=VARCHAR} | ||
| 36 | + </if> | ||
| 37 | + <if test="btype != null" > | ||
| 38 | + and btype = #{btype,jdbcType=VARCHAR} | ||
| 39 | + </if> | ||
| 40 | + <if test="stype != null" > | ||
| 41 | + and stype = #{stype,jdbcType=VARCHAR} | ||
| 42 | + </if> | ||
| 43 | + </select> | ||
| 29 | 44 | ||
| 30 | <select id="selectBySndr" resultMap="BaseResultMap" parameterType="java.lang.String" > | 45 | <select id="selectBySndr" resultMap="BaseResultMap" parameterType="java.lang.String" > |
| 31 | select | 46 | select |
| @@ -36,16 +51,16 @@ | @@ -36,16 +51,16 @@ | ||
| 36 | 51 | ||
| 37 | <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > | 52 | <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > |
| 38 | delete from message_router | 53 | delete from message_router |
| 39 | - where id = #{sndr,jdbcType=VARCHAR} | 54 | + where id = #{id,jdbcType=VARCHAR} |
| 40 | </delete> | 55 | </delete> |
| 41 | <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouter" > | 56 | <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouter" > |
| 42 | - insert into message_router (id, sndr, btype, | ||
| 43 | - stype, optype, msg_limit, | 57 | + insert into message_router (id, sndr, btype, |
| 58 | + stype, optype, msg_limit, | ||
| 44 | `character`, `status`, `usage`, des, | 59 | `character`, `status`, `usage`, des, |
| 45 | ver, creat_time, update_time | 60 | ver, creat_time, update_time |
| 46 | ) | 61 | ) |
| 47 | - values (#{id,jdbcType=VARCHAR}, #{sndr,jdbcType=VARCHAR}, #{btype,jdbcType=VARCHAR}, | ||
| 48 | - #{stype,jdbcType=VARCHAR}, #{optype,jdbcType=VARCHAR}, #{msgLimit,jdbcType=TINYINT}, | 62 | + values (#{id,jdbcType=VARCHAR}, #{sndr,jdbcType=VARCHAR}, #{btype,jdbcType=VARCHAR}, |
| 63 | + #{stype,jdbcType=VARCHAR}, #{optype,jdbcType=VARCHAR}, #{msgLimit,jdbcType=TINYINT}, | ||
| 49 | #{character,jdbcType=VARCHAR}, #{status,jdbcType=BIT}, #{usage,jdbcType=TINYINT}, #{des,jdbcType=VARCHAR}, | 64 | #{character,jdbcType=VARCHAR}, #{status,jdbcType=BIT}, #{usage,jdbcType=TINYINT}, #{des,jdbcType=VARCHAR}, |
| 50 | #{ver,jdbcType=VARCHAR}, #{creatTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} | 65 | #{ver,jdbcType=VARCHAR}, #{creatTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} |
| 51 | ) | 66 | ) |
| @@ -193,4 +208,4 @@ | @@ -193,4 +208,4 @@ | ||
| 193 | update_time = #{updateTime,jdbcType=TIMESTAMP} | 208 | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| 194 | where id = #{id,jdbcType=VARCHAR} | 209 | where id = #{id,jdbcType=VARCHAR} |
| 195 | </update> | 210 | </update> |
| 196 | -</mapper> | ||
| 211 | +</mapper> |
| @@ -15,21 +15,27 @@ | @@ -15,21 +15,27 @@ | ||
| 15 | id, filter, filter_value, type, status, message_router_reciver_id, creat_time, update_time | 15 | id, filter, filter_value, type, status, message_router_reciver_id, creat_time, update_time |
| 16 | </sql> | 16 | </sql> |
| 17 | <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | 17 | <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| 18 | - select | 18 | + select |
| 19 | <include refid="Base_Column_List" /> | 19 | <include refid="Base_Column_List" /> |
| 20 | from message_router_reciver_filter | 20 | from message_router_reciver_filter |
| 21 | where id = #{id,jdbcType=VARCHAR} | 21 | where id = #{id,jdbcType=VARCHAR} |
| 22 | </select> | 22 | </select> |
| 23 | + <select id="selectByFilterKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | ||
| 24 | + select | ||
| 25 | + <include refid="Base_Column_List" /> | ||
| 26 | + from message_router_reciver_filter | ||
| 27 | + where message_router_reciver_id = #{messageRouterReciverId,jdbcType=VARCHAR} | ||
| 28 | + </select> | ||
| 23 | <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> | 29 | <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> |
| 24 | delete from message_router_reciver_filter | 30 | delete from message_router_reciver_filter |
| 25 | where id = #{id,jdbcType=VARCHAR} | 31 | where id = #{id,jdbcType=VARCHAR} |
| 26 | </delete> | 32 | </delete> |
| 27 | <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciverFilter"> | 33 | <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciverFilter"> |
| 28 | - insert into message_router_reciver_filter (id, filter, filter_value, | ||
| 29 | - type, status, message_router_reciver_id, | 34 | + insert into message_router_reciver_filter (id, filter, filter_value, |
| 35 | + type, status, message_router_reciver_id, | ||
| 30 | creat_time, update_time) | 36 | creat_time, update_time) |
| 31 | - values (#{id,jdbcType=VARCHAR}, #{filter,jdbcType=VARCHAR}, #{filterValue,jdbcType=VARCHAR}, | ||
| 32 | - #{type,jdbcType=VARCHAR}, #{status,jdbcType=BIT}, #{messageRouterReciverId,jdbcType=VARCHAR}, | 37 | + values (#{id,jdbcType=VARCHAR}, #{filter,jdbcType=VARCHAR}, #{filterValue,jdbcType=VARCHAR}, |
| 38 | + #{type,jdbcType=VARCHAR}, #{status,jdbcType=BIT}, #{messageRouterReciverId,jdbcType=VARCHAR}, | ||
| 33 | #{creatTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) | 39 | #{creatTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) |
| 34 | </insert> | 40 | </insert> |
| 35 | <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciverFilter"> | 41 | <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciverFilter"> |
| @@ -125,4 +131,4 @@ | @@ -125,4 +131,4 @@ | ||
| 125 | update_time = #{updateTime,jdbcType=TIMESTAMP} | 131 | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| 126 | where id = #{id,jdbcType=VARCHAR} | 132 | where id = #{id,jdbcType=VARCHAR} |
| 127 | </update> | 133 | </update> |
| 128 | -</mapper> | ||
| 134 | +</mapper> |
| @@ -7,12 +7,13 @@ | @@ -7,12 +7,13 @@ | ||
| 7 | <result column="message_router_id" property="messageRouterId" jdbcType="VARCHAR" /> | 7 | <result column="message_router_id" property="messageRouterId" jdbcType="VARCHAR" /> |
| 8 | <result column="creat_time" property="creatTime" jdbcType="TIMESTAMP" /> | 8 | <result column="creat_time" property="creatTime" jdbcType="TIMESTAMP" /> |
| 9 | <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> | 9 | <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| 10 | + <collection column="id" javaType="java.util.ArrayList" ofType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciverFilter" property="filterList" select="com.sunyo.wlpt.message.bus.service.mapper.MessageRouterReciverFilterMapper.selectByFilterKey" /> | ||
| 10 | </resultMap> | 11 | </resultMap> |
| 11 | <sql id="Base_Column_List" > | 12 | <sql id="Base_Column_List" > |
| 12 | id, rcvr_topic, message_router_id, creat_time, update_time | 13 | id, rcvr_topic, message_router_id, creat_time, update_time |
| 13 | </sql> | 14 | </sql> |
| 14 | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > | 15 | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > |
| 15 | - select | 16 | + select |
| 16 | <include refid="Base_Column_List" /> | 17 | <include refid="Base_Column_List" /> |
| 17 | from message_router_reciver | 18 | from message_router_reciver |
| 18 | where id = #{id,jdbcType=VARCHAR} | 19 | where id = #{id,jdbcType=VARCHAR} |
| @@ -23,14 +24,20 @@ | @@ -23,14 +24,20 @@ | ||
| 23 | from message_router_reciver | 24 | from message_router_reciver |
| 24 | where message_router_id = #{messageRouterId,jdbcType=VARCHAR} | 25 | where message_router_id = #{messageRouterId,jdbcType=VARCHAR} |
| 25 | </select> | 26 | </select> |
| 27 | + <select id="queReciverList" resultMap="BaseResultMap" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver" > | ||
| 28 | + select | ||
| 29 | + <include refid="Base_Column_List" /> | ||
| 30 | + from message_router_reciver | ||
| 31 | + where id = #{id,jdbcType=VARCHAR} | ||
| 32 | + </select> | ||
| 26 | <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > | 33 | <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > |
| 27 | delete from message_router_reciver | 34 | delete from message_router_reciver |
| 28 | where id = #{id,jdbcType=VARCHAR} | 35 | where id = #{id,jdbcType=VARCHAR} |
| 29 | </delete> | 36 | </delete> |
| 30 | <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver" > | 37 | <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver" > |
| 31 | - insert into message_router_reciver (id, rcvr_topic, message_router_id, | 38 | + insert into message_router_reciver (id, rcvr_topic, message_router_id, |
| 32 | creat_time, update_time) | 39 | creat_time, update_time) |
| 33 | - values (#{id,jdbcType=VARCHAR}, #{rcvrTopic,jdbcType=VARCHAR}, #{messageRouterId,jdbcType=VARCHAR}, | 40 | + values (#{id,jdbcType=VARCHAR}, #{rcvrTopic,jdbcType=VARCHAR}, #{messageRouterId,jdbcType=VARCHAR}, |
| 34 | #{creatTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) | 41 | #{creatTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) |
| 35 | </insert> | 42 | </insert> |
| 36 | <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver" > | 43 | <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver" > |
| @@ -96,4 +103,4 @@ | @@ -96,4 +103,4 @@ | ||
| 96 | update_time = #{updateTime,jdbcType=TIMESTAMP} | 103 | update_time = #{updateTime,jdbcType=TIMESTAMP} |
| 97 | where id = #{id,jdbcType=VARCHAR} | 104 | where id = #{id,jdbcType=VARCHAR} |
| 98 | </update> | 105 | </update> |
| 99 | -</mapper> | ||
| 106 | +</mapper> |
-
请 注册 或 登录 后发表评论