数据20250904优化-点位列表分页&点位查询
This commit is contained in:
@ -348,7 +348,7 @@
|
||||
SELECT p.device_id, MAX(p.data_update_time) AS max_update_time
|
||||
FROM ems_pcs_data p
|
||||
where p.site_id = #{siteId}
|
||||
and p.data_update_time >= CURDATE()
|
||||
and p.data_update_time <= CURDATE()
|
||||
GROUP BY p.device_id
|
||||
) latest inner join ems_pcs_data t ON latest.device_id = t.device_id
|
||||
AND latest.max_update_time = t.data_update_time
|
||||
|
||||
@ -11,6 +11,9 @@
|
||||
<result property="matchField" column="match_field" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="deviceCategory" column="device_category" />
|
||||
<result property="dataPoint" column="data_point" />
|
||||
<result property="dataPointName" column="data_point_name" />
|
||||
<result property="dataDevice" column="data_device" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
@ -19,7 +22,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsPointMatchVo">
|
||||
select id, point_name, match_table, match_field, site_id, device_category, create_by, create_time, update_by, update_time, remark from ems_point_match
|
||||
select id, point_name, match_table, match_field, site_id, device_category, data_point, data_point_name, data_device, create_by, create_time, update_by, update_time, remark from ems_point_match
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsPointMatchList" parameterType="EmsPointMatch" resultMap="EmsPointMatchResult">
|
||||
@ -30,6 +33,9 @@
|
||||
<if test="matchField != null and matchField != ''"> and match_field = #{matchField}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="deviceCategory != null and deviceCategory != ''"> and device_category = #{deviceCategory}</if>
|
||||
<if test="dataPoint != null and dataPoint != ''"> and data_point = #{dataPoint}</if>
|
||||
<if test="dataPointName != null and dataPointName != ''"> and data_point_name like concat('%', #{dataPointName}, '%')</if>
|
||||
<if test="dataDevice != null and dataDevice != ''"> and data_device = #{dataDevice}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -46,6 +52,9 @@
|
||||
<if test="matchField != null">match_field,</if>
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="deviceCategory != null">device_category,</if>
|
||||
<if test="dataPoint != null">data_point,</if>
|
||||
<if test="dataPointName != null">data_point_name,</if>
|
||||
<if test="dataDevice != null">data_device,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
@ -58,6 +67,9 @@
|
||||
<if test="matchField != null">#{matchField},</if>
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="deviceCategory != null">#{deviceCategory},</if>
|
||||
<if test="dataPoint != null">#{dataPoint},</if>
|
||||
<if test="dataPointName != null">#{dataPointName},</if>
|
||||
<if test="dataDevice != null">#{dataDevice},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
@ -74,6 +86,9 @@
|
||||
<if test="matchField != null">match_field = #{matchField},</if>
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="deviceCategory != null">device_category = #{deviceCategory},</if>
|
||||
<if test="dataPoint != null">data_point = #{dataPoint},</if>
|
||||
<if test="dataPointName != null">data_point_name = #{dataPointName},</if>
|
||||
<if test="dataDevice != null">data_device = #{dataDevice},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
@ -302,4 +317,15 @@
|
||||
WHERE t.${tableField} is not null
|
||||
ORDER BY t.site_id, t.device_id, valueDate ASC
|
||||
</select>
|
||||
|
||||
<select id="getSingleSiteDevicePoints" resultMap="EmsPointMatchResult">
|
||||
<include refid="selectEmsPointMatchVo"/>
|
||||
where 1=1
|
||||
<if test="siteId != null and siteId != ''">
|
||||
and site_id = #{siteId}
|
||||
</if>
|
||||
<if test="deviceCategory != null and deviceCategory != ''">
|
||||
and device_category = #{deviceCategory}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user