Browse Source

楼宇增加别名

jwy
review512jwy@163.com 2 days ago
parent
commit
4d9c512274
  1. 3
      data-center-business-controller/src/main/resources/db/migration/V114__building_alias.sql
  2. 27
      data-center-business-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml
  3. 27
      data-center-business-dao/src/main/resources/mappers/auto/F10JournalLogMapper.xml
  4. 1
      data-center-business-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml
  5. 3
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/building/OptBuildingParams.java
  6. 34
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuilding.java
  7. 70
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuildingExample.java
  8. 34
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/F10JournalLog.java
  9. 60
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/F10JournalLogExample.java
  10. 3
      data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/building/BuildingPageVO.java
  11. 6
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/BuildingServiceImpl.java

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

@ -0,0 +1,3 @@
ALTER TABLE `basic_building` add `alias` varchar(255) DEFAULT NULL COMMENT '别名';
update basic_building set alias = name;

27
data-center-business-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml

@ -28,6 +28,7 @@
<result column="king_contract_no" jdbcType="VARCHAR" property="kingContractNo" />
<result column="kvm_url" jdbcType="VARCHAR" property="kvmUrl" />
<result column="camera_enabled" jdbcType="INTEGER" property="cameraEnabled" />
<result column="alias" jdbcType="VARCHAR" property="alias" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.techsor.datacenter.business.model.BasicBuilding">
<!--
@ -112,7 +113,7 @@
building_id, company_id, `name`, address, flag, create_time, creator_id, modify_time,
modifier_id, udf_building_id, building_bucket, thumbnail_num, show_switch_2d3d, brief_introduction,
latitude, longitude, retain_alert, salesforce_primary_id, site_manager, king_contract_no,
kvm_url, camera_enabled
kvm_url, camera_enabled, `alias`
</sql>
<sql id="Blob_Column_List">
<!--
@ -206,7 +207,7 @@
brief_introduction, latitude, longitude,
retain_alert, salesforce_primary_id, site_manager,
king_contract_no, kvm_url, camera_enabled,
floor_info_list, picture_introduction,
`alias`, floor_info_list, picture_introduction,
special_notes)
values (#{companyId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{flag,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT},
@ -215,7 +216,7 @@
#{briefIntroduction,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
#{retainAlert,jdbcType=INTEGER}, #{salesforcePrimaryId,jdbcType=BIGINT}, #{siteManager,jdbcType=VARCHAR},
#{kingContractNo,jdbcType=VARCHAR}, #{kvmUrl,jdbcType=VARCHAR}, #{cameraEnabled,jdbcType=INTEGER},
#{floorInfoList,jdbcType=LONGVARCHAR}, #{pictureIntroduction,jdbcType=LONGVARCHAR},
#{alias,jdbcType=VARCHAR}, #{floorInfoList,jdbcType=LONGVARCHAR}, #{pictureIntroduction,jdbcType=LONGVARCHAR},
#{specialNotes,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.BasicBuilding">
@ -291,6 +292,9 @@
<if test="cameraEnabled != null">
camera_enabled,
</if>
<if test="alias != null">
`alias`,
</if>
<if test="floorInfoList != null">
floor_info_list,
</if>
@ -365,6 +369,9 @@
<if test="cameraEnabled != null">
#{cameraEnabled,jdbcType=INTEGER},
</if>
<if test="alias != null">
#{alias,jdbcType=VARCHAR},
</if>
<if test="floorInfoList != null">
#{floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -459,6 +466,9 @@
<if test="record.cameraEnabled != null">
camera_enabled = #{record.cameraEnabled,jdbcType=INTEGER},
</if>
<if test="record.alias != null">
`alias` = #{record.alias,jdbcType=VARCHAR},
</if>
<if test="record.floorInfoList != null">
floor_info_list = #{record.floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -501,6 +511,7 @@
king_contract_no = #{record.kingContractNo,jdbcType=VARCHAR},
kvm_url = #{record.kvmUrl,jdbcType=VARCHAR},
camera_enabled = #{record.cameraEnabled,jdbcType=INTEGER},
`alias` = #{record.alias,jdbcType=VARCHAR},
floor_info_list = #{record.floorInfoList,jdbcType=LONGVARCHAR},
picture_introduction = #{record.pictureIntroduction,jdbcType=LONGVARCHAR},
special_notes = #{record.specialNotes,jdbcType=LONGVARCHAR}
@ -535,7 +546,8 @@
site_manager = #{record.siteManager,jdbcType=VARCHAR},
king_contract_no = #{record.kingContractNo,jdbcType=VARCHAR},
kvm_url = #{record.kvmUrl,jdbcType=VARCHAR},
camera_enabled = #{record.cameraEnabled,jdbcType=INTEGER}
camera_enabled = #{record.cameraEnabled,jdbcType=INTEGER},
`alias` = #{record.alias,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -610,6 +622,9 @@
<if test="cameraEnabled != null">
camera_enabled = #{cameraEnabled,jdbcType=INTEGER},
</if>
<if test="alias != null">
`alias` = #{alias,jdbcType=VARCHAR},
</if>
<if test="floorInfoList != null">
floor_info_list = #{floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -649,6 +664,7 @@
king_contract_no = #{kingContractNo,jdbcType=VARCHAR},
kvm_url = #{kvmUrl,jdbcType=VARCHAR},
camera_enabled = #{cameraEnabled,jdbcType=INTEGER},
`alias` = #{alias,jdbcType=VARCHAR},
floor_info_list = #{floorInfoList,jdbcType=LONGVARCHAR},
picture_introduction = #{pictureIntroduction,jdbcType=LONGVARCHAR},
special_notes = #{specialNotes,jdbcType=LONGVARCHAR}
@ -680,7 +696,8 @@
site_manager = #{siteManager,jdbcType=VARCHAR},
king_contract_no = #{kingContractNo,jdbcType=VARCHAR},
kvm_url = #{kvmUrl,jdbcType=VARCHAR},
camera_enabled = #{cameraEnabled,jdbcType=INTEGER}
camera_enabled = #{cameraEnabled,jdbcType=INTEGER},
`alias` = #{alias,jdbcType=VARCHAR}
where building_id = #{buildingId,jdbcType=BIGINT}
</update>
</mapper>

27
data-center-business-dao/src/main/resources/mappers/auto/F10JournalLogMapper.xml

@ -49,6 +49,7 @@
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
<result column="receive_timestamp" jdbcType="BIGINT" property="receiveTimestamp" />
<result column="send_timestamp" jdbcType="BIGINT" property="sendTimestamp" />
<result column="expired_flag" jdbcType="INTEGER" property="expiredFlag" />
<result column="alert_history_id" jdbcType="BIGINT" property="alertHistoryId" />
</resultMap>
@ -137,7 +138,7 @@
phone, remark, display_color, error_reason, line_type, area_name, send_date, send_time,
customer_no, display_data1, display_data2, instruction_flag, signal_code, card_no,
card_type, mansion_building, mansion_room, option_field, created_at, created_time,
receive_timestamp, expired_flag, alert_history_id
receive_timestamp, send_timestamp, expired_flag, alert_history_id
</sql>
<sql id="Blob_Column_List">
<!--
@ -238,8 +239,8 @@
signal_code, card_no, card_type,
mansion_building, mansion_room, option_field,
created_at, created_time, receive_timestamp,
expired_flag, alert_history_id, raw_hex,
raw_text)
send_timestamp, expired_flag, alert_history_id,
raw_hex, raw_text)
values (#{deviceId,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT}, #{serialNo,jdbcType=VARCHAR},
#{mode,jdbcType=VARCHAR}, #{signalSeq,jdbcType=VARCHAR}, #{receiveDate,jdbcType=VARCHAR},
#{receiveTime,jdbcType=VARCHAR}, #{channelNo,jdbcType=VARCHAR}, #{testFlag,jdbcType=VARCHAR},
@ -254,8 +255,8 @@
#{signalCode,jdbcType=VARCHAR}, #{cardNo,jdbcType=VARCHAR}, #{cardType,jdbcType=VARCHAR},
#{mansionBuilding,jdbcType=VARCHAR}, #{mansionRoom,jdbcType=VARCHAR}, #{optionField,jdbcType=VARCHAR},
#{createdAt,jdbcType=BIGINT}, #{createdTime,jdbcType=TIMESTAMP}, #{receiveTimestamp,jdbcType=BIGINT},
#{expiredFlag,jdbcType=INTEGER}, #{alertHistoryId,jdbcType=BIGINT}, #{rawHex,jdbcType=LONGVARCHAR},
#{rawText,jdbcType=LONGVARCHAR})
#{sendTimestamp,jdbcType=BIGINT}, #{expiredFlag,jdbcType=INTEGER}, #{alertHistoryId,jdbcType=BIGINT},
#{rawHex,jdbcType=LONGVARCHAR}, #{rawText,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.F10JournalLog">
<!--
@ -393,6 +394,9 @@
<if test="receiveTimestamp != null">
receive_timestamp,
</if>
<if test="sendTimestamp != null">
send_timestamp,
</if>
<if test="expiredFlag != null">
expired_flag,
</if>
@ -533,6 +537,9 @@
<if test="receiveTimestamp != null">
#{receiveTimestamp,jdbcType=BIGINT},
</if>
<if test="sendTimestamp != null">
#{sendTimestamp,jdbcType=BIGINT},
</if>
<if test="expiredFlag != null">
#{expiredFlag,jdbcType=INTEGER},
</if>
@ -693,6 +700,9 @@
<if test="record.receiveTimestamp != null">
receive_timestamp = #{record.receiveTimestamp,jdbcType=BIGINT},
</if>
<if test="record.sendTimestamp != null">
send_timestamp = #{record.sendTimestamp,jdbcType=BIGINT},
</if>
<if test="record.expiredFlag != null">
expired_flag = #{record.expiredFlag,jdbcType=INTEGER},
</if>
@ -759,6 +769,7 @@
created_at = #{record.createdAt,jdbcType=BIGINT},
created_time = #{record.createdTime,jdbcType=TIMESTAMP},
receive_timestamp = #{record.receiveTimestamp,jdbcType=BIGINT},
send_timestamp = #{record.sendTimestamp,jdbcType=BIGINT},
expired_flag = #{record.expiredFlag,jdbcType=INTEGER},
alert_history_id = #{record.alertHistoryId,jdbcType=BIGINT},
raw_hex = #{record.rawHex,jdbcType=LONGVARCHAR},
@ -816,6 +827,7 @@
created_at = #{record.createdAt,jdbcType=BIGINT},
created_time = #{record.createdTime,jdbcType=TIMESTAMP},
receive_timestamp = #{record.receiveTimestamp,jdbcType=BIGINT},
send_timestamp = #{record.sendTimestamp,jdbcType=BIGINT},
expired_flag = #{record.expiredFlag,jdbcType=INTEGER},
alert_history_id = #{record.alertHistoryId,jdbcType=BIGINT}
<if test="_parameter != null">
@ -955,6 +967,9 @@
<if test="receiveTimestamp != null">
receive_timestamp = #{receiveTimestamp,jdbcType=BIGINT},
</if>
<if test="sendTimestamp != null">
send_timestamp = #{sendTimestamp,jdbcType=BIGINT},
</if>
<if test="expiredFlag != null">
expired_flag = #{expiredFlag,jdbcType=INTEGER},
</if>
@ -1018,6 +1033,7 @@
created_at = #{createdAt,jdbcType=BIGINT},
created_time = #{createdTime,jdbcType=TIMESTAMP},
receive_timestamp = #{receiveTimestamp,jdbcType=BIGINT},
send_timestamp = #{sendTimestamp,jdbcType=BIGINT},
expired_flag = #{expiredFlag,jdbcType=INTEGER},
alert_history_id = #{alertHistoryId,jdbcType=BIGINT},
raw_hex = #{rawHex,jdbcType=LONGVARCHAR},
@ -1072,6 +1088,7 @@
created_at = #{createdAt,jdbcType=BIGINT},
created_time = #{createdTime,jdbcType=TIMESTAMP},
receive_timestamp = #{receiveTimestamp,jdbcType=BIGINT},
send_timestamp = #{sendTimestamp,jdbcType=BIGINT},
expired_flag = #{expiredFlag,jdbcType=INTEGER},
alert_history_id = #{alertHistoryId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}

1
data-center-business-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml

@ -35,6 +35,7 @@
bcomp.company_name companyName,
bbuilding.name buildingName,
bbuilding.address,
bbuilding.alias,
bbuilding.udf_building_id udfBuildingId,
bbuilding.building_bucket,
bbuilding.floor_info_list,

3
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/building/OptBuildingParams.java

@ -21,6 +21,9 @@ public class OptBuildingParams{
@Schema(description ="Building name", example = "testBuilding1", required = true)
private String buildingName;
@Schema(description ="Building alias", example = "testalias", required = false)
private String alias;
@Schema(description ="Address", example = "Abiko City, Japan", required = true)
private String address;

34
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuilding.java

@ -201,6 +201,15 @@ public class BasicBuilding implements Serializable {
*/
private Integer cameraEnabled;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_building.alias
*
* @mbg.generated
*/
private String alias;
/**
*
* This field was generated by MyBatis Generator.
@ -764,6 +773,30 @@ public class BasicBuilding implements Serializable {
this.cameraEnabled = cameraEnabled;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_building.alias
*
* @return the value of basic_building.alias
*
* @mbg.generated
*/
public String getAlias() {
return alias;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_building.alias
*
* @param alias the value for basic_building.alias
*
* @mbg.generated
*/
public void setAlias(String alias) {
this.alias = alias == null ? null : alias.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_building.floor_info_list
@ -870,6 +903,7 @@ public class BasicBuilding implements Serializable {
sb.append(", kingContractNo=").append(kingContractNo);
sb.append(", kvmUrl=").append(kvmUrl);
sb.append(", cameraEnabled=").append(cameraEnabled);
sb.append(", alias=").append(alias);
sb.append(", floorInfoList=").append(floorInfoList);
sb.append(", pictureIntroduction=").append(pictureIntroduction);
sb.append(", specialNotes=").append(specialNotes);

70
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuildingExample.java

@ -1613,6 +1613,76 @@ public class BasicBuildingExample {
addCriterion("camera_enabled not between", value1, value2, "cameraEnabled");
return (Criteria) this;
}
public Criteria andAliasIsNull() {
addCriterion("`alias` is null");
return (Criteria) this;
}
public Criteria andAliasIsNotNull() {
addCriterion("`alias` is not null");
return (Criteria) this;
}
public Criteria andAliasEqualTo(String value) {
addCriterion("`alias` =", value, "alias");
return (Criteria) this;
}
public Criteria andAliasNotEqualTo(String value) {
addCriterion("`alias` <>", value, "alias");
return (Criteria) this;
}
public Criteria andAliasGreaterThan(String value) {
addCriterion("`alias` >", value, "alias");
return (Criteria) this;
}
public Criteria andAliasGreaterThanOrEqualTo(String value) {
addCriterion("`alias` >=", value, "alias");
return (Criteria) this;
}
public Criteria andAliasLessThan(String value) {
addCriterion("`alias` <", value, "alias");
return (Criteria) this;
}
public Criteria andAliasLessThanOrEqualTo(String value) {
addCriterion("`alias` <=", value, "alias");
return (Criteria) this;
}
public Criteria andAliasLike(String value) {
addCriterion("`alias` like", value, "alias");
return (Criteria) this;
}
public Criteria andAliasNotLike(String value) {
addCriterion("`alias` not like", value, "alias");
return (Criteria) this;
}
public Criteria andAliasIn(List<String> values) {
addCriterion("`alias` in", values, "alias");
return (Criteria) this;
}
public Criteria andAliasNotIn(List<String> values) {
addCriterion("`alias` not in", values, "alias");
return (Criteria) this;
}
public Criteria andAliasBetween(String value1, String value2) {
addCriterion("`alias` between", value1, value2, "alias");
return (Criteria) this;
}
public Criteria andAliasNotBetween(String value1, String value2) {
addCriterion("`alias` not between", value1, value2, "alias");
return (Criteria) this;
}
}
/**

34
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/F10JournalLog.java

@ -391,6 +391,15 @@ public class F10JournalLog implements Serializable {
*/
private Long receiveTimestamp;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column f10_journal_log.send_timestamp
*
* @mbg.generated
*/
private Long sendTimestamp;
/**
*
* This field was generated by MyBatis Generator.
@ -1467,6 +1476,30 @@ public class F10JournalLog implements Serializable {
this.receiveTimestamp = receiveTimestamp;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column f10_journal_log.send_timestamp
*
* @return the value of f10_journal_log.send_timestamp
*
* @mbg.generated
*/
public Long getSendTimestamp() {
return sendTimestamp;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column f10_journal_log.send_timestamp
*
* @param sendTimestamp the value for f10_journal_log.send_timestamp
*
* @mbg.generated
*/
public void setSendTimestamp(Long sendTimestamp) {
this.sendTimestamp = sendTimestamp;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column f10_journal_log.expired_flag
@ -1618,6 +1651,7 @@ public class F10JournalLog implements Serializable {
sb.append(", createdAt=").append(createdAt);
sb.append(", createdTime=").append(createdTime);
sb.append(", receiveTimestamp=").append(receiveTimestamp);
sb.append(", sendTimestamp=").append(sendTimestamp);
sb.append(", expiredFlag=").append(expiredFlag);
sb.append(", alertHistoryId=").append(alertHistoryId);
sb.append(", rawHex=").append(rawHex);

60
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/F10JournalLogExample.java

@ -3155,6 +3155,66 @@ public class F10JournalLogExample {
return (Criteria) this;
}
public Criteria andSendTimestampIsNull() {
addCriterion("send_timestamp is null");
return (Criteria) this;
}
public Criteria andSendTimestampIsNotNull() {
addCriterion("send_timestamp is not null");
return (Criteria) this;
}
public Criteria andSendTimestampEqualTo(Long value) {
addCriterion("send_timestamp =", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampNotEqualTo(Long value) {
addCriterion("send_timestamp <>", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampGreaterThan(Long value) {
addCriterion("send_timestamp >", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampGreaterThanOrEqualTo(Long value) {
addCriterion("send_timestamp >=", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampLessThan(Long value) {
addCriterion("send_timestamp <", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampLessThanOrEqualTo(Long value) {
addCriterion("send_timestamp <=", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampIn(List<Long> values) {
addCriterion("send_timestamp in", values, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampNotIn(List<Long> values) {
addCriterion("send_timestamp not in", values, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampBetween(Long value1, Long value2) {
addCriterion("send_timestamp between", value1, value2, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampNotBetween(Long value1, Long value2) {
addCriterion("send_timestamp not between", value1, value2, "sendTimestamp");
return (Criteria) this;
}
public Criteria andExpiredFlagIsNull() {
addCriterion("expired_flag is null");
return (Criteria) this;

3
data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/building/BuildingPageVO.java

@ -26,6 +26,9 @@ public class BuildingPageVO{
@Schema(description = "Building name", example = "testBuilding1", required = true)
private String buildingName;
@Schema(description ="Building alias", example = "testalias", required = false)
private String alias;
@Schema(description = "Address", example = "日本我孙子市", required = true)
private String address;

6
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/BuildingServiceImpl.java

@ -138,6 +138,9 @@ public class BuildingServiceImpl implements BuildingService {
if (CollectionUtils.isNotEmpty(optBuildingParams.getFloorInfoList())) {
basicBuilding.setFloorInfoList(JSON.toJSONString(optBuildingParams.getFloorInfoList()));;
}
if (StringUtils.isBlank(optBuildingParams.getAlias())) {
basicBuilding.setAlias(optBuildingParams.getBuildingName());
}
String storageS3PathImage = Constants.S3_PDF_IAMGE_PATH + optBuildingParams.getUdfBuildingId()+ "/images/";
if (pictureIntroduction != null && !pictureIntroduction.isEmpty()) {
@ -311,6 +314,9 @@ public class BuildingServiceImpl implements BuildingService {
if (StringUtils.isBlank(optBuildingParams.getKvmUrl())) {
basicBuilding.setKvmUrl("");
}
if (StringUtils.isBlank(optBuildingParams.getAlias())) {
basicBuilding.setAlias(optBuildingParams.getBuildingName());
}
BasicBuildingExample example = new BasicBuildingExample();
BasicBuildingExample.Criteria criteria = example.createCriteria();

Loading…
Cancel
Save