mirror of
https://github.com/kerwincui/FastBee.git
synced 2025-10-12 19:40:51 +08:00
bug处理
This commit is contained in:
@@ -46,7 +46,55 @@ public class AlertLog extends BaseEntity
|
||||
@Excel(name = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
public void setAlertLogId(Long alertLogId)
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 用户昵称 */
|
||||
@Excel(name = "用户昵称")
|
||||
private String userName;
|
||||
|
||||
/** 租户ID */
|
||||
@Excel(name = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
/** 租户名称 */
|
||||
@Excel(name = "租户名称")
|
||||
private String tenantName;
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public Long getTenantId() {
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(Long tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public String getTenantName() {
|
||||
return tenantName;
|
||||
}
|
||||
|
||||
public void setTenantName(String tenantName) {
|
||||
this.tenantName = tenantName;
|
||||
}
|
||||
|
||||
public void setAlertLogId(Long alertLogId)
|
||||
{
|
||||
this.alertLogId = alertLogId;
|
||||
}
|
||||
|
@@ -18,15 +18,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAlertLogVo">
|
||||
select alert_log__id, alert_name, alert_level, status, product_id, product_name, device_id, device_name, create_by, create_time, update_by, update_time, remark from iot_alert_log
|
||||
select alert_log__id, alert_name, alert_level, status, product_id, product_name, device_id, device_name,user_id, user_name, tenant_id, tenant_name, create_by, create_time, update_by, update_time, remark from iot_alert_log
|
||||
</sql>
|
||||
|
||||
<select id="selectAlertLogList" parameterType="com.ruoyi.iot.domain.AlertLog" resultMap="AlertLogResult">
|
||||
<include refid="selectAlertLogVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="userId != null and userId != 0"> and user_id = #{userId}</if>
|
||||
<if test="tenantId != null and tenantId != 0"> and tenant_id = #{tenantId}</if>
|
||||
<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>
|
||||
@@ -57,6 +63,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="alertName != null and alertName != ''">#{alertName},</if>
|
||||
@@ -71,6 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -89,6 +103,10 @@ 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="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
|
||||
</trim>
|
||||
where alert_log__id = #{alertLogId}
|
||||
</update>
|
||||
|
@@ -239,10 +239,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
(
|
||||
<!--普通用户查询设备中的产品数量-->
|
||||
<if test="userId != null and userId != 0">
|
||||
select count(product_id)
|
||||
select count(distinct product_id)
|
||||
from iot_device
|
||||
where user_id = #{userId}
|
||||
group by product_id
|
||||
</if>
|
||||
<!--管理员和租户直接查询产品的数量-->
|
||||
<if test="userId == null || userId == 0">
|
||||
|
@@ -26,9 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectDeviceUserVo"/>
|
||||
<where>
|
||||
<if test="1==1"> and device_id = #{deviceId}</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="isOwner != null "> and is_owner = #{isOwner}</if>
|
||||
<if test="userId != null and userId != 0"> and user_id = #{userId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
Reference in New Issue
Block a user