从redis取数
This commit is contained in:
@ -25,10 +25,11 @@
|
||||
<result property="communicationStatus" column="communication_status" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deviceCategory" column="device_category" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsDevicesSettingVo">
|
||||
select id, device_name, device_type, slave_id, timeout_ms, retries, ip_address, ip_port, serial_port, baud_rate, data_bits, stop_bits, parity, description, created_at, updated_at, site_id, communication_status, device_id, parent_id from ems_devices_setting
|
||||
select id, device_name, device_type, slave_id, timeout_ms, retries, ip_address, ip_port, serial_port, baud_rate, data_bits, stop_bits, parity, description, created_at, updated_at, site_id, communication_status, device_id, parent_id, device_category from ems_devices_setting
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsDevicesSettingList" parameterType="EmsDevicesSetting" resultMap="EmsDevicesSettingResult">
|
||||
@ -53,6 +54,7 @@
|
||||
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
||||
<if test="deviceCategory != null and deviceCategory != ''"> and device_category = #{deviceCategory}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -83,6 +85,7 @@
|
||||
<if test="communicationStatus != null">communication_status,</if>
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="deviceCategory != null">device_category,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
@ -104,6 +107,7 @@
|
||||
<if test="communicationStatus != null">#{communicationStatus},</if>
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="deviceCategory != null">#{deviceCategory},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -129,6 +133,7 @@
|
||||
<if test="communicationStatus != null">communication_status = #{communicationStatus},</if>
|
||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="deviceCategory != null">device_category = #{deviceCategory},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -150,8 +155,8 @@
|
||||
select distinct eb.device_id from ems_battery_stack eb where eb.site_id = #{siteId})
|
||||
</select>
|
||||
|
||||
<select id="getAllClusterInfoByStackId" parameterType="String" resultType="java.util.Map">
|
||||
select distinct t.device_id as id,t.device_name as deviceName from ems_devices_setting t where t.parent_id = #{stackDeviceId}
|
||||
<select id="getDeviceInfoByParentId" parameterType="String" resultType="java.util.Map">
|
||||
select distinct t.device_id as id,t.device_name as deviceName from ems_devices_setting t where t.parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
<select id="getAllBatteryDeviceBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.EmsDevicesSetting">
|
||||
@ -161,4 +166,17 @@
|
||||
from ems_devices_setting t INNER JOIN ems_ammeter_data e on t.site_id = e.site_id and t.device_id = e.device_id
|
||||
where t.site_id = #{siteId}
|
||||
</select>
|
||||
|
||||
<select id="getAllClusterInfoBySiteId" parameterType="String" resultType="java.util.Map">
|
||||
select device_id as id,device_name as deviceName from ems_devices_setting
|
||||
where device_id in (
|
||||
select distinct eb.device_id from ems_battery_cluster eb where eb.site_id = #{siteId})
|
||||
</select>
|
||||
|
||||
<select id="getDeviceInfosBySiteIdAndCategory" resultType="java.util.Map">
|
||||
select DISTINCT device_id as id,
|
||||
device_name as deviceName,
|
||||
communication_status as communicationStatus
|
||||
from ems_devices_setting where site_id = #{siteId} and device_category = #{deviceCategory}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user