Commit 2196ccc2 authored by 耿迪迪's avatar 耿迪迪

上图设备id查询mapper修改 gengdidi

parent a6f511f0
......@@ -42,8 +42,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectTMapDeviceInfoById" parameterType="Long" resultMap="TMapDeviceInfoResult">
<include refid="selectTMapDeviceInfoVo"/>
where map_device_id = #{mapDeviceId}
SELECT
device.map_device_id,
device.map_device_name,
device.map_device_type,
device.map_device_num,
device.map_device_medium,
device.map_device_unit,
device.longitude,
device.latitude,
mon.monitor_device_status,
mon.monitor_value
FROM
t_map_device_info device
LEFT JOIN (
SELECT
max(monitor.monitor_id),
monitor.monitor_value,
monitor.monitor_device_status,
monitor.monitor_device_num
FROM
t_map_device_monitor monitor
GROUP BY
monitor.monitor_device_num
)mon ON device.map_device_num = mon.monitor_device_num
where device.map_device_id = #{mapDeviceId}
</select>
<insert id="insertTMapDeviceInfo" parameterType="TMapDeviceInfo" useGeneratedKeys="true" keyProperty="mapDeviceId">
......@@ -135,7 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_map_device_monitor monitor
GROUP BY
monitor.monitor_device_num
)mon ON device.map_device_num = mon.monitor_device_num;
)mon ON device.map_device_num = mon.monitor_device_num
<where>
<if test="mapDeviceName != null and mapDeviceName != ''"> and device.map_device_name like concat('%', #{mapDeviceName}, '%')</if>
<if test="mapDeviceType != null and mapDeviceType != ''"> and device.map_device_type = #{mapDeviceType}</if>
......
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