task61-告警保护方案增删改查
This commit is contained in:
@ -26,11 +26,12 @@
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deviceCategory" column="device_category" />
|
||||
<result property="runningStatus" column="running_status" />
|
||||
<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, picture_url 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, running_status, picture_url from ems_devices_setting
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsDevicesSettingList" parameterType="EmsDevicesSetting" resultMap="EmsDevicesSettingResult">
|
||||
@ -56,6 +57,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="runningStatus != null and runningStatus != ''"> and running_status = #{runningStatus}</if>
|
||||
<if test="pictureUrl != null and pictureUrl != ''"> and picture_url = #{pictureUrl}</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -88,6 +90,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="runningStatus != null">running_status,</if>
|
||||
<if test="pictureUrl != null">picture_url,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@ -111,6 +114,7 @@
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="deviceCategory != null">#{deviceCategory},</if>
|
||||
<if test="runningStatus != null">#{runningStatus},</if>
|
||||
<if test="pictureUrl != null">#{pictureUrl},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
@ -138,6 +142,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="runningStatus != null">running_status = #{runningStatus},</if>
|
||||
<if test="pictureUrl != null">picture_url = #{pictureUrl},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
|
||||
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xzzn.ems.mapper.EmsFaultProtectionPlanMapper">
|
||||
|
||||
<resultMap type="EmsFaultProtectionPlan" id="EmsFaultProtectionPlanResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="faultName" column="fault_name" />
|
||||
<result property="faultLevel" column="fault_level" />
|
||||
<result property="protectionSettings" column="protection_settings" />
|
||||
<result property="faultDelaySeconds" column="fault_delay_seconds" />
|
||||
<result property="protectionPlan" column="protection_plan" />
|
||||
<result property="releaseDelaySeconds" column="release_delay_seconds" />
|
||||
<result property="description" column="description" />
|
||||
<result property="isAlert" column="is_alert" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsFaultProtectionPlanVo">
|
||||
select id, site_id, fault_name, fault_level, protection_settings, fault_delay_seconds, protection_plan, release_delay_seconds, description, is_alert, status, create_by, create_time, update_by, update_time from ems_fault_protection_plan
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsFaultProtectionPlanList" parameterType="EmsFaultProtectionPlan" resultMap="EmsFaultProtectionPlanResult">
|
||||
<include refid="selectEmsFaultProtectionPlanVo"/>
|
||||
<where>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="faultName != null and faultName != ''"> and fault_name like concat('%', #{faultName}, '%')</if>
|
||||
<if test="faultLevel != null "> and fault_level = #{faultLevel}</if>
|
||||
<if test="protectionSettings != null and protectionSettings != ''"> and protection_settings = #{protectionSettings}</if>
|
||||
<if test="faultDelaySeconds != null "> and fault_delay_seconds = #{faultDelaySeconds}</if>
|
||||
<if test="protectionPlan != null and protectionPlan != ''"> and protection_plan = #{protectionPlan}</if>
|
||||
<if test="releaseDelaySeconds != null "> and release_delay_seconds = #{releaseDelaySeconds}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="isAlert != null "> and is_alert = #{isAlert}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsFaultProtectionPlanById" parameterType="Long" resultMap="EmsFaultProtectionPlanResult">
|
||||
<include refid="selectEmsFaultProtectionPlanVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsFaultProtectionPlan" parameterType="EmsFaultProtectionPlan" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ems_fault_protection_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="faultName != null and faultName != ''">fault_name,</if>
|
||||
<if test="faultLevel != null">fault_level,</if>
|
||||
<if test="protectionSettings != null">protection_settings,</if>
|
||||
<if test="faultDelaySeconds != null">fault_delay_seconds,</if>
|
||||
<if test="protectionPlan != null">protection_plan,</if>
|
||||
<if test="releaseDelaySeconds != null">release_delay_seconds,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="isAlert != null">is_alert,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="faultName != null and faultName != ''">#{faultName},</if>
|
||||
<if test="faultLevel != null">#{faultLevel},</if>
|
||||
<if test="protectionSettings != null">#{protectionSettings},</if>
|
||||
<if test="faultDelaySeconds != null">#{faultDelaySeconds},</if>
|
||||
<if test="protectionPlan != null">#{protectionPlan},</if>
|
||||
<if test="releaseDelaySeconds != null">#{releaseDelaySeconds},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="isAlert != null">#{isAlert},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsFaultProtectionPlan" parameterType="EmsFaultProtectionPlan">
|
||||
update ems_fault_protection_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="faultName != null and faultName != ''">fault_name = #{faultName},</if>
|
||||
<if test="faultLevel != null">fault_level = #{faultLevel},</if>
|
||||
<if test="protectionSettings != null">protection_settings = #{protectionSettings},</if>
|
||||
<if test="faultDelaySeconds != null">fault_delay_seconds = #{faultDelaySeconds},</if>
|
||||
<if test="protectionPlan != null">protection_plan = #{protectionPlan},</if>
|
||||
<if test="releaseDelaySeconds != null">release_delay_seconds = #{releaseDelaySeconds},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="isAlert != null">is_alert = #{isAlert},</if>
|
||||
<if test="status != null">status = #{status},</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>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsFaultProtectionPlanById" parameterType="Long">
|
||||
delete from ems_fault_protection_plan where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsFaultProtectionPlanByIds" parameterType="String">
|
||||
delete from ems_fault_protection_plan where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -136,7 +136,7 @@
|
||||
<select id="getAllSiteDeviceList" parameterType="String" resultType="com.xzzn.ems.domain.vo.SiteDeviceListVo">
|
||||
select es.site_id as siteId,es.site_name as siteName,
|
||||
ed.device_id as deviceId,ed.device_name as deviceName,
|
||||
ed.device_type as deviceType,ed.communication_status as communicationStatus,
|
||||
ed.device_type as deviceType,ed.running_status as runningStatus,
|
||||
ed.device_category as deviceCategory,
|
||||
ed.picture_url as pictureUrl,
|
||||
ed.id,
|
||||
|
||||
Reference in New Issue
Block a user