<?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>
|