Commit 0187f1cf authored by 王晓倩's avatar 王晓倩

实时数据mapper修改

parent e3551d44
...@@ -38,25 +38,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -38,25 +38,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="deviceCode != null "> and d.device_code like concat('%',#{deviceCode},'%')</if> <if test="deviceCode != null "> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null "> and d.device_type = #{deviceType}</if> <if test="deviceType != null "> and d.device_type = #{deviceType}</if>
<if test="startReportTime != null "> and report_time &gt;= #{startReportTime}</if> <if test="startReportTime != null "> and t.report_time &gt;= #{startReportTime}</if>
<if test="endReportTime != null "> and report_time &lt;= #{endReportTime}</if> <if test="endReportTime != null "> and t.report_time &lt;= #{endReportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if> <if test="communicationStatus != null and communicationStatus != ''"> and t.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if> <if test="deviceStatus != null and deviceStatus != ''"> and t.device_status = #{deviceStatus}</if>
</where> </where>
</select> </select>
<select id="selectRealtimeDataList" parameterType="DeviceReportDataForm" resultMap="TDeviceReportDataResult"> <select id="selectRealtimeDataList" parameterType="DeviceReportDataForm" resultMap="TDeviceReportDataResult">
select max(t.report_time), t.device_report_data_id, t.device_num, t.standard_condition_accumulation, t.working_condition_accumulation, t.residual_quantity, t.standard_condition_flow, t.working_condition_flow, t.temperature, t.pressure, t.communication_status, t.device_status, t.create_time, t.update_time, select max(t.report_time) report_time, t.device_report_data_id, t.device_num, t.standard_condition_accumulation, t.working_condition_accumulation, t.residual_quantity, t.standard_condition_flow, t.working_condition_flow, t.temperature, t.pressure, t.communication_status, t.device_status, t.create_time, t.update_time,
d.device_name, d.device_code, d.device_type, d.device_model d.device_name, d.device_code, d.device_type, d.device_model
from t_device_report_data t from t_device_report_data t
left join t_device_info d on t.device_num = d.iot_no left join t_device_info d on t.device_num = d.iot_no
<where> <where>
<if test="deviceCode != null "> and d.device_code like concat('%',#{deviceCode},'%')</if> <if test="deviceCode != null "> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null "> and d.device_type = #{deviceType}</if> <if test="deviceType != null "> and d.device_type = #{deviceType}</if>
<if test="startReportTime != null "> and report_time &gt;= #{startReportTime}</if> <if test="startReportTime != null "> and t.report_time &gt;= #{startReportTime}</if>
<if test="endReportTime != null "> and report_time &lt;= #{endReportTime}</if> <if test="endReportTime != null "> and t.report_time &lt;= #{endReportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if> <if test="communicationStatus != null and communicationStatus != ''"> and t.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if> <if test="deviceStatus != null and deviceStatus != ''"> and t.device_status = #{deviceStatus}</if>
</where> </where>
group by t.device_num group by t.device_num
</select> </select>
...@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.device_name, d.device_code, d.device_type, d.device_model d.device_name, d.device_code, d.device_type, d.device_model
from t_device_report_data t from t_device_report_data t
left join t_device_info d on t.device_num = d.iot_no left join t_device_info d on t.device_num = d.iot_no
where device_report_data_id = #{deviceReportDataId} where t.device_report_data_id = #{deviceReportDataId}
</select> </select>
<insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId"> <insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment