|  |  |  | 
|---|
|  |  |  | <result column="operate_ids" property="operateIds"/> | 
|---|
|  |  |  | <result column="monitor_point_id" property="monitorPointId"/> | 
|---|
|  |  |  | <result column="organization_id" property="organizationId"/> | 
|---|
|  |  |  | <result column="guid" property="guid"/> | 
|---|
|  |  |  | <result column="device_version_id" property="deviceVersionId"/> | 
|---|
|  |  |  | <result column="profession" property="profession"/> | 
|---|
|  |  |  | <result column="tech" property="tech"/> | 
|---|
|  |  |  | 
|---|
|  |  |  | <result column="install_time" property="installTime"/> | 
|---|
|  |  |  | <result column="is_delete" property="isDelete"/> | 
|---|
|  |  |  | <result column="extend" property="extend"/> | 
|---|
|  |  |  | <result column="town_code" property="townCode"/> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--监测因子趋势图数据--> | 
|---|
|  |  |  | <select id="getTrendChartData" resultType="java.util.Map"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | SELECT mac, | 
|---|
|  |  |  | DATE_FORMAT(`time`,#{dateFormat}) AS `time`, | 
|---|
|  |  |  | `value`->'$.${sensorCode}' AS '${sensorCode}' | 
|---|
|  |  |  | FROM history_${timeUnits} | 
|---|
|  |  |  | WHERE mac = #{mac} | 
|---|
|  |  |  | WHERE mac IN | 
|---|
|  |  |  | <foreach collection="macs" item="mac" index="index" open="(" close=")" separator=","> | 
|---|
|  |  |  | #{mac} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | AND `time` <![CDATA[>=]]> #{start} | 
|---|
|  |  |  | AND `time` <![CDATA[<]]> #{end} | 
|---|
|  |  |  | ORDER BY `time` | 
|---|