修改site_id & device_id
This commit is contained in:
@ -23,10 +23,11 @@
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="communicationStatus" column="communication_status" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
</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 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 from ems_devices_setting
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsDevicesSettingList" parameterType="EmsDevicesSetting" resultMap="EmsDevicesSettingResult">
|
||||
@ -47,8 +48,9 @@
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
||||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -77,6 +79,7 @@
|
||||
<if test="updatedAt != null">updated_at,</if>
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="communicationStatus != null">communication_status,</if>
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
@ -96,6 +99,7 @@
|
||||
<if test="updatedAt != null">#{updatedAt},</if>
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="communicationStatus != null">#{communicationStatus},</if>
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -119,6 +123,7 @@
|
||||
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="communicationStatus != null">communication_status = #{communicationStatus},</if>
|
||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -134,21 +139,21 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getAllStackInfoBySiteId" parameterType="Long" resultType="java.util.Map">
|
||||
select id,device_name as deviceName from ems_devices_setting
|
||||
where id in (
|
||||
<select id="getAllStackInfoBySiteId" 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_stack eb where eb.site_id = #{siteId})
|
||||
</select>
|
||||
|
||||
<select id="getAllClusterInfoByStackId" parameterType="Long" resultType="java.util.Map">
|
||||
select id,device_name as deviceName
|
||||
<select id="getAllClusterInfoByStackId" parameterType="String" resultType="java.util.Map">
|
||||
select device_id as id,device_name as deviceName
|
||||
from ems_devices_setting
|
||||
where id in (select distinct eb.device_id from ems_battery_cluster eb where eb.stack_device_id = #{stackDeviceId})
|
||||
where device_id in (select distinct eb.device_id from ems_battery_cluster eb where eb.stack_device_id = #{stackDeviceId})
|
||||
</select>
|
||||
|
||||
<select id="getDeviceStatus" parameterType="Long" resultType="java.util.Map">
|
||||
select id,communication_status
|
||||
<select id="getDeviceStatus" parameterType="String" resultType="java.util.Map">
|
||||
select device_id as id,communication_status
|
||||
from ems_devices_setting
|
||||
where id = #{deviceId}
|
||||
where device_id = #{deviceId}
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user