|
|
|
@ -1,42 +1,74 @@
|
|
|
|
|
<?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">
|
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.ruoyi.system.mapper.BaseAlarmModuleMapper">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap type="BaseAlarmModule" id="BaseAlarmModuleResult">
|
|
|
|
|
<result property="objId" column="ObjId" />
|
|
|
|
|
<result property="alarmmoduleId" column="AlarmModule_Id" />
|
|
|
|
|
<result property="alarmmoduleText" column="AlarmModule_Text" />
|
|
|
|
|
<result property="monitorunitId" column="MonitorUnit_Id" />
|
|
|
|
|
<result property="alarmTypeId" column="AlarmType_Id" />
|
|
|
|
|
<result property="enableFlag" column="Enable_Flag" />
|
|
|
|
|
<result property="createdBy" column="CREATED_BY" />
|
|
|
|
|
<result property="createdTime" column="CREATED_TIME" />
|
|
|
|
|
<result property="updatedBy" column="UPDATED_BY" />
|
|
|
|
|
<result property="updatedTime" column="UPDATED_TIME" />
|
|
|
|
|
<result property="objId" column="ObjId"/>
|
|
|
|
|
<result property="alarmmoduleId" column="AlarmModule_Id"/>
|
|
|
|
|
<result property="alarmmoduleText" column="AlarmModule_Text"/>
|
|
|
|
|
<result property="monitorunitId" column="MonitorUnit_Id"/>
|
|
|
|
|
<result property="alarmTypeId" column="AlarmType_Id"/>
|
|
|
|
|
<result property="enableFlag" column="Enable_Flag"/>
|
|
|
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
|
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
|
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
|
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<resultMap type="BaseAlarmModuleDto" id="BaseAlarmModuleDtoResult">
|
|
|
|
|
<result property="objId" column="ObjId"/>
|
|
|
|
|
<result property="alarmmoduleId" column="AlarmModule_Id"/>
|
|
|
|
|
<result property="alarmmoduleText" column="AlarmModule_Text"/>
|
|
|
|
|
<result property="monitorunitId" column="MonitorUnit_Id"/>
|
|
|
|
|
<result property="alarmTypeId" column="AlarmType_Id"/>
|
|
|
|
|
<result property="alarmTypeName" column="AlarmType_Name"/>
|
|
|
|
|
<result property="monitorunitName" column="MonitorUnit_Name"/>
|
|
|
|
|
<result property="alarmTypeId" column="AlarmType_Id"/>
|
|
|
|
|
<result property="enableFlag" column="Enable_Flag"/>
|
|
|
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
|
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
|
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
|
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectBaseAlarmModuleVo">
|
|
|
|
|
select ObjId, AlarmModule_Id, AlarmModule_Text, MonitorUnit_Id,AlarmType_Id, Enable_Flag, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME from base_alarm_module
|
|
|
|
|
-- select ObjId, AlarmModule_Id, AlarmModule_Text, MonitorUnit_Id,AlarmType_Id, Enable_Flag, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME from base_alarm_module
|
|
|
|
|
select t1.ObjId,
|
|
|
|
|
t1.AlarmModule_Id,
|
|
|
|
|
t1.AlarmModule_Text,
|
|
|
|
|
t1.MonitorUnit_Id,
|
|
|
|
|
t2.MonitorUnit_Name,
|
|
|
|
|
t1.AlarmType_Id,
|
|
|
|
|
t3.AlarmType_Name,
|
|
|
|
|
t1.Enable_Flag,
|
|
|
|
|
t1.CREATED_BY,
|
|
|
|
|
t1.CREATED_TIME,
|
|
|
|
|
t1.UPDATED_BY,
|
|
|
|
|
t1.UPDATED_TIME
|
|
|
|
|
from base_alarm_module t1
|
|
|
|
|
left join base_monitorunit_info t2 on t1.MonitorUnit_Id = t2.MonitorUnit_Id
|
|
|
|
|
left join base_alarm_type t3 on t1.AlarmType_Id = t3.alarmType_Id
|
|
|
|
|
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseAlarmModuleList" parameterType="BaseAlarmModule" resultMap="BaseAlarmModuleResult">
|
|
|
|
|
<select id="selectBaseAlarmModuleList" parameterType="BaseAlarmModule" resultMap="BaseAlarmModuleDtoResult">
|
|
|
|
|
<include refid="selectBaseAlarmModuleVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="alarmmoduleId != null and alarmmoduleId != ''"> and AlarmModule_Id = #{alarmmoduleId}</if>
|
|
|
|
|
<if test="alarmmoduleText != null and alarmmoduleText != ''"> and AlarmModule_Text = #{alarmmoduleText}</if>
|
|
|
|
|
<if test="monitorunitId != null and monitorunitId != ''"> and MonitorUnit_Id = #{monitorunitId}</if>
|
|
|
|
|
<if test="alarmTypeId != null and alarmTypeId != ''"> and AlarmType_Id = #{alarmTypeId}</if>
|
|
|
|
|
<if test="enableFlag != null "> and Enable_Flag = #{enableFlag}</if>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="alarmmoduleId != null and alarmmoduleId != ''">and t1.AlarmModule_Id = #{alarmmoduleId}</if>
|
|
|
|
|
<if test="alarmmoduleText != null and alarmmoduleText != ''">and t1.AlarmModule_Text = #{alarmmoduleText}</if>
|
|
|
|
|
<if test="monitorunitId != null and monitorunitId != ''">and t1.MonitorUnit_Id = #{monitorunitId}</if>
|
|
|
|
|
<if test="alarmTypeId != null and alarmTypeId != ''">and t1.AlarmType_Id = #{alarmTypeId}</if>
|
|
|
|
|
<if test="enableFlag != null ">and t1.Enable_Flag = #{enableFlag}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseAlarmModuleByObjId" parameterType="String" resultMap="BaseAlarmModuleResult">
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseAlarmModuleByObjId" parameterType="String" resultMap="BaseAlarmModuleDtoResult">
|
|
|
|
|
<include refid="selectBaseAlarmModuleVo"/>
|
|
|
|
|
where ObjId = #{objId}
|
|
|
|
|
where t1.ObjId = #{objId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertBaseAlarmModule" parameterType="BaseAlarmModule">
|
|
|
|
|
insert into base_alarm_module
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
@ -50,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="createdTime != null">CREATED_TIME,</if>
|
|
|
|
|
<if test="updatedBy != null">UPDATED_BY,</if>
|
|
|
|
|
<if test="updatedTime != null">UPDATED_TIME,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="objId != null">#{objId},</if>
|
|
|
|
|
<if test="alarmmoduleId != null">#{alarmmoduleId},</if>
|
|
|
|
@ -62,7 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="createdTime != null">#{createdTime},</if>
|
|
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateBaseAlarmModule" parameterType="BaseAlarmModule">
|
|
|
|
@ -82,11 +114,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBaseAlarmModuleByObjId" parameterType="String">
|
|
|
|
|
delete from base_alarm_module where ObjId = #{objId}
|
|
|
|
|
delete
|
|
|
|
|
from base_alarm_module
|
|
|
|
|
where ObjId = #{objId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBaseAlarmModuleByObjIds" parameterType="String">
|
|
|
|
|
delete from base_alarm_module where ObjId in
|
|
|
|
|
delete from base_alarm_module where ObjId in
|
|
|
|
|
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{objId}
|
|
|
|
|
</foreach>
|
|
|
|
|