1、增加单位图标管理

2、修改机构登录
3、订单问题处理
4、完善组态绑定及删除关联
This commit is contained in:
LEED
2025-06-22 10:33:36 +08:00
parent 3bac43403b
commit b2cee8aeb7
40 changed files with 1367 additions and 86 deletions

View File

@@ -101,8 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectNotifyTemplateListByAlertId" resultType="com.xinda.notify.domain.NotifyTemplate">
select n.id, n.service_code,n.msg_params,n.status,n.type, n.name, n.channel_id, n.channel_type, n.provider, n.create_by, n.create_time, n.update_by, n.update_time, n.del_flag, n.tenant_id, n.tenant_name, c.name channelName
from iot_alert_notify_template a left join notify_template n on a.notify_template_id = n.id
select n.id, n.service_code,n.msg_params,n.status, n.name, n.channel_id, n.channel_type, n.provider, n.create_by, n.create_time, n.update_by, n.update_time, n.del_flag, n.tenant_id, n.tenant_name, c.name channelName
from iot_alert_notify_template a left join notify_template n on a.notify_template_id = n.id
left join notify_channel c on n.channel_id = c.id
where a.alert_id = #{alertId}
</select>

View File

@@ -68,37 +68,72 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where log_id = #{logId}
</select>
<!-- <select id="selectCategoryLogCount" parameterType="com.xinda.iot.domain.Device" resultType="com.xinda.iot.model.DeviceStatistic">-->
<!-- SELECT-->
<!-- (select count(log_id)-->
<!-- from iot_device_log-->
<!-- <where>-->
<!-- <if test="1==1"> and log_type=1</if>-->
<!-- <if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>-->
<!-- </where>-->
<!-- ) as propertyCount,-->
<!-- (select count(id)-->
<!-- from iot_function_log-->
<!-- <where>-->
<!-- <if test="1==1"> and fun_type=2</if>-->
<!-- <if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>-->
<!-- </where>-->
<!-- ) as functionCount,-->
<!-- (select count(log_id)-->
<!-- from iot_event_log-->
<!-- <where>-->
<!-- <if test="1==1"> and log_type=3</if>-->
<!-- <if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>-->
<!-- </where>-->
<!-- ) as eventCount,-->
<!-- (select count(log_id)-->
<!-- from iot_device_log-->
<!-- <where>-->
<!-- <if test="1==1"> and log_type=1 and is_monitor=1</if>-->
<!-- <if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>-->
<!-- </where>-->
<!-- ) as monitorCount-->
<!-- limit 1-->
<!-- </select>-->
<select id="selectCategoryLogCount" parameterType="com.xinda.iot.domain.Device" resultType="com.xinda.iot.model.DeviceStatistic">
SELECT
(select count(log_id)
from iot_device_log
<where>
<if test="1==1"> and log_type=1</if>
<if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>
</where>
) as propertyCount,
(select count(id)
from iot_function_log
<where>
<if test="1==1"> and fun_type=2</if>
<if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>
</where>
) as functionCount,
(select count(log_id)
from iot_event_log
<where>
<if test="1==1"> and log_type=3</if>
<if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>
</where>
) as eventCount,
(select count(log_id)
from iot_device_log
<where>
<if test="1==1"> and log_type=1 and is_monitor=1</if>
<if test="tenantId != null and tenantId != 0"> and user_id = #{tenantId}</if>
</where>
) as monitorCount
limit 1
SUM(CASE WHEN type = 'property' THEN cnt ELSE 0 END) AS propertyCount,
SUM(CASE WHEN type = 'function' THEN cnt ELSE 0 END) AS functionCount,
SUM(CASE WHEN type = 'event' THEN cnt ELSE 0 END) AS eventCount,
SUM(CASE WHEN type = 'monitor' THEN cnt ELSE 0 END) AS monitorCount
FROM (
SELECT 'property' AS type, COUNT(log_id) AS cnt
FROM iot_device_log
WHERE log_type = 1
<if test="tenantId != null and tenantId != 0">and user_id = #{tenantId}</if>
UNION ALL
SELECT 'function' AS type, COUNT(id) AS cnt
FROM iot_function_log
WHERE fun_type = 2
<if test="tenantId != null and tenantId != 0">and user_id = #{tenantId}</if>
UNION ALL
SELECT 'event' AS type, COUNT(log_id) AS cnt
FROM iot_event_log
WHERE log_type = 3
<if test="tenantId != null and tenantId != 0">and user_id = #{tenantId}</if>
UNION ALL
SELECT 'monitor' AS type, COUNT(log_id) AS cnt
FROM iot_device_log
WHERE log_type = 1 AND is_monitor = 1
<if test="tenantId != null and tenantId != 0">and user_id = #{tenantId}</if>
) AS subquery;
</select>
<insert id="insertDeviceLog" parameterType="com.xinda.iot.domain.DeviceLog" useGeneratedKeys="true" keyProperty="logId">

View File

@@ -0,0 +1,82 @@
<?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.xinda.iot.mapper.UnitIconMapper">
<resultMap type="UnitIcon" id="UnitIconResult">
<result property="id" column="id" />
<result property="unitDesc" column="unit_desc" />
<result property="unitName" column="unit_name" />
<result property="resourceUrl" column="resource_url" />
<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="selectUnitIconVo">
select id, unit_desc, unit_name, resource_url, create_by, create_time, update_by, update_time from iot_unit_icon
</sql>
<select id="selectUnitIconList" parameterType="UnitIcon" resultMap="UnitIconResult">
<include refid="selectUnitIconVo"/>
<where>
<if test="unitDesc != null and unitDesc != ''"> and unit_desc like concat('%', #{unitDesc}, '%')</if>
<if test="unitName != null and unitName != ''"> and unit_name = #{unitName}</if>
<if test="resourceUrl != null and resourceUrl != ''"> and resource_url = #{resourceUrl}</if>
</where>
</select>
<select id="selectUnitIconById" parameterType="Long" resultMap="UnitIconResult">
<include refid="selectUnitIconVo"/>
where id = #{id}
</select>
<insert id="insertUnitIcon" parameterType="UnitIcon" useGeneratedKeys="true" keyProperty="id">
insert into iot_unit_icon
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="unitDesc != null">unit_desc,</if>
<if test="unitName != null">unit_name,</if>
<if test="resourceUrl != null">resource_url,</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="unitDesc != null">#{unitDesc},</if>
<if test="unitName != null">#{unitName},</if>
<if test="resourceUrl != null">#{resourceUrl},</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="updateUnitIcon" parameterType="UnitIcon">
update iot_unit_icon
<trim prefix="SET" suffixOverrides=",">
<if test="unitDesc != null">unit_desc = #{unitDesc},</if>
<if test="unitName != null">unit_name = #{unitName},</if>
<if test="resourceUrl != null">resource_url = #{resourceUrl},</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="deleteUnitIconById" parameterType="Long">
delete from iot_unit_icon where id = #{id}
</delete>
<delete id="deleteUnitIconByIds" parameterType="String">
delete from iot_unit_icon where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>