New file |
| | |
| | | package com.ycl.controller.message; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ycl.base.BaseController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 消息表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author lyq |
| | | * @since 2022-11-11 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/message") |
| | | public class MessageController extends BaseController { |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.entity.message; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.Version; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 消息表 |
| | | * </p> |
| | | * |
| | | * @author lyq |
| | | * @since 2022-11-11 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("ums_message") |
| | | public class Message implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键Id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 原始消息为0 |
| | | */ |
| | | @TableField("parent_id") |
| | | private Integer parentId; |
| | | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField("head") |
| | | private String head; |
| | | |
| | | /** |
| | | * 渠道码01-内站信03-邮件02-短信 |
| | | */ |
| | | @TableField("channel_code") |
| | | private String channelCode; |
| | | |
| | | /** |
| | | * 消息类型 |
| | | */ |
| | | @TableField("message_type") |
| | | private Integer messageType; |
| | | |
| | | /** |
| | | * 消息体 |
| | | */ |
| | | @TableField("body") |
| | | private String body; |
| | | |
| | | /** |
| | | * 发送者 |
| | | */ |
| | | @TableField("target_from") |
| | | private String targetFrom; |
| | | |
| | | /** |
| | | * 接收者 |
| | | */ |
| | | @TableField("target_to") |
| | | private String targetTo; |
| | | |
| | | /** |
| | | * 消息编号 |
| | | */ |
| | | @TableField("message_number") |
| | | private String messageNumber; |
| | | |
| | | /** |
| | | * 随机码 |
| | | */ |
| | | @TableField("random_code") |
| | | private String randomCode; |
| | | |
| | | /** |
| | | * 过期时间 |
| | | */ |
| | | @TableField("over_time") |
| | | private LocalDateTime overTime; |
| | | |
| | | /** |
| | | * 发送时间 |
| | | */ |
| | | @TableField("send_time") |
| | | private LocalDateTime sendTime; |
| | | |
| | | /** |
| | | * 是否扫描0-未扫描1-已扫描 |
| | | */ |
| | | @TableField("is_scan") |
| | | private Integer isScan; |
| | | |
| | | /** |
| | | * 状态0-未发布1-已发布2-成功3-失败 |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 是否查看0-未查看1-已查看 |
| | | */ |
| | | @TableField("is_view") |
| | | private Integer isView; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 数据版本 |
| | | */ |
| | | @TableField("version") |
| | | @Version |
| | | private Integer version; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @TableField("create_user") |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | @TableField("update_user") |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * 响应结果 |
| | | */ |
| | | @TableField("respond_result") |
| | | private String respondResult; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.mapper.message; |
| | | |
| | | import com.ycl.entity.message.Message; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 消息表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author lyq |
| | | * @since 2022-11-11 |
| | | */ |
| | | public interface MessageMapper extends BaseMapper<Message> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.service.message; |
| | | |
| | | import com.ycl.entity.message.Message; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 消息表 服务类 |
| | | * </p> |
| | | * |
| | | * @author lyq |
| | | * @since 2022-11-11 |
| | | */ |
| | | public interface IMessageService extends IService<Message> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.service.message.impl; |
| | | |
| | | import com.ycl.entity.message.Message; |
| | | import com.ycl.mapper.message.MessageMapper; |
| | | import com.ycl.service.message.IMessageService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 消息表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author lyq |
| | | * @since 2022-11-11 |
| | | */ |
| | | @Service |
| | | public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements IMessageService { |
| | | |
| | | } |
| | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ycl.entity.message.MessageColumnSet"> |
| | | <id column="id" property="id" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="message_column_id" property="messageColumnId" /> |
| | | <result column="is_receive" property="isReceive" /> |
| | | <id column="id" property="id"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="message_column_id" property="messageColumnId"/> |
| | | <result column="is_receive" property="isReceive"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, user_id, message_column_id, is_receive |
| | | id |
| | | , user_id, message_column_id, is_receive |
| | | </sql> |
| | | <select id="selectMessagePage" parameterType="com.ycl.dto.message.MessageParam" |
| | | resultType="com.ycl.vo.message.MessageVO"> |
| | | SELECT |
| | | t1.id, |
| | | t2.username as targetFrom, |
| | | t3.column_name as messageTypeName, |
| | | t1.`status`, |
| | | t1.body, |
| | | t1.send_time, |
| | | t1.create_time, |
| | | t1.respond_result, |
| | | t1.head, |
| | | t4.username as createUser |
| | | FROM |
| | | `ums_message` t1 |
| | | LEFT JOIN ums_admin t2 ON t1.target_from = t2.id |
| | | left join ums_admin t4 on t1.create_user = t4.id |
| | | LEFT JOIN ums_message_column t3 ON t3.id = t1.message_type |
| | | <where> |
| | | <if test="messageParam.head !=null and messageParam.head !=''"> |
| | | t1.head like concat('%',#{messageParam.head},'%') |
| | | </if> |
| | | <if test="messageParam.channelCode !='' and messageParam.channelCode != null"> |
| | | and t1.channel_code=#{messageParam.channelCode} |
| | | </if> |
| | | <if test="messageParam.messageType != null"> |
| | | and t1.message_type=#{messageParam.messageType} |
| | | </if> |
| | | <if test="messageParam.startTime != null and messageParam.startTime != '' and messageParam.endTime != null and messageParam.endTime != '' "> |
| | | and t1.create_time between #{messageParam.startTime} and #{messageParam.endTime} |
| | | </if> |
| | | |
| | | <if test="messageParam.status != null"> |
| | | and t1.status=#{messageParam.status} |
| | | </if> |
| | | <if test="messageParam.respondResult !=null and messageParam.respondResult !='' "> |
| | | and t1.respond_result={messageParam.respondResult} |
| | | </if> |
| | | <if test="messageParam.sort==1"> |
| | | ORDER BY t1.create_time desc |
| | | </if> |
| | | <if test="messageParam.sort==0"> |
| | | ORDER BY t1.create_time asc |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?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.ycl.mapper.message.MessageMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ycl.entity.message.Message"> |
| | | <id column="id" property="id" /> |
| | | <result column="parent_id" property="parentId" /> |
| | | <result column="head" property="head" /> |
| | | <result column="channel_code" property="channelCode" /> |
| | | <result column="message_type" property="messageType" /> |
| | | <result column="body" property="body" /> |
| | | <result column="target_from" property="targetFrom" /> |
| | | <result column="target_to" property="targetTo" /> |
| | | <result column="message_number" property="messageNumber" /> |
| | | <result column="random_code" property="randomCode" /> |
| | | <result column="over_time" property="overTime" /> |
| | | <result column="send_time" property="sendTime" /> |
| | | <result column="is_scan" property="isScan" /> |
| | | <result column="status" property="status" /> |
| | | <result column="is_view" property="isView" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="version" property="version" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="respond_result" property="respondResult" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, parent_id, head, channel_code, message_type, body, target_from, target_to, message_number, random_code, over_time, send_time, is_scan, status, is_view, remark, version, create_user, create_time, update_user, update_time, respond_result |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | import com.ycl.controller.BaseController; |
| | | import com.ycl.entity.dict.DataDictionary; |
| | | import com.ycl.entity.equipment.EquipmentBayonet; |
| | | import com.ycl.entity.region.SccgRegion; |
| | | import com.ycl.service.dict.IDataDictionaryService; |
| | | import com.ycl.service.equipment.IEquipmentBayonetService; |
| | | import com.ycl.service.region.ISccgRegionService; |
| | | import com.ycl.utils.EasyExcelUtils; |
| | | import com.ycl.vo.equipment.EquipmentBayonetVO; |
| | | import io.swagger.annotations.Api; |
| | |
| | | IEquipmentBayonetService iEquipmentBayonetService; |
| | | @Autowired |
| | | IDataDictionaryService iDataDictionaryService; |
| | | @Autowired |
| | | ISccgRegionService iSccgRegionService; |
| | | |
| | | @GetMapping("/query") |
| | | @ApiOperation("查询") |
| | |
| | | BeanUtils.copyProperties(item, equipmentBayonetVO); |
| | | equipmentBayonetVO.setFrontEndType(iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getId, item.getFrontEndType())).getName()); |
| | | equipmentBayonetVO.setInOutCityType(iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getId, item.getInOutCityType())).getName()); |
| | | equipmentBayonetVO.setBelongArea(iSccgRegionService.getOne(new LambdaQueryWrapper<SccgRegion>().eq(SccgRegion::getId,item.getBelongArea())).getRegionName()); |
| | | return equipmentBayonetVO; |
| | | }).collect(Collectors.toList())); |
| | | } |
| | |
| | | /** |
| | | * 所属区域 |
| | | */ |
| | | @TableField("belongArea") |
| | | private String belong_area; |
| | | @TableField("belong_area") |
| | | private Integer belongArea; |
| | | } |
| | |
| | | @ApiModelProperty(value = "出入城类型") |
| | | @ExcelProperty(index = 6, value = "出入城类型") |
| | | private String inOutCityType; |
| | | |
| | | private String belongArea; |
| | | } |