You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

54 lines
2.4 KiB

<?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.iteaj.iboot.msn.iot.mapper.CollectDataMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.iteaj.iboot.msn.iot.entity.CollectData">
<result column="id" property="id" />
<result column="cid" property="cid" />
<result column="uid" property="uid" />
<result column="value" property="value" />
<result column="status" property="status" />
<result column="reason" property="reason" />
<result column="address" property="address" />
<result column="field_type" property="fieldType" />
<result column="create_time" property="createTime" />
<result column="collect_time" property="collectTime" />
<result column="collect_task_id" property="collectTaskId" />
</resultMap>
<resultMap id="DtoResultMap" type="com.iteaj.iboot.msn.iot.dto.CollectDataDto" extends="BaseResultMap">
<result property="deviceSn" column="device_sn" />
<result property="deviceName" column="device_name" />
</resultMap>
<select id="detailOfPage" resultMap="DtoResultMap">
select a.id, a.cid, a.uid, a.signal_id, a.field_type, a.collect_task_id, a.address, a.value
, a.status, a.reason, a.collect_time, a.create_time, d.name device_name, d.device_sn
from iot_collect_data a left join iot_device d on a.uid=d.uid
<where>
<if test="entity.uid != null">
and a.uid=#{entity.uid}
</if>
<if test="entity.cid != null">
and a.cid=#{entity.cid}
</if>
<if test="entity.deviceTypeId != null">
and d.device_type_id=#{entity.deviceTypeId}
</if>
<if test="entity.modelId != null">
and d.model=#{entity.modelId}
</if>
<if test="entity.signalId != null">
and a.signal_id=#{entity.signalId}
</if>
<if test="entity.collectTaskId != null">
and a.collect_task_id=#{entity.collectTaskId}
</if>
<if test="entity.status != null">
and a.status=#{entity.status}
</if>
</where>
order by a.collect_time desc
</select>
</mapper>