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

添加海康门禁设备管理

parent 25db61b2
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<Field label="设备名称" prop="deviceName" v-model="form.deviceName" placeholder="请输入设备名称"/> <Field label="设备名称" prop="deviceName" v-model="form.deviceName" placeholder="请输入设备名称"/>
<Field label="设备编码" prop="deviceCode" v-model="form.deviceCode" placeholder="请输入设备编码"/> <Field label="设备编码" prop="deviceCode" v-model="form.deviceCode" placeholder="请输入设备编码"/>
<Field label="Ip地址" prop="ip" v-model="form.ip" placeholder="请输入Ip地址"/> <Field label="Ip地址" prop="ip" v-model="form.ip" placeholder="请输入Ip地址"/>
<Field label="端口" prop="port" v-model="form.port" placeholder="请输入端口"/>
<Field label="用户名" prop="username" v-model="form.username" placeholder="请输入用户名"/> <Field label="用户名" prop="username" v-model="form.username" placeholder="请输入用户名"/>
<Field label="密码" prop="password" v-model="form.password" placeholder="请输入密码"/> <Field label="密码" prop="password" v-model="form.password" placeholder="请输入密码"/>
...@@ -99,6 +100,7 @@ ...@@ -99,6 +100,7 @@
deviceName : "", deviceName : "",
deviceCode : "", deviceCode : "",
ip : "", ip : "",
port : null,
username : "", username : "",
password : "", password : "",
}; };
......
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
{label: "Ip地址", prop: "ip"}, {label: "Ip地址", prop: "ip"},
{label: "端口", prop: "port",formatter: this.formatter},
{label: "用户名", prop: "username"}, {label: "用户名", prop: "username"},
{label: "密码", prop: "password"}, {label: "密码", prop: "password"},
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
<el-descriptions-item label="Ip地址" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="Ip地址" label-class-name="labelClass" content-class-name="contentClass">
{{form.ip}} {{form.ip}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="端口" label-class-name="labelClass" content-class-name="contentClass">
{{form.port}}
</el-descriptions-item>
<el-descriptions-item label="用户名" label-class-name="labelClass" content-class-name="contentClass"> <el-descriptions-item label="用户名" label-class-name="labelClass" content-class-name="contentClass">
{{form.username}} {{form.username}}
</el-descriptions-item> </el-descriptions-item>
......
...@@ -32,6 +32,10 @@ public class DoorEntity extends DoorVo { ...@@ -32,6 +32,10 @@ public class DoorEntity extends DoorVo {
*/ */
private String ip; private String ip;
/** /**
* 端口
*/
private Integer port;
/**
* 用户名 * 用户名
*/ */
private String username; private String username;
...@@ -59,6 +63,7 @@ public class DoorEntity extends DoorVo { ...@@ -59,6 +63,7 @@ public class DoorEntity extends DoorVo {
this.deviceName = ""; this.deviceName = "";
this.deviceCode = ""; this.deviceCode = "";
this.ip = ""; this.ip = "";
this.port = 0;
this.username = ""; this.username = "";
this.password = ""; this.password = "";
} }
......
...@@ -39,6 +39,21 @@ public class DoorQuery extends DoorEntity { ...@@ -39,6 +39,21 @@ public class DoorQuery extends DoorEntity {
/** Ip地址排除列表 */ /** Ip地址排除列表 */
private List <String> ipNotList; private List <String> ipNotList;
/** 开始 端口 */
private Integer portStart;
/** 结束 端口 */
private Integer portEnd;
/** 增加 端口 */
private Integer portIncrement;
/** 端口列表 */
private List <Integer> portList;
/** 端口排除列表 */
private List <Integer> portNotList;
/** 用户名 */ /** 用户名 */
private List<String> usernameList; private List<String> usernameList;
...@@ -276,6 +291,87 @@ public class DoorQuery extends DoorEntity { ...@@ -276,6 +291,87 @@ public class DoorQuery extends DoorEntity {
this.ipNotList = ipNotList; this.ipNotList = ipNotList;
} }
/**
* 获取 开始 端口
* @return portStart
*/
public Integer getPortStart(){
return this.portStart;
}
/**
* 设置 开始 端口
* @param portStart
*/
public void setPortStart(Integer portStart){
this.portStart = portStart;
}
/**
* 获取 结束 端口
* @return $portEnd
*/
public Integer getPortEnd(){
return this.portEnd;
}
/**
* 设置 结束 端口
* @param portEnd
*/
public void setPortEnd(Integer portEnd){
this.portEnd = portEnd;
}
/**
* 获取 增加 端口
* @return portIncrement
*/
public Integer getPortIncrement(){
return this.portIncrement;
}
/**
* 设置 增加 端口
* @param portIncrement
*/
public void setPortIncrement(Integer portIncrement){
this.portIncrement = portIncrement;
}
/**
* 获取 端口
* @return portList
*/
public List<Integer> getPortList(){
return this.portList;
}
/**
* 设置 端口
* @param portList
*/
public void setPortList(List<Integer> portList){
this.portList = portList;
}
/**
* 获取 端口
* @return portNotList
*/
public List<Integer> getPortNotList(){
return this.portNotList;
}
/**
* 设置 端口
* @param portNotList
*/
public void setPortNotList(List<Integer> portNotList){
this.portNotList = portNotList;
}
/** /**
* 获取 用户名 * 获取 用户名
* @return usernameList * @return usernameList
...@@ -677,6 +773,60 @@ public class DoorQuery extends DoorEntity { ...@@ -677,6 +773,60 @@ public class DoorQuery extends DoorEntity {
return this; return this;
} }
/**
* 设置 端口
* @param port
*/
public DoorQuery port(Integer port){
setPort(port);
return this;
}
/**
* 设置 开始 端口
* @param portStart
*/
public DoorQuery portStart(Integer portStart){
this.portStart = portStart;
return this;
}
/**
* 设置 结束 端口
* @param portEnd
*/
public DoorQuery portEnd(Integer portEnd){
this.portEnd = portEnd;
return this;
}
/**
* 设置 增加 端口
* @param portIncrement
*/
public DoorQuery portIncrement(Integer portIncrement){
this.portIncrement = portIncrement;
return this;
}
/**
* 设置 端口
* @param portList
*/
public DoorQuery portList(List<Integer> portList){
this.portList = portList;
return this;
}
/**
* 设置 端口
* @param portNotList
*/
public DoorQuery portNotList(List<Integer> portNotList){
this.portNotList = portNotList;
return this;
}
/** /**
* 设置 用户名 * 设置 用户名
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<result property="deviceName" column="deviceName" /> <result property="deviceName" column="deviceName" />
<result property="deviceCode" column="deviceCode" /> <result property="deviceCode" column="deviceCode" />
<result property="ip" column="ip" /> <result property="ip" column="ip" />
<result property="port" column="port" />
<result property="username" column="username" /> <result property="username" column="username" />
<result property="password" column="password" /> <result property="password" column="password" />
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
...@@ -34,6 +35,9 @@ ...@@ -34,6 +35,9 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ip') or colPickMode == 1 and data.containsKey('ip')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ip') or colPickMode == 1 and data.containsKey('ip')))">
a.ip, a.ip,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('port') or colPickMode == 1 and data.containsKey('port')))">
a.port,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('username') or colPickMode == 1 and data.containsKey('username')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('username') or colPickMode == 1 and data.containsKey('username')))">
a.username, a.username,
</if> </if>
...@@ -57,18 +61,18 @@ ...@@ -57,18 +61,18 @@
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DoorEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="DoorEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_door insert into mortals_xhx_door
(deviceName,deviceCode,ip,username,password,createTime,createUserId,updateUserId,updateTime) (deviceName,deviceCode,ip,port,username,password,createTime,createUserId,updateUserId,updateTime)
VALUES VALUES
(#{deviceName},#{deviceCode},#{ip},#{username},#{password},#{createTime},#{createUserId},#{updateUserId},#{updateTime}) (#{deviceName},#{deviceCode},#{ip},#{port},#{username},#{password},#{createTime},#{createUserId},#{updateUserId},#{updateTime})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_door insert into mortals_xhx_door
(deviceName,deviceCode,ip,username,password,createTime,createUserId,updateUserId,updateTime) (deviceName,deviceCode,ip,port,username,password,createTime,createUserId,updateUserId,updateTime)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.deviceName},#{item.deviceCode},#{item.ip},#{item.username},#{item.password},#{item.createTime},#{item.createUserId},#{item.updateUserId},#{item.updateTime}) (#{item.deviceName},#{item.deviceCode},#{item.ip},#{item.port},#{item.username},#{item.password},#{item.createTime},#{item.createUserId},#{item.updateUserId},#{item.updateTime})
</foreach> </foreach>
</insert> </insert>
...@@ -87,6 +91,12 @@ ...@@ -87,6 +91,12 @@
<if test="(colPickMode==0 and data.containsKey('ip')) or (colPickMode==1 and !data.containsKey('ip'))"> <if test="(colPickMode==0 and data.containsKey('ip')) or (colPickMode==1 and !data.containsKey('ip'))">
a.ip=#{data.ip}, a.ip=#{data.ip},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('port')) or (colPickMode==1 and !data.containsKey('port'))">
a.port=#{data.port},
</if>
<if test="(colPickMode==0 and data.containsKey('portIncrement')) or (colPickMode==1 and !data.containsKey('portIncrement'))">
a.port=ifnull(a.port,0) + #{data.portIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('username')) or (colPickMode==1 and !data.containsKey('username'))"> <if test="(colPickMode==0 and data.containsKey('username')) or (colPickMode==1 and !data.containsKey('username'))">
a.username=#{data.username}, a.username=#{data.username},
</if> </if>
...@@ -144,6 +154,18 @@ ...@@ -144,6 +154,18 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="port=(case" suffix="ELSE port end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('port')) or (colPickMode==1 and !item.containsKey('port'))">
when a.id=#{item.id} then #{item.port}
</when>
<when test="(colPickMode==0 and item.containsKey('portIncrement')) or (colPickMode==1 and !item.containsKey('portIncrement'))">
when a.id=#{item.id} then ifnull(a.port,0) + #{item.portIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="username=(case" suffix="ELSE username end),"> <trim prefix="username=(case" suffix="ELSE username end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('username')) or (colPickMode==1 and !item.containsKey('username'))"> <if test="(colPickMode==0 and item.containsKey('username')) or (colPickMode==1 and !item.containsKey('username'))">
...@@ -402,6 +424,33 @@ ...@@ -402,6 +424,33 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('port')">
<if test="conditionParamRef.port != null ">
${_conditionType_} a.port = #{${_conditionParam_}.port}
</if>
<if test="conditionParamRef.port == null">
${_conditionType_} a.port is null
</if>
</if>
<if test="conditionParamRef.containsKey('portList') and conditionParamRef.portList.size() > 0">
${_conditionType_} a.port in
<foreach collection="conditionParamRef.portList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('portNotList') and conditionParamRef.portNotList.size() > 0">
${_conditionType_} a.port not in
<foreach collection="conditionParamRef.portNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('portStart') and conditionParamRef.portStart != null">
${_conditionType_} a.port <![CDATA[ >= ]]> #{${_conditionParam_}.portStart}
</if>
<if test="conditionParamRef.containsKey('portEnd') and conditionParamRef.portEnd != null">
${_conditionType_} a.port <![CDATA[ <= ]]> #{${_conditionParam_}.portEnd}
</if>
<if test="conditionParamRef.containsKey('username')"> <if test="conditionParamRef.containsKey('username')">
<if test="conditionParamRef.username != null and conditionParamRef.username != ''"> <if test="conditionParamRef.username != null and conditionParamRef.username != ''">
...@@ -539,6 +588,13 @@ ...@@ -539,6 +588,13 @@
</foreach> </foreach>
, ,
</if> </if>
<if test="conditionParamRef.containsKey('portList') and conditionParamRef.portList.size() > 0">
field(a.port,
<foreach collection="conditionParamRef.portList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0"> <if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId, field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
...@@ -568,6 +624,13 @@ ...@@ -568,6 +624,13 @@
</foreach> </foreach>
, ,
</if> </if>
<if test="conditionParamRef.containsKey('portList') and conditionParamRef.portList.size() > 0">
field(a.port,
<foreach collection="conditionParamRef.portList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0"> <if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId, field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
...@@ -603,6 +666,11 @@ ...@@ -603,6 +666,11 @@
<if test='orderCol.ip != null and "DESC".equalsIgnoreCase(orderCol.ip)'>DESC</if> <if test='orderCol.ip != null and "DESC".equalsIgnoreCase(orderCol.ip)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('port')">
a.port
<if test='orderCol.port != null and "DESC".equalsIgnoreCase(orderCol.port)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('username')"> <if test="orderCol.containsKey('username')">
a.username a.username
<if test='orderCol.username != null and "DESC".equalsIgnoreCase(orderCol.username)'>DESC</if> <if test='orderCol.username != null and "DESC".equalsIgnoreCase(orderCol.username)'>DESC</if>
......
...@@ -18,7 +18,7 @@ POST {{baseUrl}}/door/list ...@@ -18,7 +18,7 @@ POST {{baseUrl}}/door/list
Content-Type: application/json Content-Type: application/json
{ {
"deviceCode":"9ci6cz", "deviceCode":"nqwde8",
"page":1, "page":1,
"size":10 "size":10
} }
...@@ -30,11 +30,12 @@ Authorization: {{authToken}} ...@@ -30,11 +30,12 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"deviceName":"r1vf4o", "deviceName":"4e70lu",
"deviceCode":"a74fjp", "deviceCode":"zbjw2n",
"ip":"nu6vgw", "ip":"g4erpw",
"username":"ufxpy5", "port":282,
"password":"9d2qwd", "username":"7wld4o",
"password":"431xcj",
} }
> {% > {%
......
...@@ -893,6 +893,7 @@ CREATE TABLE mortals_xhx_door( ...@@ -893,6 +893,7 @@ CREATE TABLE mortals_xhx_door(
`deviceName` varchar(64) COMMENT '设备名称', `deviceName` varchar(64) COMMENT '设备名称',
`deviceCode` varchar(64) COMMENT '设备编码', `deviceCode` varchar(64) COMMENT '设备编码',
`ip` varchar(64) COMMENT 'Ip地址', `ip` varchar(64) COMMENT 'Ip地址',
`port` int(9) COMMENT '端口',
`username` varchar(64) COMMENT '用户名', `username` varchar(64) COMMENT '用户名',
`password` varchar(64) COMMENT '密码', `password` varchar(64) COMMENT '密码',
`createTime` datetime COMMENT '创建时间', `createTime` datetime COMMENT '创建时间',
......
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