提交修改

This commit is contained in:
LEED
2025-04-13 18:00:19 +08:00
parent 988e68bdc7
commit 4201690d93
60 changed files with 2589 additions and 285 deletions

View File

@@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" />
<result property="tenantId" column="tenant_id" />
<result property="tenantName" column="tenant_name" />
<result property="serialNumber" column="serial_number"/>
</resultMap>
<resultMap type="com.xinda.iot.domain.Scene" id="AlertSceneResult">
@@ -44,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectAlertVo">
select alert_id, alert_name, alert_level, status, notify, create_by, create_time, update_by, update_time, remark, tenant_id, tenant_name from iot_alert
select alert_id, alert_name, alert_level, status, notify, create_by, create_time, update_by, update_time, remark, tenant_id, tenant_name,serial_number from iot_alert
</sql>
<select id="selectScenesByAlertId" parameterType="Long" resultMap="AlertSceneResult">
@@ -53,16 +54,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join iot_scene s on a.scene_id = s.scene_id
</select>
<delete id="deleteSceneByAlertId" parameterType="Long">
delete from iot_scene where scene_id in (select scene_id from iot_alert_scene where alert_id = #{alertId})
</delete>
<select id="selectAlertList" parameterType="Alert" resultMap="AlertResult">
<include refid="selectAlertVo"/>
select p.alert_id, p.alert_name, p.alert_level, p.status, p.notify, p.create_by, p.create_time,
p.update_by, p.update_time, p.remark, p.tenant_id, p.tenant_name,p.serial_number from iot_alert p
<where>
<if test="alertName != null and alertName != ''"> and alert_name like concat('%', #{alertName}, '%')</if>
<if test="alertLevel != null "> and alert_level = #{alertLevel}</if>
<if test="status != null "> and status = #{status}</if>
<if test="notify != null and notify != ''"> and notify = #{notify}</if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
<if test="alertName != null and alertName != ''"> and p.alert_name like concat('%', #{alertName}, '%')</if>
<if test="alertLevel != null "> and p.alert_level = #{alertLevel}</if>
<if test="status != null "> and p.status = #{status}</if>
<if test="notify != null and notify != ''"> and p.notify = #{notify}</if>
<if test="tenantId != null "> and p.tenant_id = #{tenantId}</if>
<!-- <if test="deptId != null ">-->
<!-- and ( p.tenant_id = #{tenantId}-->
<!-- or (p.tenant_id in (-->
<!-- SELECT de.dept_user_id-->
<!-- FROM sys_dept de-->
<!-- WHERE FIND_IN_SET( de.dept_id,(-->
<!-- SELECT d.ancestors-->
<!-- FROM sys_dept d-->
<!-- WHERE d.dept_id = #{deptId} )-->
<!-- )-->
<!-- )-->
<!-- )-->
<!-- )-->
<!-- </if>-->
<if test="serialNumber != null and serialNumber != ''">and p.serial_number = #{serialNumber}</if>
</where>
order by create_time desc
order by p.create_time desc
</select>
<select id="selectAlertByAlertId" parameterType="Long" resultMap="AlertResult">
@@ -110,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="alertName != null and alertName != ''">#{alertName},</if>
@@ -123,6 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">#{remark},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
<if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if>
</trim>
</insert>
@@ -138,6 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="serialNumber != null and serialNumber != ''">serial_number = #{serialNumber},</if>
</trim>
where alert_id = #{alertId}
</update>