Commit d65e3f8c authored by 赵啸非's avatar 赵啸非

修改设备站点名称

parent 39560600
......@@ -79,6 +79,12 @@ export default {
label: '设备编码',
},
{
name: 'siteName',
type: 'text',
label: '站点名称',
},
{
name: 'deviceType',
type: 'select',
......@@ -94,11 +100,13 @@ export default {
{ type: "selection", width: 60 },
// { label: "设备名称", prop: "deviceName" },
{ label: "所属站点", prop: "siteName" },
{ label: "设备编码", prop: "deviceCode" },
{ label: "设备类型", prop: "deviceType", formatter: this.formatter },
{
label: "在线状态 ",
prop: "deviceOnlineStatus",
......
package com.mortals.xhx;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.impl.LocalCacheServiceImpl;
import com.mortals.framework.service.impl.RedisCacheServiceImpl;
import com.mortals.framework.springcloud.boot.BaseWebApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
@SpringBootApplication(scanBasePackages = {"com.mortals"})
......
......@@ -29,6 +29,11 @@ public class DeviceReq implements Serializable {
*/
private String sitenum;
/**
* 站点名称
*/
private String sitename;
/**
* 上传类型
*/
......
......@@ -52,6 +52,7 @@ public class UploadTask implements Runnable {
deviceEntity.setIp(req.getIp());
deviceEntity.setPort(req.getPort());
deviceEntity.setSiteNum(req.getSitenum());
deviceEntity.setSiteName(req.getSitename());
deviceEntity.setCenternum(req.getCenternum());
deviceService.update(deviceEntity);
......@@ -79,11 +80,11 @@ public class UploadTask implements Runnable {
deviceEntity.setDeviceType(req.getType());
deviceEntity.setPort(req.getPort());
deviceEntity.setSiteNum(req.getSitenum());
deviceEntity.setSiteName(req.getSitename());
deviceEntity.setCenternum(req.getCenternum());
deviceEntity.setCreateUserId(1L);
deviceEntity.setCreateTime(new Date());
deviceService.save(deviceEntity);
DeviceLogEntity deviceLogEntity = new DeviceLogEntity();
deviceLogEntity.initAttrValue();
deviceLogEntity.setDeviceId(deviceEntity.getId());
......
......@@ -11,7 +11,7 @@ import com.mortals.xhx.module.device.model.vo.DeviceVo;
* 设备实体对象
*
* @author zxfei
* @date 2022-05-06
* @date 2022-05-18
*/
public class DeviceEntity extends DeviceVo {
......@@ -50,6 +50,10 @@ public class DeviceEntity extends DeviceVo {
* 站点编号
*/
private String siteNum;
/**
* 站点名称
*/
private String siteName;
/**
* 设备生产厂商ID
*/
......@@ -199,6 +203,20 @@ public class DeviceEntity extends DeviceVo {
public void setSiteNum(String siteNum){
this.siteNum = siteNum;
}
/**
* 获取 站点名称
* @return String
*/
public String getSiteName(){
return siteName;
}
/**
* 设置 站点名称
* @param siteName
*/
public void setSiteName(String siteName){
this.siteName = siteName;
}
/**
* 获取 设备生产厂商ID
* @return Long
......@@ -341,6 +359,7 @@ public class DeviceEntity extends DeviceVo {
sb.append(",centernum:").append(getCenternum());
sb.append(",port:").append(getPort());
sb.append(",siteNum:").append(getSiteNum());
sb.append(",siteName:").append(getSiteName());
sb.append(",deviceFirmId:").append(getDeviceFirmId());
sb.append(",deviceFirmname:").append(getDeviceFirmname());
sb.append(",deviceOnlineStatus:").append(getDeviceOnlineStatus());
......@@ -370,6 +389,8 @@ public class DeviceEntity extends DeviceVo {
this.siteNum = "";
this.siteName = "";
this.deviceFirmId = null;
this.deviceFirmname = "";
......
......@@ -14,6 +14,7 @@
<result property="centernum" column="centernum" />
<result property="port" column="port" />
<result property="siteNum" column="siteNum" />
<result property="siteName" column="siteName" />
<result property="deviceFirmId" column="deviceFirmId" />
<result property="deviceFirmname" column="deviceFirmname" />
<result property="deviceOnlineStatus" column="deviceOnlineStatus" />
......@@ -60,6 +61,9 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteNum') or colPickMode == 1 and data.containsKey('siteNum')))">
a.siteNum,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteName') or colPickMode == 1 and data.containsKey('siteName')))">
a.siteName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceFirmId') or colPickMode == 1 and data.containsKey('deviceFirmId')))">
a.deviceFirmId,
</if>
......@@ -101,18 +105,18 @@
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DeviceEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_stp_device
(deviceName,deviceCode,deviceType,deviceMac,ip,centernum,port,siteNum,deviceFirmId,deviceFirmname,deviceOnlineStatus,status,deviceSource,deviceRemark,onlineTime,offlineTime,createUserId,createTime,updateUserId,updateTime)
(deviceName,deviceCode,deviceType,deviceMac,ip,centernum,port,siteNum,siteName,deviceFirmId,deviceFirmname,deviceOnlineStatus,status,deviceSource,deviceRemark,onlineTime,offlineTime,createUserId,createTime,updateUserId,updateTime)
VALUES
(#{deviceName},#{deviceCode},#{deviceType},#{deviceMac},#{ip},#{centernum},#{port},#{siteNum},#{deviceFirmId},#{deviceFirmname},#{deviceOnlineStatus},#{status},#{deviceSource},#{deviceRemark},#{onlineTime},#{offlineTime},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
(#{deviceName},#{deviceCode},#{deviceType},#{deviceMac},#{ip},#{centernum},#{port},#{siteNum},#{siteName},#{deviceFirmId},#{deviceFirmname},#{deviceOnlineStatus},#{status},#{deviceSource},#{deviceRemark},#{onlineTime},#{offlineTime},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_stp_device
(deviceName,deviceCode,deviceType,deviceMac,ip,centernum,port,siteNum,deviceFirmId,deviceFirmname,deviceOnlineStatus,status,deviceSource,deviceRemark,onlineTime,offlineTime,createUserId,createTime,updateUserId,updateTime)
(deviceName,deviceCode,deviceType,deviceMac,ip,centernum,port,siteNum,siteName,deviceFirmId,deviceFirmname,deviceOnlineStatus,status,deviceSource,deviceRemark,onlineTime,offlineTime,createUserId,createTime,updateUserId,updateTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.deviceName},#{item.deviceCode},#{item.deviceType},#{item.deviceMac},#{item.ip},#{item.centernum},#{item.port},#{item.siteNum},#{item.deviceFirmId},#{item.deviceFirmname},#{item.deviceOnlineStatus},#{item.status},#{item.deviceSource},#{item.deviceRemark},#{item.onlineTime},#{item.offlineTime},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
(#{item.deviceName},#{item.deviceCode},#{item.deviceType},#{item.deviceMac},#{item.ip},#{item.centernum},#{item.port},#{item.siteNum},#{item.siteName},#{item.deviceFirmId},#{item.deviceFirmname},#{item.deviceOnlineStatus},#{item.status},#{item.deviceSource},#{item.deviceRemark},#{item.onlineTime},#{item.offlineTime},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
</foreach>
</insert>
......@@ -149,6 +153,9 @@
<if test="(colPickMode==0 and data.containsKey('siteNum')) or (colPickMode==1 and !data.containsKey('siteNum'))">
a.siteNum=#{data.siteNum},
</if>
<if test="(colPickMode==0 and data.containsKey('siteName')) or (colPickMode==1 and !data.containsKey('siteName'))">
a.siteName=#{data.siteName},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceFirmId')) or (colPickMode==1 and !data.containsKey('deviceFirmId'))">
a.deviceFirmId=#{data.deviceFirmId},
</if>
......@@ -276,6 +283,13 @@
</if>
</foreach>
</trim>
<trim prefix="siteName=(case" suffix="ELSE siteName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('siteName')) or (colPickMode==1 and !item.containsKey('siteName'))">
when a.id=#{item.id} then #{item.siteName}
</if>
</foreach>
</trim>
<trim prefix="deviceFirmId=(case" suffix="ELSE deviceFirmId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
......@@ -638,6 +652,21 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteName')">
<if test="conditionParamRef.siteName != null and conditionParamRef.siteName != ''">
${_conditionType_} a.siteName like #{${_conditionParam_}.siteName}
</if>
<if test="conditionParamRef.siteName == null">
${_conditionType_} a.siteName is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteNameList')">
${_conditionType_} a.siteName in
<foreach collection="conditionParamRef.siteNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceFirmId')">
<if test="conditionParamRef.deviceFirmId != null ">
${_conditionType_} a.deviceFirmId = #{${_conditionParam_}.deviceFirmId}
......@@ -912,6 +941,11 @@
<if test='orderCol.siteNum != null and "DESC".equalsIgnoreCase(orderCol.siteNum)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('siteName')">
a.siteName
<if test='orderCol.siteName != null and "DESC".equalsIgnoreCase(orderCol.siteName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceFirmId')">
a.deviceFirmId
<if test='orderCol.deviceFirmId != null and "DESC".equalsIgnoreCase(orderCol.deviceFirmId)'>DESC</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment