From dac47617b37ccfb834cd73ce0ee725e1101de214 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 14 八月 2025 17:25:51 +0800 Subject: [PATCH] 2025.8.14 1. 动态溯源模块添加滑动平均异常计算(调试中) --- src/main/resources/mapper/SourceTraceMsgBlobMapper.xml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/src/main/resources/mapper/SourceTraceMsgBlobMapper.xml b/src/main/resources/mapper/SourceTraceMsgBlobMapper.xml new file mode 100644 index 0000000..c350230 --- /dev/null +++ b/src/main/resources/mapper/SourceTraceMsgBlobMapper.xml @@ -0,0 +1,56 @@ +<?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.flightfeather.uav.domain.mapper.SourceTraceMsgBlobMapper"> + <resultMap id="BaseResultMap" type="com.flightfeather.uav.domain.entity.SourceTraceMsgBlob"> + <!-- + WARNING - @mbg.generated + --> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="msg_id" jdbcType="INTEGER" property="msgId" /> + </resultMap> + <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.flightfeather.uav.domain.entity.SourceTraceMsgBlob"> + <!-- + WARNING - @mbg.generated + --> + <result column="content" jdbcType="LONGVARCHAR" property="content" /> + </resultMap> + <sql id="Base_Column_List"> + <!-- + WARNING - @mbg.generated + --> + id, msg_id + </sql> + <sql id="Blob_Column_List"> + <!-- + WARNING - @mbg.generated + --> + content + </sql> + + <resultMap extends="com.flightfeather.uav.domain.mapper.SourceTraceMsgMapper.BaseResultMap" + id="SourceTraceMsgVoMap" + type="com.flightfeather.uav.lightshare.bean.SourceTraceMsgVo"> + </resultMap> + + <select id="selectWithBlob" resultMap="SourceTraceMsgVoMap"> + select + a.*, + b.id as blobId, + b.msg_id as blobMsgId, + b.content as blobContent + from source_trace_msg as a left join source_trace_msg_blob as b + on a.id = b.msg_id + <where> + <if test="deviceCode != null"> + and a.device_code = #{deviceCode} + </if> + <if test="startTime != null"> + and a.start_time >= #{startTime} + </if> + <if test="endTime != null"> + and a.end_time <= #{endTime} + </if> + </where> + order by a.start_time desc + </select> +</mapper> \ No newline at end of file -- Gitblit v1.9.3