异常消息修改

master
赵嘉伟 4 years ago
parent 9f41870344
commit b9b4add3fb

@ -1,130 +0,0 @@
package com.foreverwin.mesnac.anomaly.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.AbnormalMessage;
import com.foreverwin.mesnac.anomaly.service.AbnormalMessageService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* @author
* @since 2021-07-22
*/
@RestController
@RequestMapping("/Z-ABNORMAL-MESSAGE")
public class AbnormalMessageController {
@Autowired
public AbnormalMessageService abnormalMessageService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getAbnormalMessageById(@PathVariable String id) {
return R.ok( abnormalMessageService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getAbnormalMessageList(AbnormalMessage abnormalMessage){
List<AbnormalMessage> result;
QueryWrapper<AbnormalMessage> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalMessage);
result = abnormalMessageService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<AbnormalMessage> frontPage, AbnormalMessage abnormalMessage){
IPage result;
QueryWrapper<AbnormalMessage> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalMessage);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(AbnormalMessage::getHandle, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getSite, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getAbnormalBillBo, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getType, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getMessageType, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getSendUserGroup, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getSendUser, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getContent, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getUpUserGroup, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getUpUser, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getUpMessageType, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getAbnormalNode, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getStatus, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getCreatedUser, frontPage.getGlobalQuery())
.or().like(AbnormalMessage::getModifiedUser, frontPage.getGlobalQuery())
);
}
result = abnormalMessageService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param abnormalMessage
* @return null
*/
@PostMapping
public R save(@RequestBody AbnormalMessage abnormalMessage) {
return R.ok(abnormalMessageService.save(abnormalMessage));
}
/**
*
* @param abnormalMessage
* @return null
*/
@PutMapping
public R updateById(@RequestBody AbnormalMessage abnormalMessage) {
return R.ok(abnormalMessageService.updateById(abnormalMessage));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(abnormalMessageService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(abnormalMessageService.removeByIds(ids));
}
}

@ -1,18 +0,0 @@
package com.foreverwin.mesnac.anomaly.mapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalMessage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author
* @since 2021-07-22
*/
@Repository
public interface AbnormalMessageMapper extends BaseMapper<AbnormalMessage> {
}

@ -1,28 +0,0 @@
package com.foreverwin.mesnac.anomaly.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.AbnormalMessage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-07-22
*/
public interface AbnormalMessageService extends IService<AbnormalMessage> {
/**
*
* @param frontPage
* @return
*/
IPage<AbnormalMessage> selectPage(FrontPage<AbnormalMessage> frontPage, AbnormalMessage abnormalMessage);
List<AbnormalMessage> selectList(AbnormalMessage abnormalMessage);
}

@ -8,7 +8,6 @@ import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillDisposeMapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillMapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalMessageMapper;
import com.foreverwin.mesnac.anomaly.model.*;
import com.foreverwin.mesnac.anomaly.service.*;
import com.foreverwin.mesnac.anomaly.util.ActiveMQUtil;
@ -16,7 +15,10 @@ import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.dto.ScrapDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.helper.NextNumberHelper;
import com.foreverwin.mesnac.common.mapper.MessageMapper;
import com.foreverwin.mesnac.common.model.Message;
import com.foreverwin.mesnac.common.service.AnomalyService;
import com.foreverwin.mesnac.common.service.MessageService;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.dto.ShopOrderDto;
import com.foreverwin.mesnac.meapi.mapper.*;
@ -129,10 +131,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
private ActiveMQUtil activeMQUtil;
@Autowired
private AbnormalMessageMapper abnormalMessageMapper;
private MessageMapper messageMapper;
@Autowired
private AbnormalMessageService abnormalMessageService;
private MessageService messageService;
@Autowired
private SelfReportService selfReportService;
@ -828,14 +830,14 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
String user = CommonMethods.getUser();
String locale = LocaleContextHolder.getLocale().getLanguage();
LocalDateTime now = LocalDateTime.now();
AbnormalMessage abnormalMessage = new AbnormalMessage();
Message abnormalMessage = new Message();
//发送消息的主键
String handle = UUID.randomUUID().toString();
abnormalMessage.setHandle(handle);
//站点
abnormalMessage.setSite(site);
//异常单
abnormalMessage.setAbnormalBillBo(abnormalBill.getHandle());
abnormalMessage.setObjectBo(abnormalBill.getHandle());
//异常类型
abnormalMessage.setType(abnormalBill.getType());
//根据异常的类型找到消息的类型
@ -854,45 +856,45 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
switch (abnormalBill.getStatus()){
case Constants.NEW://新建
abnormalMessage.setSendUserGroup(abnormalBill.getReportSendUserGroup());
abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_REPORT);
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_REPORT);
break;
case Constants.RESPONSE://响应中,设置响应超时的用户的发送的用户组为提报时要升级的用户组
QueryWrapper<AbnormalMessage> wrapper = new QueryWrapper<>();
AbnormalMessage abnormalMessage1 = new AbnormalMessage();
QueryWrapper<Message> wrapper = new QueryWrapper<>();
Message abnormalMessage1 = new Message();
abnormalMessage1.setSite(site);
abnormalMessage1.setAbnormalBillBo(abnormalBill.getHandle());
abnormalMessage1.setAbnormalNode(Constants.ABNORMAL_MESSAGE_REPORT);
abnormalMessage1.setObjectBo(abnormalBill.getHandle());
abnormalMessage1.setNode(Constants.ABNORMAL_MESSAGE_REPORT);
wrapper.setEntity(abnormalMessage1);
AbnormalMessage _abnormalMessage = abnormalMessageMapper.selectOne(wrapper);
Message _abnormalMessage = messageMapper.selectOne(wrapper);
abnormalMessage.setUpUserGroup(_abnormalMessage.getUpUserGroup());
abnormalMessage.setUpMessageType(_abnormalMessage.getUpMessageType());
abnormalMessage.setGrade(_abnormalMessage.getGrade());
abnormalMessage.setUpDateTime(_abnormalMessage.getUpDateTime());
abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_RESPONSE);
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_RESPONSE);
break;
case Constants.CORRECTION_CONFIRM://纠纷确认
abnormalMessage.setSendUserGroup(abnormalBillDispose.getDutySendUserGroup());
abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_CORRECTION_CONFIRM);
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_CORRECTION_CONFIRM);
break;
case Constants.PROGRAM_CONFIRM://方案确认
abnormalMessage.setSendUser(abnormalBillDispose.getResolveSendUser());
abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_PROGRAM_CONFIRM);
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_PROGRAM_CONFIRM);
break;
case Constants.CANCEL://取消
abnormalMessage.setSendUserGroup(abnormalBill.getCancelSendUserGroup());
abnormalMessage.setAbnormalNode(Constants.ABNORMAL_MESSAGE_CANCEL);
abnormalMessage.setNode(Constants.ABNORMAL_MESSAGE_CANCEL);
//异常取消的时候要关闭当前异常单下所有的异常信息
UpdateWrapper<AbnormalMessage> messageTypeUpdateWrapper = new UpdateWrapper<>();
UpdateWrapper<Message> messageTypeUpdateWrapper = new UpdateWrapper<>();
// messageTypeUpdateWrapper.eq("SITE",site);
// messageTypeUpdateWrapper.eq("ABNORMAL_BILL_BO",abnormalMessage.getAbnormalBillBo());
AbnormalMessage abnormalMessage2 = new AbnormalMessage();
Message abnormalMessage2 = new Message();
// abnormalMessage2.setAbnormalBillBo(abnormalMessage.getAbnormalBillBo());
abnormalMessage2.setStatus("Y");
messageTypeUpdateWrapper.eq("STATUS","N");
messageTypeUpdateWrapper.eq("ABNORMAL_BILL_BO",abnormalMessage.getAbnormalBillBo());
abnormalMessageService.update(abnormalMessage2,messageTypeUpdateWrapper);
messageTypeUpdateWrapper.eq("OBJECT_BO",abnormalMessage.getObjectBo());
messageService.update(abnormalMessage2,messageTypeUpdateWrapper);
break;
case Constants.SHUT_DOWN:
break;
@ -916,7 +918,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
assert customFieldByGroup != null;
if(!StringUtil.isBlank(customFieldByGroup.getMessageNoticeLevel())){
abnormalMessage.setGrade(Integer.parseInt(customFieldByGroup.getMessageNoticeLevel()));
abnormalMessage.setGrade(Double.parseDouble(customFieldByGroup.getMessageNoticeLevel()));
}
//得到升级的消息类型
abnormalMessage.setUpMessageType(abnormalMessage.getMessageType());
@ -930,8 +932,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//设置状态新建是Y响应为N纠防确认是N方案确认是Y
if(Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getAbnormalNode()) ||
Constants.ABNORMAL_MESSAGE_CORRECTION_CONFIRM.equals(abnormalMessage.getAbnormalNode())){
if(Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getNode()) ||
Constants.ABNORMAL_MESSAGE_CORRECTION_CONFIRM.equals(abnormalMessage.getNode())){
abnormalMessage.setStatus("N");
}else{
abnormalMessage.setStatus("Y");
@ -945,10 +947,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//判断,如果是方案确认,则发送用户,否则,除了节点是响应之外,则发送用户组
if(Constants.ABNORMAL_MESSAGE_PROGRAM_CONFIRM.equals(abnormalMessage.getAbnormalNode())){
if(Constants.ABNORMAL_MESSAGE_PROGRAM_CONFIRM.equals(abnormalMessage.getNode())){
String sendUsers = abnormalMessage.getSendUser().replace(',', '|');
activeMQUtil.wechatSendMessage(sendUsers,abnormalMessage.getContent());
}else if(!Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getAbnormalNode())){
}else if(!Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getNode())){
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site,abnormalMessage.getSendUserGroup());
StringBuilder sendUsers = new StringBuilder();
for (int i = 0; i < nwaUsers.size(); i++) {
@ -960,7 +962,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
activeMQUtil.wechatSendMessage(sendUsers.toString(),abnormalMessage.getContent());
}
abnormalMessageService.saveOrUpdate(abnormalMessage);
messageService.saveOrUpdate(abnormalMessage);
return true;
}

@ -1,46 +0,0 @@
package com.foreverwin.mesnac.anomaly.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.AbnormalMessage;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalMessageMapper;
import com.foreverwin.mesnac.anomaly.service.AbnormalMessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-07-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class AbnormalMessageServiceImpl extends ServiceImpl<AbnormalMessageMapper, AbnormalMessage> implements AbnormalMessageService {
@Autowired
private AbnormalMessageMapper abnormalMessageMapper;
@Override
public IPage<AbnormalMessage> selectPage(FrontPage<AbnormalMessage> frontPage, AbnormalMessage abnormalMessage) {
QueryWrapper<AbnormalMessage> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalMessage);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<AbnormalMessage> selectList(AbnormalMessage abnormalMessage) {
QueryWrapper<AbnormalMessage> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(abnormalMessage);
return super.list(queryWrapper);
}
}

@ -2,13 +2,13 @@ package com.foreverwin.mesnac.anomaly.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillMapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalMessageMapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalMessage;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillService;
import com.foreverwin.mesnac.anomaly.service.AbnormalMessageService;
import com.foreverwin.mesnac.anomaly.service.AnomalyJobService;
import com.foreverwin.mesnac.anomaly.util.ActiveMQUtil;
import com.foreverwin.mesnac.common.mapper.MessageMapper;
import com.foreverwin.mesnac.common.model.Message;
import com.foreverwin.mesnac.common.service.MessageService;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.mapper.UserGroupMapper;
import com.foreverwin.mesnac.meapi.model.NwaUser;
@ -32,10 +32,10 @@ import java.util.UUID;
public class AnomalyJobServiceImpl implements AnomalyJobService {
@Autowired
private AbnormalMessageService abnormalMessageService;
private MessageService messageService;
@Autowired
private AbnormalMessageMapper abnormalMessageMapper;
private MessageMapper messageMapper;
@Autowired
private AbnormalBillMapper abnormalBillMapper;
@ -58,19 +58,19 @@ public class AnomalyJobServiceImpl implements AnomalyJobService {
LocalDateTime now = LocalDateTime.now();
String user = CommonMethods.getUser();
//找到状态为N并且升级时间大于当前时间
QueryWrapper<AbnormalMessage> abnormalMessageQueryWrapper = new QueryWrapper<>();
QueryWrapper<Message> abnormalMessageQueryWrapper = new QueryWrapper<>();
abnormalMessageQueryWrapper.eq("STATUS","N");
abnormalMessageQueryWrapper.lt("UP_DATE_TIME",now);
List<AbnormalMessage> abnormalMessages = abnormalMessageMapper.selectList(abnormalMessageQueryWrapper);
for(AbnormalMessage _abnormalMessage : abnormalMessages){
List<Message> abnormalMessages = messageMapper.selectList(abnormalMessageQueryWrapper);
for(Message _abnormalMessage : abnormalMessages){
String uuid = UUID.randomUUID().toString();
AbnormalMessage abnormalMessage = new AbnormalMessage();
Message abnormalMessage = new Message();
//设置abnormalMessage的handle
abnormalMessage.setHandle(uuid);
//设置abnormalMessage的site
abnormalMessage.setSite(site);
//设置abnormalMessage的异常单Bo
abnormalMessage.setAbnormalBillBo(_abnormalMessage.getAbnormalBillBo());
abnormalMessage.setObjectBo(_abnormalMessage.getObjectBo());
//设置abnormalMessage的type
abnormalMessage.setType(_abnormalMessage.getType());
//设置abnormalMessage的message_type
@ -89,7 +89,7 @@ public class AnomalyJobServiceImpl implements AnomalyJobService {
abnormalMessage.setUpUser(null);
}
AbnormalBill abnormalBill = abnormalBillMapper.selectById(abnormalMessage.getAbnormalBillBo());
AbnormalBill abnormalBill = abnormalBillMapper.selectById(abnormalMessage.getObjectBo());
String message = abnormalBillService.formatMessage(abnormalBill,abnormalMessage.getMessageType(),site);
@ -101,7 +101,7 @@ public class AnomalyJobServiceImpl implements AnomalyJobService {
abnormalMessage.setGrade(_abnormalMessage.getGrade() + 1);
abnormalMessage.setResponseDateTime(now);
abnormalMessage.setAbnormalNode(_abnormalMessage.getAbnormalNode());
abnormalMessage.setNode(_abnormalMessage.getNode());
abnormalMessage.setStatus("Y");
_abnormalMessage.setStatus("Y");
@ -128,8 +128,8 @@ public class AnomalyJobServiceImpl implements AnomalyJobService {
}
activeMQUtil.wechatSendMessage(sendUsers.toString(),abnormalMessage.getContent());
// }
abnormalMessageService.saveOrUpdate(abnormalMessage);
abnormalMessageService.saveOrUpdate(_abnormalMessage);
messageService.saveOrUpdate(abnormalMessage);
messageService.saveOrUpdate(_abnormalMessage);
}
}
}

@ -0,0 +1,132 @@
package com.foreverwin.mesnac.common.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.common.service.MessageService;
import com.foreverwin.mesnac.common.model.Message;
import java.util.List;
/**
*
* @author zjw
* @since 2021-08-02
*/
@RestController
@RequestMapping("/Z-MESSAGE")
public class MessageController {
@Autowired
public MessageService messageService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getMessageById(@PathVariable String id) {
return R.ok( messageService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getMessageList(Message message){
List<Message> result;
QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(message);
result = messageService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<Message> frontPage, Message message){
IPage result;
QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(message);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(Message::getHandle, frontPage.getGlobalQuery())
.or().like(Message::getSite, frontPage.getGlobalQuery())
.or().like(Message::getObjectBo, frontPage.getGlobalQuery())
.or().like(Message::getType, frontPage.getGlobalQuery())
.or().like(Message::getMessageType, frontPage.getGlobalQuery())
.or().like(Message::getSendUserGroup, frontPage.getGlobalQuery())
.or().like(Message::getSendUser, frontPage.getGlobalQuery())
.or().like(Message::getContent, frontPage.getGlobalQuery())
.or().like(Message::getUpUserGroup, frontPage.getGlobalQuery())
.or().like(Message::getUpUser, frontPage.getGlobalQuery())
.or().like(Message::getUpMessageType, frontPage.getGlobalQuery())
.or().like(Message::getNode, frontPage.getGlobalQuery())
.or().like(Message::getStatus, frontPage.getGlobalQuery())
.or().like(Message::getCreatedUser, frontPage.getGlobalQuery())
.or().like(Message::getModifiedUser, frontPage.getGlobalQuery())
);
}
result = messageService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param message
* @return null
*/
@PostMapping
public R save(@RequestBody Message message) {
return R.ok(messageService.save(message));
}
/**
*
* @param message
* @return null
*/
@PutMapping
public R updateById(@RequestBody Message message) {
return R.ok(messageService.updateById(message));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(messageService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(messageService.removeByIds(ids));
}
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.common.mapper;
import com.foreverwin.mesnac.common.model.Message;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author zjw
* @since 2021-08-02
*/
@Repository
public interface MessageMapper extends BaseMapper<Message> {
}

@ -1,4 +1,4 @@
package com.foreverwin.mesnac.anomaly.model;
package com.foreverwin.mesnac.common.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
@ -14,13 +14,13 @@ import java.time.LocalDateTime;
*
* </p>
*
* @author
* @since 2021-07-22
* @author zjw
* @since 2021-08-02
*/
@TableName("Z_ABNORMAL_MESSAGE")
@TableName("Z_MESSAGE")
public class AbnormalMessage extends Model<AbnormalMessage> {
public class Message extends Model<Message> {
private static final long serialVersionUID = 1L;
@ -37,8 +37,8 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
/**
*
*/
@TableField("ABNORMAL_BILL_BO")
private String abnormalBillBo;
@TableField("OBJECT_BO")
private String objectBo;
/**
*
*/
@ -88,7 +88,7 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
*
*/
@TableField("GRADE")
private Integer grade;
private Double grade;
/**
*
*/
@ -97,8 +97,8 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
/**
*
*/
@TableField("ABNORMAL_NODE")
private String abnormalNode;
@TableField("NODE")
private String node;
/**
*
*/
@ -142,12 +142,12 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
this.site = site;
}
public String getAbnormalBillBo() {
return abnormalBillBo;
public String getObjectBo() {
return objectBo;
}
public void setAbnormalBillBo(String abnormalBillBo) {
this.abnormalBillBo = abnormalBillBo;
public void setObjectBo(String objectBo) {
this.objectBo = objectBo;
}
public String getType() {
@ -222,11 +222,11 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
this.upDateTime = upDateTime;
}
public Integer getGrade() {
public Double getGrade() {
return grade;
}
public void setGrade(Integer grade) {
public void setGrade(Double grade) {
this.grade = grade;
}
@ -238,12 +238,12 @@ public class AbnormalMessage extends Model<AbnormalMessage> {
this.responseDateTime = responseDateTime;
}
public String getAbnormalNode() {
return abnormalNode;
public String getNode() {
return node;
}
public void setAbnormalNode(String abnormalNode) {
this.abnormalNode = abnormalNode;
public void setNode(String node) {
this.node = node;
}
public String getStatus() {
@ -290,7 +290,7 @@ public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String ABNORMAL_BILL_BO = "ABNORMAL_BILL_BO";
public static final String OBJECT_BO = "OBJECT_BO";
public static final String TYPE = "TYPE";
@ -314,7 +314,7 @@ public static final String GRADE = "GRADE";
public static final String RESPONSE_DATE_TIME = "RESPONSE_DATE_TIME";
public static final String ABNORMAL_NODE = "ABNORMAL_NODE";
public static final String NODE = "NODE";
public static final String STATUS = "STATUS";
@ -334,10 +334,10 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
public String toString() {
return "AbnormalMessage{" +
return "Message{" +
"handle = " + handle +
", site = " + site +
", abnormalBillBo = " + abnormalBillBo +
", objectBo = " + objectBo +
", type = " + type +
", messageType = " + messageType +
", sendUserGroup = " + sendUserGroup +
@ -349,7 +349,7 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
", upDateTime = " + upDateTime +
", grade = " + grade +
", responseDateTime = " + responseDateTime +
", abnormalNode = " + abnormalNode +
", node = " + node +
", status = " + status +
", createdUser = " + createdUser +
", createdDateTime = " + createdDateTime +

@ -0,0 +1,28 @@
package com.foreverwin.mesnac.common.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.model.Message;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author zjw
* @since 2021-08-02
*/
public interface MessageService extends IService<Message> {
/**
*
* @param frontPage
* @return
*/
IPage<Message> selectPage(FrontPage<Message> frontPage, Message message);
List<Message> selectList(Message message);
}

@ -0,0 +1,46 @@
package com.foreverwin.mesnac.common.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.model.Message;
import com.foreverwin.mesnac.common.mapper.MessageMapper;
import com.foreverwin.mesnac.common.service.MessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author zjw
* @since 2021-08-02
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements MessageService {
@Autowired
private MessageMapper messageMapper;
@Override
public IPage<Message> selectPage(FrontPage<Message> frontPage, Message message) {
QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(message);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<Message> selectList(Message message) {
QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(message);
return super.list(queryWrapper);
}
}

@ -1,12 +1,12 @@
<?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.foreverwin.mesnac.anomaly.mapper.AbnormalMessageMapper">
<mapper namespace="com.foreverwin.mesnac.common.mapper.MessageMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.anomaly.model.AbnormalMessage">
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.Message">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="ABNORMAL_BILL_BO" property="abnormalBillBo" />
<result column="OBJECT_BO" property="objectBo" />
<result column="TYPE" property="type" />
<result column="MESSAGE_TYPE" property="messageType" />
<result column="SEND_USER_GROUP" property="sendUserGroup" />
@ -18,7 +18,7 @@
<result column="UP_DATE_TIME" property="upDateTime" />
<result column="GRADE" property="grade" />
<result column="RESPONSE_DATE_TIME" property="responseDateTime" />
<result column="ABNORMAL_NODE" property="abnormalNode" />
<result column="NODE" property="node" />
<result column="STATUS" property="status" />
<result column="CREATED_USER" property="createdUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
@ -28,17 +28,17 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, ABNORMAL_BILL_BO, TYPE, MESSAGE_TYPE, SEND_USER_GROUP, SEND_USER, CONTENT, UP_USER_GROUP, UP_USER, UP_MESSAGE_TYPE, UP_DATE_TIME, GRADE, RESPONSE_DATE_TIME, ABNORMAL_NODE, STATUS, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
HANDLE, SITE, OBJECT_BO, TYPE, MESSAGE_TYPE, SEND_USER_GROUP, SEND_USER, CONTENT, UP_USER_GROUP, UP_USER, UP_MESSAGE_TYPE, UP_DATE_TIME, GRADE, RESPONSE_DATE_TIME, NODE, STATUS, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_ABNORMAL_MESSAGE WHERE HANDLE=#{handle}
SELECT <include refid="Base_Column_List"></include> FROM Z_MESSAGE WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_ABNORMAL_MESSAGE
FROM Z_MESSAGE
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
@ -52,19 +52,19 @@
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_ABNORMAL_MESSAGE WHERE HANDLE IN (
FROM Z_MESSAGE WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_ABNORMAL_MESSAGE
SELECT <include refid="Base_Column_List"></include> FROM Z_MESSAGE
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -76,7 +76,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -86,7 +86,7 @@
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_ABNORMAL_MESSAGE
SELECT COUNT(1) FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -94,7 +94,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -106,7 +106,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -124,7 +124,7 @@
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ABNORMAL_MESSAGE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -132,7 +132,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -144,7 +144,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -162,7 +162,7 @@
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ABNORMAL_MESSAGE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -170,7 +170,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -182,7 +182,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -200,7 +200,7 @@
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ABNORMAL_MESSAGE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -208,7 +208,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -220,7 +220,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -238,7 +238,7 @@
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ABNORMAL_MESSAGE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -246,7 +246,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -258,7 +258,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -276,7 +276,7 @@
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_ABNORMAL_MESSAGE
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -284,7 +284,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -296,7 +296,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -313,12 +313,12 @@
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.anomaly.model.AbnormalMessage">
INSERT INTO Z_ABNORMAL_MESSAGE
<insert id="insert" parameterType="com.foreverwin.mesnac.common.model.Message">
INSERT INTO Z_MESSAGE
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="abnormalBillBo!=null">ABNORMAL_BILL_BO,</if>
<if test="objectBo!=null">OBJECT_BO,</if>
<if test="type!=null">TYPE,</if>
<if test="messageType!=null">MESSAGE_TYPE,</if>
<if test="sendUserGroup!=null">SEND_USER_GROUP,</if>
@ -330,7 +330,7 @@
<if test="upDateTime!=null">UP_DATE_TIME,</if>
<if test="grade!=null">GRADE,</if>
<if test="responseDateTime!=null">RESPONSE_DATE_TIME,</if>
<if test="abnormalNode!=null">ABNORMAL_NODE,</if>
<if test="node!=null">NODE,</if>
<if test="status!=null">STATUS,</if>
<if test="createdUser!=null">CREATED_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
@ -340,7 +340,7 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="abnormalBillBo!=null">#{abnormalBillBo},</if>
<if test="objectBo!=null">#{objectBo},</if>
<if test="type!=null">#{type},</if>
<if test="messageType!=null">#{messageType},</if>
<if test="sendUserGroup!=null">#{sendUserGroup},</if>
@ -352,7 +352,7 @@
<if test="upDateTime!=null">#{upDateTime},</if>
<if test="grade!=null">#{grade},</if>
<if test="responseDateTime!=null">#{responseDateTime},</if>
<if test="abnormalNode!=null">#{abnormalNode},</if>
<if test="node!=null">#{node},</if>
<if test="status!=null">#{status},</if>
<if test="createdUser!=null">#{createdUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
@ -361,15 +361,15 @@
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.anomaly.model.AbnormalMessage">
INSERT INTO Z_ABNORMAL_MESSAGE
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.common.model.Message">
INSERT INTO Z_MESSAGE
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{abnormalBillBo},
#{objectBo},
#{type},
#{messageType},
#{sendUserGroup},
@ -381,7 +381,7 @@
#{upDateTime},
#{grade},
#{responseDateTime},
#{abnormalNode},
#{node},
#{status},
#{createdUser},
#{createdDateTime},
@ -392,9 +392,9 @@
<update id="updateById">
UPDATE Z_ABNORMAL_MESSAGE <trim prefix="SET" suffixOverrides=",">
UPDATE Z_MESSAGE <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.abnormalBillBo!=null">ABNORMAL_BILL_BO=#{et.abnormalBillBo},</if>
<if test="et.objectBo!=null">OBJECT_BO=#{et.objectBo},</if>
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.messageType!=null">MESSAGE_TYPE=#{et.messageType},</if>
<if test="et.sendUserGroup!=null">SEND_USER_GROUP=#{et.sendUserGroup},</if>
@ -406,7 +406,7 @@
<if test="et.upDateTime!=null">UP_DATE_TIME=#{et.upDateTime},</if>
<if test="et.grade!=null">GRADE=#{et.grade},</if>
<if test="et.responseDateTime!=null">RESPONSE_DATE_TIME=#{et.responseDateTime},</if>
<if test="et.abnormalNode!=null">ABNORMAL_NODE=#{et.abnormalNode},</if>
<if test="et.node!=null">NODE=#{et.node},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
@ -417,9 +417,9 @@
<update id="updateAllColumnById">
UPDATE Z_ABNORMAL_MESSAGE <trim prefix="SET" suffixOverrides=",">
UPDATE Z_MESSAGE <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
ABNORMAL_BILL_BO=#{et.abnormalBillBo},
OBJECT_BO=#{et.objectBo},
TYPE=#{et.type},
MESSAGE_TYPE=#{et.messageType},
SEND_USER_GROUP=#{et.sendUserGroup},
@ -431,7 +431,7 @@
UP_DATE_TIME=#{et.upDateTime},
GRADE=#{et.grade},
RESPONSE_DATE_TIME=#{et.responseDateTime},
ABNORMAL_NODE=#{et.abnormalNode},
NODE=#{et.node},
STATUS=#{et.status},
CREATED_USER=#{et.createdUser},
CREATED_DATE_TIME=#{et.createdDateTime},
@ -442,9 +442,9 @@
<update id="update">
UPDATE Z_ABNORMAL_MESSAGE <trim prefix="SET" suffixOverrides=",">
UPDATE Z_MESSAGE <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.abnormalBillBo!=null">ABNORMAL_BILL_BO=#{et.abnormalBillBo},</if>
<if test="et.objectBo!=null">OBJECT_BO=#{et.objectBo},</if>
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.messageType!=null">MESSAGE_TYPE=#{et.messageType},</if>
<if test="et.sendUserGroup!=null">SEND_USER_GROUP=#{et.sendUserGroup},</if>
@ -456,7 +456,7 @@
<if test="et.upDateTime!=null">UP_DATE_TIME=#{et.upDateTime},</if>
<if test="et.grade!=null">GRADE=#{et.grade},</if>
<if test="et.responseDateTime!=null">RESPONSE_DATE_TIME=#{et.responseDateTime},</if>
<if test="et.abnormalNode!=null">ABNORMAL_NODE=#{et.abnormalNode},</if>
<if test="et.node!=null">NODE=#{et.node},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
@ -468,7 +468,7 @@
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -480,7 +480,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -498,11 +498,11 @@
</update>
<delete id="deleteById">
DELETE FROM Z_ABNORMAL_MESSAGE WHERE HANDLE=#{handle}
DELETE FROM Z_MESSAGE WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_ABNORMAL_MESSAGE
DELETE FROM Z_MESSAGE
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
@ -515,7 +515,7 @@
</delete>
<delete id="delete">
DELETE FROM Z_ABNORMAL_MESSAGE
DELETE FROM Z_MESSAGE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -523,7 +523,7 @@
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.abnormalBillBo!=null"> AND ABNORMAL_BILL_BO=#{ew.entity.abnormalBillBo}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.messageType!=null"> AND MESSAGE_TYPE=#{ew.entity.messageType}</if>
<if test="ew.entity.sendUserGroup!=null"> AND SEND_USER_GROUP=#{ew.entity.sendUserGroup}</if>
@ -535,7 +535,7 @@
<if test="ew.entity.upDateTime!=null"> AND UP_DATE_TIME=#{ew.entity.upDateTime}</if>
<if test="ew.entity.grade!=null"> AND GRADE=#{ew.entity.grade}</if>
<if test="ew.entity.responseDateTime!=null"> AND RESPONSE_DATE_TIME=#{ew.entity.responseDateTime}</if>
<if test="ew.entity.abnormalNode!=null"> AND ABNORMAL_NODE=#{ew.entity.abnormalNode}</if>
<if test="ew.entity.node!=null"> AND NODE=#{ew.entity.node}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
@ -553,7 +553,7 @@
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_ABNORMAL_MESSAGE WHERE HANDLE IN (
DELETE FROM Z_MESSAGE WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
Loading…
Cancel
Save