设备增加管护
This commit is contained in:
parent
c86a631cc5
commit
498f77bc80
@ -178,6 +178,12 @@ public class Device extends BaseEntity
|
|||||||
|
|
||||||
@ApiModelProperty("设备参数")
|
@ApiModelProperty("设备参数")
|
||||||
private String devParams;
|
private String devParams;
|
||||||
|
@ApiModelProperty("管护人")
|
||||||
|
private String caretaker;
|
||||||
|
@ApiModelProperty("管护单位")
|
||||||
|
private String managementUnit;
|
||||||
|
@ApiModelProperty("联系电话")
|
||||||
|
private String tel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联组态,来源产品
|
* 关联组态,来源产品
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.fastbee.iot.model;
|
package com.fastbee.iot.model;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -66,6 +67,12 @@ public class DeviceAllShortOutput
|
|||||||
private Integer isOwner;
|
private Integer isOwner;
|
||||||
|
|
||||||
private Integer subDeviceCount;
|
private Integer subDeviceCount;
|
||||||
|
@ApiModelProperty("管护人")
|
||||||
|
private String caretaker;
|
||||||
|
@ApiModelProperty("管护单位")
|
||||||
|
private String managementUnit;
|
||||||
|
@ApiModelProperty("联系电话")
|
||||||
|
private String tel;
|
||||||
|
|
||||||
public Integer getSubDeviceCount() {
|
public Integer getSubDeviceCount() {
|
||||||
return subDeviceCount;
|
return subDeviceCount;
|
||||||
|
@ -94,6 +94,13 @@ public class DeviceShortOutput
|
|||||||
@Excel(name = "网关设备编号(子设备使用)")
|
@Excel(name = "网关设备编号(子设备使用)")
|
||||||
private String gwDevCode;
|
private String gwDevCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("管护人")
|
||||||
|
private String caretaker;
|
||||||
|
@ApiModelProperty("管护单位")
|
||||||
|
private String managementUnit;
|
||||||
|
@ApiModelProperty("联系电话")
|
||||||
|
private String tel;
|
||||||
|
|
||||||
/** 是否自定义位置 **/
|
/** 是否自定义位置 **/
|
||||||
private Integer locationWay;
|
private Integer locationWay;
|
||||||
|
|
||||||
|
@ -36,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="transport" column="transport" />
|
<result property="transport" column="transport" />
|
||||||
<result property="guid" column="guid" />
|
<result property="guid" column="guid" />
|
||||||
<result property="devParams" column="dev_params" />
|
<result property="devParams" column="dev_params" />
|
||||||
|
<result property="tel" column="tel" />
|
||||||
|
<result property="caretaker" column="caretaker" />
|
||||||
|
<result property="managementUnit" column="management_unit" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap type="com.fastbee.iot.model.DeviceShortOutput" id="DeviceShortResult">
|
<resultMap type="com.fastbee.iot.model.DeviceShortOutput" id="DeviceShortResult">
|
||||||
@ -65,6 +68,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="transport" column="transport" />
|
<result property="transport" column="transport" />
|
||||||
<result property="guid" column="guid" />
|
<result property="guid" column="guid" />
|
||||||
<result property="devParams" column="dev_params" />
|
<result property="devParams" column="dev_params" />
|
||||||
|
<result property="tel" column="tel" />
|
||||||
|
<result property="caretaker" column="caretaker" />
|
||||||
|
<result property="managementUnit" column="management_unit" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap type="com.fastbee.iot.model.DeviceAllShortOutput" id="DeviceAllShortResult">
|
<resultMap type="com.fastbee.iot.model.DeviceAllShortOutput" id="DeviceAllShortResult">
|
||||||
@ -86,6 +92,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="isOwner" column="is_owner" />
|
<result property="isOwner" column="is_owner" />
|
||||||
<result property="subDeviceCount" column="sub_device_count"/>
|
<result property="subDeviceCount" column="sub_device_count"/>
|
||||||
<result property="devParams" column="dev_params" />
|
<result property="devParams" column="dev_params" />
|
||||||
|
<result property="tel" column="tel" />
|
||||||
|
<result property="caretaker" column="caretaker" />
|
||||||
|
<result property="managementUnit" column="management_unit" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap type="com.fastbee.iot.model.UserAndTenant" id="UserAndTenantResult">
|
<resultMap type="com.fastbee.iot.model.UserAndTenant" id="UserAndTenantResult">
|
||||||
@ -203,7 +212,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectUnAuthDeviceList" parameterType="com.fastbee.iot.domain.Device" resultMap="DeviceResult">
|
<select id="selectUnAuthDeviceList" parameterType="com.fastbee.iot.domain.Device" resultMap="DeviceResult">
|
||||||
select d.device_id, d.device_name, d.product_id, d.product_name, d.tenant_id, d.tenant_name,
|
select d.device_id, d.device_name, d.product_id, d.product_name, d.tenant_id, d.tenant_name,
|
||||||
d.serial_number,d.gw_dev_code,d.dev_params, d.firmware_version, d.status,d.is_shadow,d.is_simulate ,d.location_way,d.active_time, d.img_url,a.device_id as auth_device_id
|
d.management_unit, d.caretaker, d.tel,
|
||||||
|
d.serial_number,d.gw_dev_code,d.dev_params, d.firmware_version, d.status,d.is_shadow,d.is_simulate ,
|
||||||
|
d.location_way,d.active_time, d.img_url,a.device_id as auth_device_id
|
||||||
from iot_device d
|
from iot_device d
|
||||||
left join iot_product_authorize a on a.device_id=d.device_id
|
left join iot_product_authorize a on a.device_id=d.device_id
|
||||||
<where>
|
<where>
|
||||||
@ -230,7 +241,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDeviceListByGroup" parameterType="com.fastbee.iot.domain.Device" resultMap="DeviceResult">
|
<select id="selectDeviceListByGroup" parameterType="com.fastbee.iot.domain.Device" resultMap="DeviceResult">
|
||||||
select d.device_id, d.device_name, d.dev_params, d.product_name, d.serial_number,d.gw_dev_code, d.firmware_version, d.status,d.rssi,d.is_shadow ,
|
select d.device_id, d.device_name, d.dev_params, d.product_name,
|
||||||
|
d.management_unit, d.caretaker, d.tel,
|
||||||
|
d.serial_number,d.gw_dev_code, d.firmware_version, d.status,d.rssi,d.is_shadow ,
|
||||||
d.location_way, d.active_time,d.network_address,d.longitude,d.latitude
|
d.location_way, d.active_time,d.network_address,d.longitude,d.latitude
|
||||||
from iot_device d
|
from iot_device d
|
||||||
<where>
|
<where>
|
||||||
@ -257,7 +270,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAllDeviceShortList" parameterType="com.fastbee.iot.domain.Device" resultMap="DeviceAllShortResult">
|
<select id="selectAllDeviceShortList" parameterType="com.fastbee.iot.domain.Device" resultMap="DeviceAllShortResult">
|
||||||
select d.device_id, d.device_name,d.dev_params, d.product_name,p.device_type, d.tenant_name, d.serial_number,d.gw_dev_code, d.firmware_version, d.status,d.rssi,d.is_shadow ,
|
select d.device_id, d.device_name,d.dev_params, d.product_name,p.device_type,
|
||||||
|
d.management_unit, d.caretaker, d.tel,
|
||||||
|
d.tenant_name, d.serial_number,d.gw_dev_code, d.firmware_version, d.status,d.rssi,d.is_shadow ,
|
||||||
d.location_way, d.active_time,d.network_address,d.longitude,d.latitude
|
d.location_way, d.active_time,d.network_address,d.longitude,d.latitude
|
||||||
from iot_device d
|
from iot_device d
|
||||||
left join iot_product p on p.product_id=d.product_id
|
left join iot_product p on p.product_id=d.product_id
|
||||||
@ -307,7 +322,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectDeviceShortList" parameterType="com.fastbee.iot.domain.Device" resultMap="DeviceShortResult">
|
<select id="selectDeviceShortList" parameterType="com.fastbee.iot.domain.Device" resultMap="DeviceShortResult">
|
||||||
select d.device_id, d.device_name, d.dev_params, p.product_id, p.product_name,p.device_type,
|
select d.device_id, d.device_name, d.dev_params, p.product_id, p.product_name,p.device_type,
|
||||||
d.tenant_id, d.tenant_name, d.serial_number,d.gw_dev_code,
|
d.tenant_id, d.tenant_name, d.serial_number,d.gw_dev_code,d.management_unit, d.caretaker, d.tel,
|
||||||
d.firmware_version, d.status,d.rssi,d.is_shadow,d.is_simulate ,d.location_way,
|
d.firmware_version, d.status,d.rssi,d.is_shadow,d.is_simulate ,d.location_way,
|
||||||
d.things_model_value, d.active_time,d.create_time, if(null = d.img_url or '' = d.img_url, p.img_url, d.img_url) as img_url,
|
d.things_model_value, d.active_time,d.create_time, if(null = d.img_url or '' = d.img_url, p.img_url, d.img_url) as img_url,
|
||||||
case
|
case
|
||||||
@ -352,7 +367,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectDeviceByDeviceId" parameterType="Long" resultMap="DeviceResult">
|
<select id="selectDeviceByDeviceId" parameterType="Long" resultMap="DeviceResult">
|
||||||
select d.device_id, d.device_name, d.dev_params, d.product_id, p.product_name,p.device_type, d.tenant_id, d.tenant_name,
|
select d.device_id, d.device_name, d.dev_params, d.product_id, p.product_name,p.device_type, d.tenant_id, d.tenant_name,
|
||||||
d.serial_number, d.firmware_version, d.status, d.rssi,d.is_shadow,d.is_simulate ,d.location_way,d.things_model_value,
|
d.serial_number, d.management_unit, d.caretaker, d.tel,
|
||||||
|
d.firmware_version, d.status, d.rssi,d.is_shadow,d.is_simulate ,d.location_way,d.things_model_value,
|
||||||
d.network_address, d.network_ip, d.longitude, d.latitude, d.active_time, d.create_time, d.update_time,
|
d.network_address, d.network_ip, d.longitude, d.latitude, d.active_time, d.create_time, d.update_time,
|
||||||
d.img_url,d.summary,d.remark,p.guid from iot_device d
|
d.img_url,d.summary,d.remark,p.guid from iot_device d
|
||||||
left join iot_product p on p.product_id=d.product_id
|
left join iot_product p on p.product_id=d.product_id
|
||||||
@ -518,6 +534,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="isSimulate != null">is_simulate,</if>
|
<if test="isSimulate != null">is_simulate,</if>
|
||||||
<if test="slaveId != null">slave_id,</if>
|
<if test="slaveId != null">slave_id,</if>
|
||||||
<if test="devParams != null">dev_params,</if>
|
<if test="devParams != null">dev_params,</if>
|
||||||
|
<if test="managementUnit != null">management_unit,</if>
|
||||||
|
<if test="caretaker != null">caretaker,</if>
|
||||||
|
<if test="tel != null">tel,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||||
@ -549,11 +568,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="isSimulate != null">#{isSimulate},</if>
|
<if test="isSimulate != null">#{isSimulate},</if>
|
||||||
<if test="slaveId != null">#{slaveId},</if>
|
<if test="slaveId != null">#{slaveId},</if>
|
||||||
<if test="devParams != null">#{devParams},</if>
|
<if test="devParams != null">#{devParams},</if>
|
||||||
|
<if test="managementUnit != null">#{managementUnit},</if>
|
||||||
|
<if test="caretaker != null">#{caretaker},</if>
|
||||||
|
<if test="tel != null">#{tel},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertBatchDevice" parameterType="com.fastbee.iot.domain.Device" useGeneratedKeys="true" keyProperty="deviceId">
|
<insert id="insertBatchDevice" parameterType="com.fastbee.iot.domain.Device" useGeneratedKeys="true" keyProperty="deviceId">
|
||||||
insert into iot_device (device_name, product_id, product_name, tenant_id, tenant_name, serial_number, firmware_version, rssi, is_shadow, location_way,dev_params, create_by, create_time)
|
insert into iot_device (device_name, product_id, product_name, tenant_id, tenant_name, serial_number,
|
||||||
|
firmware_version, rssi, is_shadow, location_way,dev_params, create_by, create_time)
|
||||||
values
|
values
|
||||||
<foreach collection="deviceList" item="device" separator=",">
|
<foreach collection="deviceList" item="device" separator=",">
|
||||||
(#{device.deviceName},
|
(#{device.deviceName},
|
||||||
@ -604,6 +627,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="summary != null">summary = #{summary},</if>
|
<if test="summary != null">summary = #{summary},</if>
|
||||||
<if test="slaveId != null">slave_id = #{slaveId},</if>
|
<if test="slaveId != null">slave_id = #{slaveId},</if>
|
||||||
<if test="devParams != null">dev_params = #{devParams},</if>
|
<if test="devParams != null">dev_params = #{devParams},</if>
|
||||||
|
<if test="managementUnit != null">management_unit = #{managementUnit},</if>
|
||||||
|
<if test="caretaker != null">caretaker = #{caretaker},</if>
|
||||||
|
<if test="tel != null">tel = #{tel},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where device_id = #{deviceId}
|
where device_id = #{deviceId}
|
||||||
</update>
|
</update>
|
||||||
@ -665,6 +691,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="summary != null">summary = #{summary},</if>
|
<if test="summary != null">summary = #{summary},</if>
|
||||||
<if test="gwDevCode != null">gw_dev_code = #{gwDevCode},</if>
|
<if test="gwDevCode != null">gw_dev_code = #{gwDevCode},</if>
|
||||||
<if test="devParams != null">dev_params = #{devParams},</if>
|
<if test="devParams != null">dev_params = #{devParams},</if>
|
||||||
|
<if test="managementUnit != null">management_unit = #{managementUnit},</if>
|
||||||
|
<if test="caretaker != null">caretaker = #{caretaker},</if>
|
||||||
|
<if test="tel != null">tel = #{tel},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where serial_number = #{serialNumber}
|
where serial_number = #{serialNumber}
|
||||||
</update>
|
</update>
|
||||||
@ -812,6 +841,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="listTerminalUser" parameterType="com.fastbee.iot.domain.Device" resultMap="DeviceShortResult">
|
<select id="listTerminalUser" parameterType="com.fastbee.iot.domain.Device" resultMap="DeviceShortResult">
|
||||||
select d.device_id, d.device_name, d.product_id, d.product_name,p.device_type,
|
select d.device_id, d.device_name, d.product_id, d.product_name,p.device_type,
|
||||||
d.tenant_id, d.tenant_name, d.serial_number,d.gw_dev_code,
|
d.tenant_id, d.tenant_name, d.serial_number,d.gw_dev_code,
|
||||||
|
d.management_unit, d.caretaker, d.tel,
|
||||||
d.firmware_version, d.status,d.rssi,d.is_shadow,d.is_simulate ,d.location_way,
|
d.firmware_version, d.status,d.rssi,d.is_shadow,d.is_simulate ,d.location_way,
|
||||||
d.things_model_value, d.active_time,d.create_time,d.img_url,d.dev_params,
|
d.things_model_value, d.active_time,d.create_time,d.img_url,d.dev_params,
|
||||||
(select count(*) from iot_device d1 where d1.gw_dev_code = d.serial_number) as sub_device_count,
|
(select count(*) from iot_device d1 where d1.gw_dev_code = d.serial_number) as sub_device_count,
|
||||||
@ -879,7 +909,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="listTerminalUserByGroup" resultType="com.fastbee.iot.domain.Device">
|
<select id="listTerminalUserByGroup" resultType="com.fastbee.iot.domain.Device">
|
||||||
select d.device_id, d.device_name, d.product_name, d.serial_number,d.gw_dev_code, d.firmware_version, d.status,d.rssi,d.is_shadow ,
|
select d.device_id, d.device_name, d.product_name, d.serial_number,d.gw_dev_code,
|
||||||
|
d.management_unit, d.caretaker, d.tel,d.firmware_version, d.status,d.rssi,d.is_shadow ,
|
||||||
d.location_way, d.active_time,d.dev_params,d.network_address,d.longitude,d.latitude
|
d.location_way, d.active_time,d.dev_params,d.network_address,d.longitude,d.latitude
|
||||||
from (
|
from (
|
||||||
select device_id, 1 AS is_owner
|
select device_id, 1 AS is_owner
|
||||||
|
Loading…
x
Reference in New Issue
Block a user