设备列表-设备增删改查
This commit is contained in:
@ -26,10 +26,11 @@
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deviceCategory" column="device_category" />
|
||||
<result property="pictureUrl" column="picture_url" />
|
||||
</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, device_category 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, picture_url from ems_devices_setting
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsDevicesSettingList" parameterType="EmsDevicesSetting" resultMap="EmsDevicesSettingResult">
|
||||
@ -55,6 +56,7 @@
|
||||
<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>
|
||||
<if test="pictureUrl != null and pictureUrl != ''"> and picture_url = #{pictureUrl}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -86,6 +88,7 @@
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="deviceCategory != null">device_category,</if>
|
||||
<if test="pictureUrl != null">picture_url,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
@ -108,6 +111,7 @@
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="deviceCategory != null">#{deviceCategory},</if>
|
||||
<if test="pictureUrl != null">#{pictureUrl},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -134,6 +138,7 @@
|
||||
<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>
|
||||
<if test="pictureUrl != null">picture_url = #{pictureUrl},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -180,9 +185,10 @@
|
||||
from ems_devices_setting where site_id = #{siteId} and device_category = #{deviceCategory}
|
||||
</select>
|
||||
|
||||
<select id="getDeviceDetailInfo" parameterType="String" resultMap="EmsDevicesSettingResult">
|
||||
<select id="getDeviceBySiteAndDeviceId" parameterType="String" resultMap="EmsDevicesSettingResult">
|
||||
<include refid="selectEmsDevicesSettingVo"/>
|
||||
where device_id = #{deviceId}
|
||||
AND site_id = #{siteId}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user