Browse Source

ap_gateway增加ip和端口

jwy
review512jwy@163.com 1 day ago
parent
commit
72c313d924
  1. 3
      data-center-business-controller/src/main/resources/db/migration/V115__ap_ip_port.sql
  2. 42
      data-center-business-dao/src/main/resources/mappers/auto/ApGatewayMapper.xml
  3. 4
      data-center-business-dao/src/main/resources/mappers/ex/ApGatewayMapperExt.xml
  4. 7
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/apgateway/ApGatewayAddParam.java
  5. 6
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/apgateway/ApGatewayEditParam.java
  6. 68
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/ApGateway.java
  7. 130
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/ApGatewayExample.java
  8. 4
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/ApGatewayServiceImpl.java

3
data-center-business-controller/src/main/resources/db/migration/V115__ap_ip_port.sql

@ -0,0 +1,3 @@
ALTER TABLE `ap_gateway`
ADD `ip` varchar(255) DEFAULT NULL COMMENT 'ip',
ADD `port` int(6) DEFAULT NULL COMMENT '端口';

42
data-center-business-dao/src/main/resources/mappers/auto/ApGatewayMapper.xml

@ -24,6 +24,8 @@
<result column="downlink_id" jdbcType="VARCHAR" property="downlinkId" />
<result column="auth_user_id" jdbcType="VARCHAR" property="authUserId" />
<result column="auth_pwd" jdbcType="VARCHAR" property="authPwd" />
<result column="ip" jdbcType="VARCHAR" property="ip" />
<result column="port" jdbcType="INTEGER" property="port" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
@ -98,7 +100,7 @@
-->
ap_gateway_id, model, imei, mac, create_ts, update_ts, address, gps, latest_heartbeat_ts,
online_status, battery, flag, company_id, offline_interval, ack_flag, downlink_id,
auth_user_id, auth_pwd
auth_user_id, auth_pwd, ip, port
</sql>
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.ApGatewayExample" resultMap="BaseResultMap">
<!--
@ -160,13 +162,15 @@
gps, latest_heartbeat_ts, online_status,
battery, flag, company_id,
offline_interval, ack_flag, downlink_id,
auth_user_id, auth_pwd)
auth_user_id, auth_pwd, ip,
port)
values (#{model,jdbcType=VARCHAR}, #{imei,jdbcType=VARCHAR}, #{mac,jdbcType=VARCHAR},
#{createTs,jdbcType=BIGINT}, #{updateTs,jdbcType=BIGINT}, #{address,jdbcType=VARCHAR},
#{gps,jdbcType=VARCHAR}, #{latestHeartbeatTs,jdbcType=BIGINT}, #{onlineStatus,jdbcType=INTEGER},
#{battery,jdbcType=DECIMAL}, #{flag,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT},
#{offlineInterval,jdbcType=INTEGER}, #{ackFlag,jdbcType=INTEGER}, #{downlinkId,jdbcType=VARCHAR},
#{authUserId,jdbcType=VARCHAR}, #{authPwd,jdbcType=VARCHAR})
#{authUserId,jdbcType=VARCHAR}, #{authPwd,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR},
#{port,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.ApGateway">
<!--
@ -229,6 +233,12 @@
<if test="authPwd != null">
auth_pwd,
</if>
<if test="ip != null">
ip,
</if>
<if test="port != null">
port,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="model != null">
@ -282,6 +292,12 @@
<if test="authPwd != null">
#{authPwd,jdbcType=VARCHAR},
</if>
<if test="ip != null">
#{ip,jdbcType=VARCHAR},
</if>
<if test="port != null">
#{port,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.ApGatewayExample" resultType="java.lang.Long">
@ -355,6 +371,12 @@
<if test="record.authPwd != null">
auth_pwd = #{record.authPwd,jdbcType=VARCHAR},
</if>
<if test="record.ip != null">
ip = #{record.ip,jdbcType=VARCHAR},
</if>
<if test="record.port != null">
port = #{record.port,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -383,7 +405,9 @@
ack_flag = #{record.ackFlag,jdbcType=INTEGER},
downlink_id = #{record.downlinkId,jdbcType=VARCHAR},
auth_user_id = #{record.authUserId,jdbcType=VARCHAR},
auth_pwd = #{record.authPwd,jdbcType=VARCHAR}
auth_pwd = #{record.authPwd,jdbcType=VARCHAR},
ip = #{record.ip,jdbcType=VARCHAR},
port = #{record.port,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -446,6 +470,12 @@
<if test="authPwd != null">
auth_pwd = #{authPwd,jdbcType=VARCHAR},
</if>
<if test="ip != null">
ip = #{ip,jdbcType=VARCHAR},
</if>
<if test="port != null">
port = #{port,jdbcType=INTEGER},
</if>
</set>
where ap_gateway_id = #{apGatewayId,jdbcType=BIGINT}
</update>
@ -471,7 +501,9 @@
ack_flag = #{ackFlag,jdbcType=INTEGER},
downlink_id = #{downlinkId,jdbcType=VARCHAR},
auth_user_id = #{authUserId,jdbcType=VARCHAR},
auth_pwd = #{authPwd,jdbcType=VARCHAR}
auth_pwd = #{authPwd,jdbcType=VARCHAR},
ip = #{ip,jdbcType=VARCHAR},
port = #{port,jdbcType=INTEGER}
where ap_gateway_id = #{apGatewayId,jdbcType=BIGINT}
</update>
</mapper>

4
data-center-business-dao/src/main/resources/mappers/ex/ApGatewayMapperExt.xml

@ -20,7 +20,9 @@
ack_flag as ackFlag,
flag as flag,
auth_user_id,
auth_pwd
auth_pwd,
ip,
port
from
ap_gateway
<where>

7
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/apgateway/ApGatewayAddParam.java

@ -38,6 +38,13 @@ public class ApGatewayAddParam {
private String authUserId;
@Schema(description ="auth password", example = "csdj")
private String authPwd;
@Schema(description ="ip", example = "124.7.8.99")
private String ip;
@Schema(description ="port", example = "111")
private Integer port;
// @Schema(description ="flag", example = "111")
// private Integer flag;
// @Schema(description ="online_status", example = "111")

6
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/apgateway/ApGatewayEditParam.java

@ -40,4 +40,10 @@ public class ApGatewayEditParam {
private String authUserId;
@Schema(description ="authUserId", example = "csdj")
private String authPwd;
@Schema(description ="ip", example = "124.7.8.99")
private String ip;
@Schema(description ="port", example = "111")
private Integer port;
}

68
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/ApGateway.java

@ -166,6 +166,24 @@ public class ApGateway implements Serializable {
*/
private String authPwd;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column ap_gateway.ip
*
* @mbg.generated
*/
private String ip;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column ap_gateway.port
*
* @mbg.generated
*/
private Integer port;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ap_gateway
@ -606,6 +624,54 @@ public class ApGateway implements Serializable {
this.authPwd = authPwd == null ? null : authPwd.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column ap_gateway.ip
*
* @return the value of ap_gateway.ip
*
* @mbg.generated
*/
public String getIp() {
return ip;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column ap_gateway.ip
*
* @param ip the value for ap_gateway.ip
*
* @mbg.generated
*/
public void setIp(String ip) {
this.ip = ip == null ? null : ip.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column ap_gateway.port
*
* @return the value of ap_gateway.port
*
* @mbg.generated
*/
public Integer getPort() {
return port;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column ap_gateway.port
*
* @param port the value for ap_gateway.port
*
* @mbg.generated
*/
public void setPort(Integer port) {
this.port = port;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ap_gateway
@ -636,6 +702,8 @@ public class ApGateway implements Serializable {
sb.append(", downlinkId=").append(downlinkId);
sb.append(", authUserId=").append(authUserId);
sb.append(", authPwd=").append(authPwd);
sb.append(", ip=").append(ip);
sb.append(", port=").append(port);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

130
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/ApGatewayExample.java

@ -1354,6 +1354,136 @@ public class ApGatewayExample {
addCriterion("auth_pwd not between", value1, value2, "authPwd");
return (Criteria) this;
}
public Criteria andIpIsNull() {
addCriterion("ip is null");
return (Criteria) this;
}
public Criteria andIpIsNotNull() {
addCriterion("ip is not null");
return (Criteria) this;
}
public Criteria andIpEqualTo(String value) {
addCriterion("ip =", value, "ip");
return (Criteria) this;
}
public Criteria andIpNotEqualTo(String value) {
addCriterion("ip <>", value, "ip");
return (Criteria) this;
}
public Criteria andIpGreaterThan(String value) {
addCriterion("ip >", value, "ip");
return (Criteria) this;
}
public Criteria andIpGreaterThanOrEqualTo(String value) {
addCriterion("ip >=", value, "ip");
return (Criteria) this;
}
public Criteria andIpLessThan(String value) {
addCriterion("ip <", value, "ip");
return (Criteria) this;
}
public Criteria andIpLessThanOrEqualTo(String value) {
addCriterion("ip <=", value, "ip");
return (Criteria) this;
}
public Criteria andIpLike(String value) {
addCriterion("ip like", value, "ip");
return (Criteria) this;
}
public Criteria andIpNotLike(String value) {
addCriterion("ip not like", value, "ip");
return (Criteria) this;
}
public Criteria andIpIn(List<String> values) {
addCriterion("ip in", values, "ip");
return (Criteria) this;
}
public Criteria andIpNotIn(List<String> values) {
addCriterion("ip not in", values, "ip");
return (Criteria) this;
}
public Criteria andIpBetween(String value1, String value2) {
addCriterion("ip between", value1, value2, "ip");
return (Criteria) this;
}
public Criteria andIpNotBetween(String value1, String value2) {
addCriterion("ip not between", value1, value2, "ip");
return (Criteria) this;
}
public Criteria andPortIsNull() {
addCriterion("port is null");
return (Criteria) this;
}
public Criteria andPortIsNotNull() {
addCriterion("port is not null");
return (Criteria) this;
}
public Criteria andPortEqualTo(Integer value) {
addCriterion("port =", value, "port");
return (Criteria) this;
}
public Criteria andPortNotEqualTo(Integer value) {
addCriterion("port <>", value, "port");
return (Criteria) this;
}
public Criteria andPortGreaterThan(Integer value) {
addCriterion("port >", value, "port");
return (Criteria) this;
}
public Criteria andPortGreaterThanOrEqualTo(Integer value) {
addCriterion("port >=", value, "port");
return (Criteria) this;
}
public Criteria andPortLessThan(Integer value) {
addCriterion("port <", value, "port");
return (Criteria) this;
}
public Criteria andPortLessThanOrEqualTo(Integer value) {
addCriterion("port <=", value, "port");
return (Criteria) this;
}
public Criteria andPortIn(List<Integer> values) {
addCriterion("port in", values, "port");
return (Criteria) this;
}
public Criteria andPortNotIn(List<Integer> values) {
addCriterion("port not in", values, "port");
return (Criteria) this;
}
public Criteria andPortBetween(Integer value1, Integer value2) {
addCriterion("port between", value1, value2, "port");
return (Criteria) this;
}
public Criteria andPortNotBetween(Integer value1, Integer value2) {
addCriterion("port not between", value1, value2, "port");
return (Criteria) this;
}
}
/**

4
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/ApGatewayServiceImpl.java

@ -114,6 +114,8 @@ public class ApGatewayServiceImpl implements ApGatewayService {
} else {
insertObj.setAuthPwd(param.getAuthPwd());
}
insertObj.setIp(param.getIp());
insertObj.setPort(param.getPort());
this.apGatewayMapperExt.insert(insertObj);
@ -173,6 +175,8 @@ public class ApGatewayServiceImpl implements ApGatewayService {
} else {
insertObj.setAuthPwd(param.getAuthPwd());
}
insertObj.setIp(param.getIp());
insertObj.setPort(param.getPort());
//Verify if the imei is dumplicate
ApGatewayExample dumpCheckExample = new ApGatewayExample();

Loading…
Cancel
Save