作者 钟来

修改设备模块查询列表得排序和状态筛选

... ... @@ -19,26 +19,7 @@ public class SysMonitorServerLog {
private Integer connection_count;
@ApiModelProperty("创建时间")
private Long create_time;
@ApiModelProperty("内存信息")
private String memory_info;
@ApiModelProperty("cpu信息")
private String cpu_info;
public String getMemory_info() {
return memory_info;
}
public void setMemory_info(String memory_info) {
this.memory_info = memory_info;
}
public String getCpu_info() {
return cpu_info;
}
public void setCpu_info(String cpu_info) {
this.cpu_info = cpu_info;
}
public Integer getId() {
return id;
}
... ...
... ... @@ -48,26 +48,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN `sys_user` u ON u.user_id = a.sys_user_id
<where>
<if test="status !=null">
and `status` = #{status}
and a.`status` = #{status}
</if>
<if test="product_id !=null and product_id != ''">
and product_id = #{product_id}
and a.product_id = #{product_id}
</if>
<if test="mqtt_username !=null and mqtt_username != ''">
and mqtt_username = #{mqtt_username}
and a.mqtt_username = #{mqtt_username}
</if>
<if test="client_id != null and client_id != ''">
AND client_id like concat('%', #{client_id}, '%')
AND a.client_id like concat('%', #{client_id}, '%')
</if>
<if test="sys_user_id !=null">
and `sys_user_id` = #{sys_user_id}
and a.`sys_user_id` = #{sys_user_id}
</if>
<if test="params.dataScope !=null and params.dataScope!=''">
<if test="params!=null and params.dataScope !=null and params.dataScope!=''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
order by a.create_time desc
</select>
<select id="selectIotDeviceByClient_id" parameterType="String" resultMap="IotDeviceResult">
... ...
... ... @@ -47,11 +47,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sys_user_id !=null and sys_user_id != ''">
and sys_user_id = #{sys_user_id}
</if>
<if test="params.dataScope !=null and params.dataScope!=''">
<if test="params!=null and params.dataScope !=null and params.dataScope!=''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
order by a.create_time desc
</select>
<select id="selectIotProductById" parameterType="Integer" resultMap="IotProductResult">
... ...
... ... @@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectIotRoleVo"/>
LEFT JOIN `sys_user` u ON u.user_id = a.sys_user_id
<where>
<if test="params.dataScope !=null and params.dataScope!=''">
<if test="params!=null and params.dataScope !=null and params.dataScope!=''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
... ...
... ... @@ -74,25 +74,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN `sys_user` u ON u.user_id = a.sys_user_id
<where>
<if test="device_id !=null and device_id != ''">
and device_id = #{device_id}
and a.device_id = #{device_id}
</if>
<if test="online !=null">
and a.online = #{online}
</if>
<if test="name != null and name != ''">
AND `name` like concat('%', #{name}, '%')
AND a.`name` like concat('%', #{name}, '%')
</if>
<if test="product_id !=null and product_id != ''">
and product_id = #{product_id}
and a.product_id = #{product_id}
</if>
<if test="mqtt_username != null and mqtt_username != ''">
AND `mqtt_username` like concat('%', #{mqtt_username}, '%')
AND a.`mqtt_username` like concat('%', #{mqtt_username}, '%')
</if>
<if test="sys_user_id !=null and sys_user_id != ''">
and sys_user_id = #{sys_user_id}
and a.sys_user_id = #{sys_user_id}
</if>
<if test="params.dataScope !=null and params.dataScope!=''">
<if test="params!=null and params.dataScope !=null and params.dataScope!=''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
order by a.create_time desc
</select>
<select id="selectIotTerminalListByUserId" parameterType="IotTerminal" resultMap="IotTerminalResult">
... ...
... ... @@ -38,46 +38,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN `sys_user` u ON u.user_id = a.sys_user_id
<where>
<if test="create_by !=null and create_by != ''">
and create_by = #{create_by}
and a.create_by = #{create_by}
</if>
<if test="data_type !=null and data_type != ''">
and data_type = #{data_type}
and a.data_type = #{data_type}
</if>
<if test="identifier !=null and identifier != ''">
and identifier = #{identifier}
and a.identifier = #{identifier}
</if>
<if test="is_save_log !=null and is_save_log != ''">
and is_save_log = #{is_save_log}
and a.is_save_log = #{is_save_log}
</if>
<if test="is_monitor !=null and is_monitor != ''">
and is_monitor = #{is_monitor}
and a.is_monitor = #{is_monitor}
</if>
<if test="model_id !=null and model_id != ''">
and model_id = #{model_id}
and a.model_id = #{model_id}
</if>
<if test="model_name !=null and model_name != ''">
and model_name = #{model_name}
and a.model_name = #{model_name}
</if>
<if test="type !=null and type != ''">
and `type` = #{type}
</if>
<if test="product_id !=null and product_id != ''">
and product_id = #{product_id}
and a.product_id = #{product_id}
</if>
<if test="mqtt_username !=null and mqtt_username != ''">
and mqtt_username = #{mqtt_username}
and a.mqtt_username = #{mqtt_username}
</if>
<if test="ascription !=null and ascription != ''">
and ascription = #{ascription}
and a.ascription = #{ascription}
</if>
<if test="sys_user_id !=null and sys_user_id != ''">
and sys_user_id = #{sys_user_id}
and a.sys_user_id = #{sys_user_id}
</if>
<if test="params.dataScope !=null and params.dataScope!=''">
<if test="params!=null and params.dataScope !=null and params.dataScope!=''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
order by a.create_time desc
</select>
<select id="selectIotThingsModelListByIds" parameterType="Integer" resultMap="IotThingsModelResult">
... ...
... ... @@ -42,8 +42,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">
AND status = #{status}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
<if test="params!=null and params.dataScope !=null and params.dataScope!=''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
order by d.parent_id, d.order_num
</select>
... ...
... ... @@ -52,7 +52,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
<if test="params!=null and params.dataScope !=null and params.dataScope!=''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
order by r.role_sort
</select>
... ...
... ... @@ -81,8 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
<if test="params!=null and params.dataScope !=null and params.dataScope!=''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
... ... @@ -98,8 +100,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
<if test="params!=null and params.dataScope !=null and params.dataScope!=''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
... ... @@ -116,8 +120,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
<if test="params!=null and params.dataScope !=null and params.dataScope!=''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</select>
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
... ...
... ... @@ -106,8 +106,6 @@ public class ServerController extends BaseController
sysMonitorServerLog.setMemory_usage(sysMonitorServer.getMemory_usage());
sysMonitorServerLog.setDisk_usage(sysMonitorServer.getDisk_usage());
sysMonitorServerLog.setCreate_time(System.currentTimeMillis());
sysMonitorServerLog.setCpu_info(sysMonitorServer.getCpu_info());
sysMonitorServerLog.setMemory_info(sysMonitorServer.getMemory_info());
publicService.insert(sysMonitorServerLog);
return AjaxResult.success();
}
... ...