riku
2025-08-28 3bb4fb15c664d29d179083698fdad35a661b1d7f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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 &lt;= #{endTime}
      </if>
    </where>
    order by a.start_time desc
  </select>
</mapper>