|
@@ -80,13 +80,13 @@
|
|
|
on d.device_code = had.deviceName
|
|
|
<where>
|
|
|
<if test="userId != null and userId != 0">
|
|
|
- us.user_id = #{userId}
|
|
|
+ and us.user_id = #{userId}
|
|
|
</if>
|
|
|
<if test="siteId != null and siteId != 0">
|
|
|
- us.site_id = #{siteId}
|
|
|
+ and us.site_id = #{siteId}
|
|
|
</if>
|
|
|
<if test="endTime != null">
|
|
|
- had.dataTime <= #{endTime}
|
|
|
+ and had.dataTime <= #{endTime}
|
|
|
</if>
|
|
|
</where>
|
|
|
order dataTime desc limit 0,1
|
|
@@ -102,13 +102,13 @@
|
|
|
on d.device_code = had.deviceName
|
|
|
<where>
|
|
|
<if test="userId != null and userId != 0">
|
|
|
- us.user_id = #{userId}
|
|
|
+ and us.user_id = #{userId}
|
|
|
</if>
|
|
|
<if test="siteId != null and siteId != 0">
|
|
|
- us.site_id = #{siteId}
|
|
|
+ and us.site_id = #{siteId}
|
|
|
</if>
|
|
|
<if test="startTime != null">
|
|
|
- had.dataTime >= #{startTime}
|
|
|
+ and had.dataTime >= #{startTime}
|
|
|
</if>
|
|
|
</where>
|
|
|
order dataTime asc limit 0,1
|