Browse Source

dashboard通知管理、设备数据小数位数

zhc
review512jwy@163.com 3 months ago
parent
commit
8f2c8331d0
  1. 2
      data-center-business-controller/src/main/java/com/techsor/datacenter/business/configurator/CrosXssFilter.java
  2. 95
      data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/DashboardNotificationController.java
  3. 3
      data-center-business-controller/src/main/resources/db/migration/V64__getewayclients_update.sql
  4. 2
      data-center-business-controller/src/main/resources/db/migration/V65__device_update.sql
  5. 17
      data-center-business-controller/src/main/resources/db/migration/V66__decimal_places_notice.sql
  6. 7
      data-center-business-controller/src/main/resources/db/migration/V67__dashboard_device_group_class.sql
  7. 120
      data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DashboardNotificationMapper.java
  8. 15
      data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/DashboardNotificationMapperExt.java
  9. 423
      data-center-business-dao/src/main/resources/mappers/auto/DashboardNotificationMapper.xml
  10. 29
      data-center-business-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml
  11. 70
      data-center-business-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml
  12. 42
      data-center-business-dao/src/main/resources/mappers/auto/GatewayClientsMapper.xml
  13. 25
      data-center-business-dao/src/main/resources/mappers/ex/DashboardNotificationMapperExt.xml
  14. 2
      data-center-business-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml
  15. 5
      data-center-business-dao/src/main/resources/mybatis-generator/generatorConfig.xml
  16. 22
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/DashboardNotificationSearchParams.java
  17. 16
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/DeleteDashboardNotificationParams.java
  18. 24
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/OptDashboardNotificationParams.java
  19. 3
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/device/DeviceAddParams.java
  20. 3
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/device/DeviceUpdateParams.java
  21. 370
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DashboardNotification.java
  22. 862
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DashboardNotificationExample.java
  23. 34
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroup.java
  24. 60
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceGroupExample.java
  25. 68
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceInfo.java
  26. 120
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceInfoExample.java
  27. 68
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/GatewayClients.java
  28. 120
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/GatewayClientsExample.java
  29. 31
      data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/dashboardnotification/DashboardNotificationPageVO.java
  30. 3
      data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/device/DeviceVO.java
  31. 24
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/DashboardNotificationService.java
  32. 266
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DashboardNotificationServiceImpl.java

2
data-center-business-controller/src/main/java/com/techsor/datacenter/business/configurator/CrosXssFilter.java

@ -53,7 +53,7 @@ public class CrosXssFilter implements Filter {
String requestUri = httpRequest.getRequestURI();
// 当 URL 不包含 /common/ 时,校验 Referer
// if (!requestUri.contains("/common/") && !requestUri.contains("swagger")) {
if (!requestUri.contains("/swagger")) {
if (!requestUri.contains("/swagger") && !requestUri.contains("/api-docs")) {
String referer = httpRequest.getHeader("Referer");
if (StringUtils.isNotBlank(referer)){
if(!"*".equals(accessControlAllowOrigin)){

95
data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/DashboardNotificationController.java

@ -0,0 +1,95 @@
package com.techsor.datacenter.business.controller;
import com.techsor.datacenter.business.common.exception.BusinessException;
import com.techsor.datacenter.business.common.response.PageInfo;
import com.techsor.datacenter.business.common.response.PageResponse;
import com.techsor.datacenter.business.common.response.ResponseCode;
import com.techsor.datacenter.business.common.response.SimpleDataResponse;
import com.techsor.datacenter.business.configurator.interceptor.AccessRequired;
import com.techsor.datacenter.business.dto.dashboardnotification.DashboardNotificationSearchParams;
import com.techsor.datacenter.business.dto.dashboardnotification.DeleteDashboardNotificationParams;
import com.techsor.datacenter.business.dto.dashboardnotification.OptDashboardNotificationParams;
import com.techsor.datacenter.business.service.DashboardNotificationService;
import com.techsor.datacenter.business.vo.dashboardnotification.DashboardNotificationPageVO;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@AccessRequired
@RequestMapping("/dashboardNotification")
@Tag(name = "dashboard通知管理", description = "Data Provider manage API")
@SuppressWarnings("unchecked")
public class DashboardNotificationController {
private static Logger logger = LoggerFactory.getLogger(DashboardNotificationController.class);
@Autowired
private DashboardNotificationService dashboardNotificationService;
@Operation(summary = "Add dashboard notification")
@RequestMapping(value = "/add", method = RequestMethod.POST)
public SimpleDataResponse add(
@RequestBody OptDashboardNotificationParams optDashboardNotificationParams,
@RequestHeader String LoginName,
@RequestHeader String AccessToken,
@RequestHeader Long UserId,
@RequestHeader(required = false) Long CompanyId,
@RequestHeader Integer LanguageType) {
return dashboardNotificationService.add(optDashboardNotificationParams, UserId, CompanyId, LanguageType);
}
@Operation(summary = "Edit dashboard notification")
@RequestMapping(value = "/edit", method = RequestMethod.POST)
public SimpleDataResponse edit(
@RequestBody OptDashboardNotificationParams optDashboardNotificationParams,
@RequestHeader String LoginName,
@RequestHeader String AccessToken,
@RequestHeader Long UserId,
@RequestHeader(required = false) Long CompanyId,
@RequestHeader Integer LanguageType) {
return dashboardNotificationService.edit(optDashboardNotificationParams, UserId, CompanyId, LanguageType);
}
@Operation(summary = "Delete dashboard notification")
@RequestMapping(value = "/batchDelete", method = RequestMethod.POST)
public SimpleDataResponse batchDelete(
@RequestBody DeleteDashboardNotificationParams deleteParams,
@RequestHeader String LoginName,
@RequestHeader String AccessToken,
@RequestHeader Long UserId,
@RequestHeader(required = false) Long CompanyId,
@RequestHeader Integer LanguageType) {
return dashboardNotificationService.batchDelete(deleteParams, UserId, CompanyId, LanguageType);
}
@Operation(summary = "Get dashboard notification list")
@RequestMapping(value = "/getListPage", method = RequestMethod.GET)
public PageResponse<PageInfo<DashboardNotificationPageVO>> getListPage(
@RequestHeader String LoginName,
@RequestHeader String AccessToken,
@RequestHeader Long UserId,
@RequestHeader(required = false) Long CompanyId,
@RequestHeader Integer LanguageType,
@RequestHeader Integer UTCOffset,
DashboardNotificationSearchParams searchParams) throws BusinessException {
searchParams.setUserId(UserId);
PageResponse<PageInfo<DashboardNotificationPageVO>> response = new PageResponse<>();
try {
response.setData(dashboardNotificationService.getListPage(searchParams, CompanyId, UserId, LanguageType, UTCOffset));
response.setCode(ResponseCode.SUCCESS);
response.setMsg("success");
} catch (Exception e) {
logger.error("Error querying list", e);
response.setCode(ResponseCode.SERVER_ERROR);
response.setMsg("service error");
}
return response;
}
}

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

@ -0,0 +1,3 @@
ALTER TABLE `gateway_clients`
ADD COLUMN `project_id` BIGINT NULL DEFAULT 0 AFTER `alert_switch`,
ADD COLUMN `building_id` BIGINT NULL DEFAULT 0 AFTER `project_id`;

2
data-center-business-controller/src/main/resources/db/migration/V65__device_update.sql

@ -0,0 +1,2 @@
ALTER TABLE `device_info`
ADD COLUMN `gateway_client_id` INT NULL DEFAULT NULL AFTER `asset_id`;

17
data-center-business-controller/src/main/resources/db/migration/V66__decimal_places_notice.sql

@ -0,0 +1,17 @@
ALTER TABLE device_info ADD (
`dashboard_decimal_places` int DEFAULT 2 COMMENT 'dashboard显示小数位数'
);
CREATE TABLE `dashboard_notification` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`company_id` bigint DEFAULT NULL COMMENT '公司ID',
`demand_time` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '要求时间',
`category` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '分类',
`content` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '通知内容',
`flag` int NULL DEFAULT 0,
`created_at` bigint NULL DEFAULT NULL COMMENT '创建时间',
`created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
`updated_at` bigint NULL DEFAULT NULL COMMENT '更新时间',
`updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB COMMENT = '通知表';

7
data-center-business-controller/src/main/resources/db/migration/V67__dashboard_device_group_class.sql

@ -0,0 +1,7 @@
DELETE FROM dashboard_device_group;
ALTER TABLE dashboard_device_group AUTO_INCREMENT = 1;
DELETE FROM dashboard_device_group_relation;
ALTER TABLE dashboard_device_group ADD `class_id` int DEFAULT NULL COMMENT '2-积算、3-计测、4-状态' after building_id;

120
data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DashboardNotificationMapper.java

@ -0,0 +1,120 @@
package com.techsor.datacenter.business.dao.auto;
import com.techsor.datacenter.business.model.DashboardNotification;
import com.techsor.datacenter.business.model.DashboardNotificationExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DashboardNotificationMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
long countByExample(DashboardNotificationExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
int deleteByExample(DashboardNotificationExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
int insert(DashboardNotification record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
int insertSelective(DashboardNotification record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
List<DashboardNotification> selectByExampleWithBLOBs(DashboardNotificationExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
List<DashboardNotification> selectByExample(DashboardNotificationExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
DashboardNotification selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DashboardNotification record, @Param("example") DashboardNotificationExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") DashboardNotification record, @Param("example") DashboardNotificationExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
int updateByExample(@Param("record") DashboardNotification record, @Param("example") DashboardNotificationExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DashboardNotification record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(DashboardNotification record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
int updateByPrimaryKey(DashboardNotification record);
}

15
data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/DashboardNotificationMapperExt.java

@ -0,0 +1,15 @@
package com.techsor.datacenter.business.dao.ex;
import com.techsor.datacenter.business.dao.auto.DashboardNotificationMapper;
import com.techsor.datacenter.business.dto.dashboardnotification.DashboardNotificationSearchParams;
import com.techsor.datacenter.business.dto.dashboardnotification.OptDashboardNotificationParams;
import com.techsor.datacenter.business.vo.dashboardnotification.DashboardNotificationPageVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface DashboardNotificationMapperExt extends DashboardNotificationMapper{
List<DashboardNotificationPageVO> getListPage(DashboardNotificationSearchParams pageSearchParam);
}

423
data-center-business-dao/src/main/resources/mappers/auto/DashboardNotificationMapper.xml

@ -0,0 +1,423 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.techsor.datacenter.business.dao.auto.DashboardNotificationMapper">
<resultMap id="BaseResultMap" type="com.techsor.datacenter.business.model.DashboardNotification">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="company_id" jdbcType="BIGINT" property="companyId" />
<result column="demand_time" jdbcType="VARCHAR" property="demandTime" />
<result column="category" jdbcType="VARCHAR" property="category" />
<result column="flag" jdbcType="INTEGER" property="flag" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.techsor.datacenter.business.model.DashboardNotification">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="content" jdbcType="LONGVARCHAR" property="content" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, company_id, demand_time, category, flag, created_at, created_by, updated_at,
updated_by
</sql>
<sql id="Blob_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.techsor.datacenter.business.model.DashboardNotificationExample" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from dashboard_notification
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.DashboardNotificationExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from dashboard_notification
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from dashboard_notification
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dashboard_notification
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.techsor.datacenter.business.model.DashboardNotificationExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dashboard_notification
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.techsor.datacenter.business.model.DashboardNotification">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into dashboard_notification (company_id, demand_time, category,
flag, created_at, created_by,
updated_at, updated_by, content
)
values (#{companyId,jdbcType=BIGINT}, #{demandTime,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR},
#{flag,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{createdBy,jdbcType=BIGINT},
#{updatedAt,jdbcType=BIGINT}, #{updatedBy,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.DashboardNotification">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into dashboard_notification
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyId != null">
company_id,
</if>
<if test="demandTime != null">
demand_time,
</if>
<if test="category != null">
category,
</if>
<if test="flag != null">
flag,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="companyId != null">
#{companyId,jdbcType=BIGINT},
</if>
<if test="demandTime != null">
#{demandTime,jdbcType=VARCHAR},
</if>
<if test="category != null">
#{category,jdbcType=VARCHAR},
</if>
<if test="flag != null">
#{flag,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=BIGINT},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=BIGINT},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.DashboardNotificationExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from dashboard_notification
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_notification
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=BIGINT},
</if>
<if test="record.demandTime != null">
demand_time = #{record.demandTime,jdbcType=VARCHAR},
</if>
<if test="record.category != null">
category = #{record.category,jdbcType=VARCHAR},
</if>
<if test="record.flag != null">
flag = #{record.flag,jdbcType=INTEGER},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=BIGINT},
</if>
<if test="record.createdBy != null">
created_by = #{record.createdBy,jdbcType=BIGINT},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=BIGINT},
</if>
<if test="record.updatedBy != null">
updated_by = #{record.updatedBy,jdbcType=BIGINT},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_notification
set id = #{record.id,jdbcType=BIGINT},
company_id = #{record.companyId,jdbcType=BIGINT},
demand_time = #{record.demandTime,jdbcType=VARCHAR},
category = #{record.category,jdbcType=VARCHAR},
flag = #{record.flag,jdbcType=INTEGER},
created_at = #{record.createdAt,jdbcType=BIGINT},
created_by = #{record.createdBy,jdbcType=BIGINT},
updated_at = #{record.updatedAt,jdbcType=BIGINT},
updated_by = #{record.updatedBy,jdbcType=BIGINT},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_notification
set id = #{record.id,jdbcType=BIGINT},
company_id = #{record.companyId,jdbcType=BIGINT},
demand_time = #{record.demandTime,jdbcType=VARCHAR},
category = #{record.category,jdbcType=VARCHAR},
flag = #{record.flag,jdbcType=INTEGER},
created_at = #{record.createdAt,jdbcType=BIGINT},
created_by = #{record.createdBy,jdbcType=BIGINT},
updated_at = #{record.updatedAt,jdbcType=BIGINT},
updated_by = #{record.updatedBy,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.techsor.datacenter.business.model.DashboardNotification">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_notification
<set>
<if test="companyId != null">
company_id = #{companyId,jdbcType=BIGINT},
</if>
<if test="demandTime != null">
demand_time = #{demandTime,jdbcType=VARCHAR},
</if>
<if test="category != null">
category = #{category,jdbcType=VARCHAR},
</if>
<if test="flag != null">
flag = #{flag,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=BIGINT},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=BIGINT},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.techsor.datacenter.business.model.DashboardNotification">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_notification
set company_id = #{companyId,jdbcType=BIGINT},
demand_time = #{demandTime,jdbcType=VARCHAR},
category = #{category,jdbcType=VARCHAR},
flag = #{flag,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=BIGINT},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT},
updated_by = #{updatedBy,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.techsor.datacenter.business.model.DashboardNotification">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_notification
set company_id = #{companyId,jdbcType=BIGINT},
demand_time = #{demandTime,jdbcType=VARCHAR},
category = #{category,jdbcType=VARCHAR},
flag = #{flag,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=BIGINT},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

29
data-center-business-dao/src/main/resources/mappers/auto/DeviceGroupMapper.xml

@ -9,6 +9,7 @@
<id column="id" jdbcType="BIGINT" property="id" />
<result column="company_id" jdbcType="BIGINT" property="companyId" />
<result column="building_id" jdbcType="BIGINT" property="buildingId" />
<result column="class_id" jdbcType="INTEGER" property="classId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="flag" jdbcType="INTEGER" property="flag" />
@ -86,7 +87,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, company_id, building_id, `name`, remark, flag, created_by, created_at
id, company_id, building_id, class_id, `name`, remark, flag, created_by, created_at
</sql>
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.DeviceGroupExample" resultMap="BaseResultMap">
<!--
@ -143,12 +144,12 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into dashboard_device_group (company_id, building_id, `name`,
remark, flag, created_by,
created_at)
values (#{companyId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT},
#{createdAt,jdbcType=BIGINT})
insert into dashboard_device_group (company_id, building_id, class_id,
`name`, remark, flag,
created_by, created_at)
values (#{companyId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{classId,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER},
#{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.DeviceGroup">
<!--
@ -166,6 +167,9 @@
<if test="buildingId != null">
building_id,
</if>
<if test="classId != null">
class_id,
</if>
<if test="name != null">
`name`,
</if>
@ -189,6 +193,9 @@
<if test="buildingId != null">
#{buildingId,jdbcType=BIGINT},
</if>
<if test="classId != null">
#{classId,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
@ -232,6 +239,9 @@
<if test="record.buildingId != null">
building_id = #{record.buildingId,jdbcType=BIGINT},
</if>
<if test="record.classId != null">
class_id = #{record.classId,jdbcType=INTEGER},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
@ -261,6 +271,7 @@
set id = #{record.id,jdbcType=BIGINT},
company_id = #{record.companyId,jdbcType=BIGINT},
building_id = #{record.buildingId,jdbcType=BIGINT},
class_id = #{record.classId,jdbcType=INTEGER},
`name` = #{record.name,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
flag = #{record.flag,jdbcType=INTEGER},
@ -283,6 +294,9 @@
<if test="buildingId != null">
building_id = #{buildingId,jdbcType=BIGINT},
</if>
<if test="classId != null">
class_id = #{classId,jdbcType=INTEGER},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
@ -309,6 +323,7 @@
update dashboard_device_group
set company_id = #{companyId,jdbcType=BIGINT},
building_id = #{buildingId,jdbcType=BIGINT},
class_id = #{classId,jdbcType=INTEGER},
`name` = #{name,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
flag = #{flag,jdbcType=INTEGER},

70
data-center-business-dao/src/main/resources/mappers/auto/DeviceInfoMapper.xml

@ -16,6 +16,7 @@
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="building_id" jdbcType="BIGINT" property="buildingId" />
<result column="asset_id" jdbcType="BIGINT" property="assetId" />
<result column="gateway_client_id" jdbcType="INTEGER" property="gatewayClientId" />
<result column="flag" jdbcType="INTEGER" property="flag" />
<result column="company_id" jdbcType="BIGINT" property="companyId" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
@ -31,6 +32,7 @@
<result column="alarm_level" jdbcType="INTEGER" property="alarmLevel" />
<result column="retain_alert" jdbcType="INTEGER" property="retainAlert" />
<result column="unit" jdbcType="VARCHAR" property="unit" />
<result column="dashboard_decimal_places" jdbcType="INTEGER" property="dashboardDecimalPlaces" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.techsor.datacenter.business.model.DeviceInfo">
<!--
@ -111,9 +113,9 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, device_id, device_sn, type_id, wsclient_id, space_id, device_name, remark, building_id,
asset_id, flag, company_id, created_by, created_timestamp, updated_by, updated_timestamp,
project_id, floor_id, monitoring_point_name, monitoring_point_category_id, data_provider_id,
gateway_info_id, alarm_level, retain_alert, unit
asset_id, gateway_client_id, flag, company_id, created_by, created_timestamp, updated_by,
updated_timestamp, project_id, floor_id, monitoring_point_name, monitoring_point_category_id,
data_provider_id, gateway_info_id, alarm_level, retain_alert, unit, dashboard_decimal_places
</sql>
<sql id="Blob_Column_List">
<!--
@ -203,21 +205,23 @@
insert into device_info (device_id, device_sn, type_id,
wsclient_id, space_id, device_name,
remark, building_id, asset_id,
flag, company_id, created_by,
created_timestamp, updated_by, updated_timestamp,
project_id, floor_id, monitoring_point_name,
monitoring_point_category_id, data_provider_id,
gateway_info_id, alarm_level, retain_alert,
unit, data_mapping)
gateway_client_id, flag, company_id,
created_by, created_timestamp, updated_by,
updated_timestamp, project_id, floor_id,
monitoring_point_name, monitoring_point_category_id,
data_provider_id, gateway_info_id, alarm_level,
retain_alert, unit, dashboard_decimal_places,
data_mapping)
values (#{deviceId,jdbcType=VARCHAR}, #{deviceSn,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER},
#{wsclientId,jdbcType=INTEGER}, #{spaceId,jdbcType=BIGINT}, #{deviceName,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{buildingId,jdbcType=BIGINT}, #{assetId,jdbcType=BIGINT},
#{flag,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, #{createdBy,jdbcType=BIGINT},
#{createdTimestamp,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}, #{updatedTimestamp,jdbcType=BIGINT},
#{projectId,jdbcType=BIGINT}, #{floorId,jdbcType=BIGINT}, #{monitoringPointName,jdbcType=VARCHAR},
#{monitoringPointCategoryId,jdbcType=BIGINT}, #{dataProviderId,jdbcType=BIGINT},
#{gatewayInfoId,jdbcType=BIGINT}, #{alarmLevel,jdbcType=INTEGER}, #{retainAlert,jdbcType=INTEGER},
#{unit,jdbcType=VARCHAR}, #{dataMapping,jdbcType=LONGVARCHAR})
#{gatewayClientId,jdbcType=INTEGER}, #{flag,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT},
#{createdBy,jdbcType=BIGINT}, #{createdTimestamp,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT},
#{updatedTimestamp,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{floorId,jdbcType=BIGINT},
#{monitoringPointName,jdbcType=VARCHAR}, #{monitoringPointCategoryId,jdbcType=BIGINT},
#{dataProviderId,jdbcType=BIGINT}, #{gatewayInfoId,jdbcType=BIGINT}, #{alarmLevel,jdbcType=INTEGER},
#{retainAlert,jdbcType=INTEGER}, #{unit,jdbcType=VARCHAR}, #{dashboardDecimalPlaces,jdbcType=INTEGER},
#{dataMapping,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.DeviceInfo">
<!--
@ -256,6 +260,9 @@
<if test="assetId != null">
asset_id,
</if>
<if test="gatewayClientId != null">
gateway_client_id,
</if>
<if test="flag != null">
flag,
</if>
@ -301,6 +308,9 @@
<if test="unit != null">
unit,
</if>
<if test="dashboardDecimalPlaces != null">
dashboard_decimal_places,
</if>
<if test="dataMapping != null">
data_mapping,
</if>
@ -333,6 +343,9 @@
<if test="assetId != null">
#{assetId,jdbcType=BIGINT},
</if>
<if test="gatewayClientId != null">
#{gatewayClientId,jdbcType=INTEGER},
</if>
<if test="flag != null">
#{flag,jdbcType=INTEGER},
</if>
@ -378,6 +391,9 @@
<if test="unit != null">
#{unit,jdbcType=VARCHAR},
</if>
<if test="dashboardDecimalPlaces != null">
#{dashboardDecimalPlaces,jdbcType=INTEGER},
</if>
<if test="dataMapping != null">
#{dataMapping,jdbcType=LONGVARCHAR},
</if>
@ -430,6 +446,9 @@
<if test="record.assetId != null">
asset_id = #{record.assetId,jdbcType=BIGINT},
</if>
<if test="record.gatewayClientId != null">
gateway_client_id = #{record.gatewayClientId,jdbcType=INTEGER},
</if>
<if test="record.flag != null">
flag = #{record.flag,jdbcType=INTEGER},
</if>
@ -475,6 +494,9 @@
<if test="record.unit != null">
unit = #{record.unit,jdbcType=VARCHAR},
</if>
<if test="record.dashboardDecimalPlaces != null">
dashboard_decimal_places = #{record.dashboardDecimalPlaces,jdbcType=INTEGER},
</if>
<if test="record.dataMapping != null">
data_mapping = #{record.dataMapping,jdbcType=LONGVARCHAR},
</if>
@ -499,6 +521,7 @@
remark = #{record.remark,jdbcType=VARCHAR},
building_id = #{record.buildingId,jdbcType=BIGINT},
asset_id = #{record.assetId,jdbcType=BIGINT},
gateway_client_id = #{record.gatewayClientId,jdbcType=INTEGER},
flag = #{record.flag,jdbcType=INTEGER},
company_id = #{record.companyId,jdbcType=BIGINT},
created_by = #{record.createdBy,jdbcType=BIGINT},
@ -514,6 +537,7 @@
alarm_level = #{record.alarmLevel,jdbcType=INTEGER},
retain_alert = #{record.retainAlert,jdbcType=INTEGER},
unit = #{record.unit,jdbcType=VARCHAR},
dashboard_decimal_places = #{record.dashboardDecimalPlaces,jdbcType=INTEGER},
data_mapping = #{record.dataMapping,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -535,6 +559,7 @@
remark = #{record.remark,jdbcType=VARCHAR},
building_id = #{record.buildingId,jdbcType=BIGINT},
asset_id = #{record.assetId,jdbcType=BIGINT},
gateway_client_id = #{record.gatewayClientId,jdbcType=INTEGER},
flag = #{record.flag,jdbcType=INTEGER},
company_id = #{record.companyId,jdbcType=BIGINT},
created_by = #{record.createdBy,jdbcType=BIGINT},
@ -549,7 +574,8 @@
gateway_info_id = #{record.gatewayInfoId,jdbcType=BIGINT},
alarm_level = #{record.alarmLevel,jdbcType=INTEGER},
retain_alert = #{record.retainAlert,jdbcType=INTEGER},
unit = #{record.unit,jdbcType=VARCHAR}
unit = #{record.unit,jdbcType=VARCHAR},
dashboard_decimal_places = #{record.dashboardDecimalPlaces,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -588,6 +614,9 @@
<if test="assetId != null">
asset_id = #{assetId,jdbcType=BIGINT},
</if>
<if test="gatewayClientId != null">
gateway_client_id = #{gatewayClientId,jdbcType=INTEGER},
</if>
<if test="flag != null">
flag = #{flag,jdbcType=INTEGER},
</if>
@ -633,6 +662,9 @@
<if test="unit != null">
unit = #{unit,jdbcType=VARCHAR},
</if>
<if test="dashboardDecimalPlaces != null">
dashboard_decimal_places = #{dashboardDecimalPlaces,jdbcType=INTEGER},
</if>
<if test="dataMapping != null">
data_mapping = #{dataMapping,jdbcType=LONGVARCHAR},
</if>
@ -654,6 +686,7 @@
remark = #{remark,jdbcType=VARCHAR},
building_id = #{buildingId,jdbcType=BIGINT},
asset_id = #{assetId,jdbcType=BIGINT},
gateway_client_id = #{gatewayClientId,jdbcType=INTEGER},
flag = #{flag,jdbcType=INTEGER},
company_id = #{companyId,jdbcType=BIGINT},
created_by = #{createdBy,jdbcType=BIGINT},
@ -669,6 +702,7 @@
alarm_level = #{alarmLevel,jdbcType=INTEGER},
retain_alert = #{retainAlert,jdbcType=INTEGER},
unit = #{unit,jdbcType=VARCHAR},
dashboard_decimal_places = #{dashboardDecimalPlaces,jdbcType=INTEGER},
data_mapping = #{dataMapping,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
@ -687,6 +721,7 @@
remark = #{remark,jdbcType=VARCHAR},
building_id = #{buildingId,jdbcType=BIGINT},
asset_id = #{assetId,jdbcType=BIGINT},
gateway_client_id = #{gatewayClientId,jdbcType=INTEGER},
flag = #{flag,jdbcType=INTEGER},
company_id = #{companyId,jdbcType=BIGINT},
created_by = #{createdBy,jdbcType=BIGINT},
@ -701,7 +736,8 @@
gateway_info_id = #{gatewayInfoId,jdbcType=BIGINT},
alarm_level = #{alarmLevel,jdbcType=INTEGER},
retain_alert = #{retainAlert,jdbcType=INTEGER},
unit = #{unit,jdbcType=VARCHAR}
unit = #{unit,jdbcType=VARCHAR},
dashboard_decimal_places = #{dashboardDecimalPlaces,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

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

@ -19,6 +19,8 @@
<result column="data_amount_threshold_alarm" jdbcType="INTEGER" property="dataAmountThresholdAlarm" />
<result column="data_accumulated_totals" jdbcType="INTEGER" property="dataAccumulatedTotals" />
<result column="alert_switch" jdbcType="INTEGER" property="alertSwitch" />
<result column="project_id" jdbcType="BIGINT" property="projectId" />
<result column="building_id" jdbcType="BIGINT" property="buildingId" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
@ -93,7 +95,7 @@
-->
id, client_id, client_name, address, online_status, last_updata_ts, create_ts, flag,
company_id, data_amount_threshold, data_amount_threshold_alarm, data_accumulated_totals,
alert_switch
alert_switch, project_id, building_id
</sql>
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.GatewayClientsExample" resultMap="BaseResultMap">
<!--
@ -154,12 +156,14 @@
online_status, last_updata_ts, create_ts,
flag, company_id, data_amount_threshold,
data_amount_threshold_alarm, data_accumulated_totals,
alert_switch)
alert_switch, project_id, building_id
)
values (#{clientId,jdbcType=VARCHAR}, #{clientName,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{onlineStatus,jdbcType=INTEGER}, #{lastUpdataTs,jdbcType=BIGINT}, #{createTs,jdbcType=BIGINT},
#{flag,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, #{dataAmountThreshold,jdbcType=INTEGER},
#{dataAmountThresholdAlarm,jdbcType=INTEGER}, #{dataAccumulatedTotals,jdbcType=INTEGER},
#{alertSwitch,jdbcType=INTEGER})
#{alertSwitch,jdbcType=INTEGER}, #{projectId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.GatewayClients">
<!--
@ -207,6 +211,12 @@
<if test="alertSwitch != null">
alert_switch,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="buildingId != null">
building_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null">
@ -245,6 +255,12 @@
<if test="alertSwitch != null">
#{alertSwitch,jdbcType=INTEGER},
</if>
<if test="projectId != null">
#{projectId,jdbcType=BIGINT},
</if>
<if test="buildingId != null">
#{buildingId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.GatewayClientsExample" resultType="java.lang.Long">
@ -303,6 +319,12 @@
<if test="record.alertSwitch != null">
alert_switch = #{record.alertSwitch,jdbcType=INTEGER},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=BIGINT},
</if>
<if test="record.buildingId != null">
building_id = #{record.buildingId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -326,7 +348,9 @@
data_amount_threshold = #{record.dataAmountThreshold,jdbcType=INTEGER},
data_amount_threshold_alarm = #{record.dataAmountThresholdAlarm,jdbcType=INTEGER},
data_accumulated_totals = #{record.dataAccumulatedTotals,jdbcType=INTEGER},
alert_switch = #{record.alertSwitch,jdbcType=INTEGER}
alert_switch = #{record.alertSwitch,jdbcType=INTEGER},
project_id = #{record.projectId,jdbcType=BIGINT},
building_id = #{record.buildingId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -374,6 +398,12 @@
<if test="alertSwitch != null">
alert_switch = #{alertSwitch,jdbcType=INTEGER},
</if>
<if test="projectId != null">
project_id = #{projectId,jdbcType=BIGINT},
</if>
<if test="buildingId != null">
building_id = #{buildingId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
@ -394,7 +424,9 @@
data_amount_threshold = #{dataAmountThreshold,jdbcType=INTEGER},
data_amount_threshold_alarm = #{dataAmountThresholdAlarm,jdbcType=INTEGER},
data_accumulated_totals = #{dataAccumulatedTotals,jdbcType=INTEGER},
alert_switch = #{alertSwitch,jdbcType=INTEGER}
alert_switch = #{alertSwitch,jdbcType=INTEGER},
project_id = #{projectId,jdbcType=BIGINT},
building_id = #{buildingId,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

25
data-center-business-dao/src/main/resources/mappers/ex/DashboardNotificationMapperExt.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.techsor.datacenter.business.dao.ex.DashboardNotificationMapperExt">
<select id="getListPage" resultType="com.techsor.datacenter.business.vo.dashboardnotification.DashboardNotificationPageVO">
SELECT
dn.id dashboardNotificationId,
dn.company_id,
dn.`demand_time`,
dn.category,
dn.content,
dn.created_at
FROM
dashboard_notification dn
WHERE
dn.flag != 1
AND dn.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
<if test="dashboardNotificationIdList != null">
AND dn.id IN <foreach collection="dashboardNotificationIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
</if>
ORDER BY dn.created_at DESC
</select>
</mapper>

2
data-center-business-dao/src/main/resources/mappers/ex/DeviceInfoMapperExt.xml

@ -52,7 +52,7 @@
type.device_category_id,device_info.monitoring_point_name,device_info.monitoring_point_category_id,mpc.name monitoringPointCategoryName,
device_info.data_provider_id, data_provider.name dataProviderName, device_info.retain_alert,
device_info.gateway_info_id, data_provider_gateway_info.name gatewayInfoName, device_info.alarm_level,
device_info.unit,device_info.data_mapping,
device_info.unit,device_info.data_mapping,device_info.dashboard_decimal_places,
dashboard_device_group.id deviceGroupId, dashboard_device_group.name deviceGroupName
from
device_info

5
data-center-business-dao/src/main/resources/mybatis-generator/generatorConfig.xml

@ -283,5 +283,10 @@
<table tableName="dashboard_level_role_user" domainObjectName="DashboardLevelRoleUser" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false" />
</table>
<table tableName="dashboard_notification" domainObjectName="DashboardNotification" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false" />
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
</context>
</generatorConfiguration>

22
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/DashboardNotificationSearchParams.java

@ -0,0 +1,22 @@
package com.techsor.datacenter.business.dto.dashboardnotification;
import com.techsor.datacenter.business.dto.BaseSearchParams;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
/**
* @author Mr.Jiang
* @time 2022年7月21日 下午8:50:31
*/
@Data
public class DashboardNotificationSearchParams extends BaseSearchParams{
@Schema(description = "DashboardNotification IDs, comma-separated", example = "1,47")
private String dashboardNotificationIds;
@Schema(description = "DashboardNotification ID list", hidden = true)
private List<Long> dashboardNotificationIdList;
}

16
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/DeleteDashboardNotificationParams.java

@ -0,0 +1,16 @@
package com.techsor.datacenter.business.dto.dashboardnotification;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @author Mr.Jiang
* @time 2022年7月21日 下午8:50:31
*/
@Data
public class DeleteDashboardNotificationParams{
@Schema(description = "DashboardNotification IDs, separated by commas", example = "2738967,587")
private String dashboardNotificationIds;
}

24
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/OptDashboardNotificationParams.java

@ -0,0 +1,24 @@
package com.techsor.datacenter.business.dto.dashboardnotification;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class OptDashboardNotificationParams {
@Schema(description = "Provider unique identifier ID, not required for new entries", example = "2738967")
private Long dashboardNotificationId;
@Schema(description = "Company ID", example = "2738967", hidden = true)
private Long companyId;
@Schema(description = "demand time", example = "testProvider1")
private String demandTime;
@Schema(description = "category", example = "remark")
private String category;
@Schema(description ="content", example = "2")
private String content;
}

3
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/device/DeviceAddParams.java

@ -67,5 +67,6 @@ public class DeviceAddParams {
@Schema(description = "data mapping", example = "{\"default\":{\"1\":\"漏水\",\"2\":\"漏电\",\"3\":\"起火\"}")
private String dataMapping;
@Schema(description = "dashboard数据小数位数", example = "1")
private Integer dashboardDecimalPlaces;
}

3
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/device/DeviceUpdateParams.java

@ -68,4 +68,7 @@ public class DeviceUpdateParams {
@Schema(description = "data mapping", example = "{\"default\":{\"1\":\"漏水\",\"2\":\"漏电\",\"3\":\"起火\"}")
private String dataMapping;
@Schema(description = "dashboard数据小数位数", example = "1")
private Integer dashboardDecimalPlaces;
}

370
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DashboardNotification.java

@ -0,0 +1,370 @@
package com.techsor.datacenter.business.model;
import java.io.Serializable;
public class DashboardNotification implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.id
*
* @mbg.generated
*/
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.company_id
*
* @mbg.generated
*/
private Long companyId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.demand_time
*
* @mbg.generated
*/
private String demandTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.category
*
* @mbg.generated
*/
private String category;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.flag
*
* @mbg.generated
*/
private Integer flag;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.created_at
*
* @mbg.generated
*/
private Long createdAt;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.created_by
*
* @mbg.generated
*/
private Long createdBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.updated_at
*
* @mbg.generated
*/
private Long updatedAt;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.updated_by
*
* @mbg.generated
*/
private Long updatedBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.content
*
* @mbg.generated
*/
private String content;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.id
*
* @return the value of dashboard_notification.id
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.id
*
* @param id the value for dashboard_notification.id
*
* @mbg.generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.company_id
*
* @return the value of dashboard_notification.company_id
*
* @mbg.generated
*/
public Long getCompanyId() {
return companyId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.company_id
*
* @param companyId the value for dashboard_notification.company_id
*
* @mbg.generated
*/
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.demand_time
*
* @return the value of dashboard_notification.demand_time
*
* @mbg.generated
*/
public String getDemandTime() {
return demandTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.demand_time
*
* @param demandTime the value for dashboard_notification.demand_time
*
* @mbg.generated
*/
public void setDemandTime(String demandTime) {
this.demandTime = demandTime == null ? null : demandTime.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.category
*
* @return the value of dashboard_notification.category
*
* @mbg.generated
*/
public String getCategory() {
return category;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.category
*
* @param category the value for dashboard_notification.category
*
* @mbg.generated
*/
public void setCategory(String category) {
this.category = category == null ? null : category.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.flag
*
* @return the value of dashboard_notification.flag
*
* @mbg.generated
*/
public Integer getFlag() {
return flag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.flag
*
* @param flag the value for dashboard_notification.flag
*
* @mbg.generated
*/
public void setFlag(Integer flag) {
this.flag = flag;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.created_at
*
* @return the value of dashboard_notification.created_at
*
* @mbg.generated
*/
public Long getCreatedAt() {
return createdAt;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.created_at
*
* @param createdAt the value for dashboard_notification.created_at
*
* @mbg.generated
*/
public void setCreatedAt(Long createdAt) {
this.createdAt = createdAt;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.created_by
*
* @return the value of dashboard_notification.created_by
*
* @mbg.generated
*/
public Long getCreatedBy() {
return createdBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.created_by
*
* @param createdBy the value for dashboard_notification.created_by
*
* @mbg.generated
*/
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.updated_at
*
* @return the value of dashboard_notification.updated_at
*
* @mbg.generated
*/
public Long getUpdatedAt() {
return updatedAt;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.updated_at
*
* @param updatedAt the value for dashboard_notification.updated_at
*
* @mbg.generated
*/
public void setUpdatedAt(Long updatedAt) {
this.updatedAt = updatedAt;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.updated_by
*
* @return the value of dashboard_notification.updated_by
*
* @mbg.generated
*/
public Long getUpdatedBy() {
return updatedBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.updated_by
*
* @param updatedBy the value for dashboard_notification.updated_by
*
* @mbg.generated
*/
public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.content
*
* @return the value of dashboard_notification.content
*
* @mbg.generated
*/
public String getContent() {
return content;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.content
*
* @param content the value for dashboard_notification.content
*
* @mbg.generated
*/
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", companyId=").append(companyId);
sb.append(", demandTime=").append(demandTime);
sb.append(", category=").append(category);
sb.append(", flag=").append(flag);
sb.append(", createdAt=").append(createdAt);
sb.append(", createdBy=").append(createdBy);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", updatedBy=").append(updatedBy);
sb.append(", content=").append(content);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

862
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DashboardNotificationExample.java

@ -0,0 +1,862 @@
package com.techsor.datacenter.business.model;
import java.util.ArrayList;
import java.util.List;
public class DashboardNotificationExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public DashboardNotificationExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andCompanyIdIsNull() {
addCriterion("company_id is null");
return (Criteria) this;
}
public Criteria andCompanyIdIsNotNull() {
addCriterion("company_id is not null");
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Long value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Long value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Long value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Long value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Long value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Long> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Long> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Long value1, Long value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Long value1, Long value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andDemandTimeIsNull() {
addCriterion("demand_time is null");
return (Criteria) this;
}
public Criteria andDemandTimeIsNotNull() {
addCriterion("demand_time is not null");
return (Criteria) this;
}
public Criteria andDemandTimeEqualTo(String value) {
addCriterion("demand_time =", value, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeNotEqualTo(String value) {
addCriterion("demand_time <>", value, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeGreaterThan(String value) {
addCriterion("demand_time >", value, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeGreaterThanOrEqualTo(String value) {
addCriterion("demand_time >=", value, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeLessThan(String value) {
addCriterion("demand_time <", value, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeLessThanOrEqualTo(String value) {
addCriterion("demand_time <=", value, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeLike(String value) {
addCriterion("demand_time like", value, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeNotLike(String value) {
addCriterion("demand_time not like", value, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeIn(List<String> values) {
addCriterion("demand_time in", values, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeNotIn(List<String> values) {
addCriterion("demand_time not in", values, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeBetween(String value1, String value2) {
addCriterion("demand_time between", value1, value2, "demandTime");
return (Criteria) this;
}
public Criteria andDemandTimeNotBetween(String value1, String value2) {
addCriterion("demand_time not between", value1, value2, "demandTime");
return (Criteria) this;
}
public Criteria andCategoryIsNull() {
addCriterion("category is null");
return (Criteria) this;
}
public Criteria andCategoryIsNotNull() {
addCriterion("category is not null");
return (Criteria) this;
}
public Criteria andCategoryEqualTo(String value) {
addCriterion("category =", value, "category");
return (Criteria) this;
}
public Criteria andCategoryNotEqualTo(String value) {
addCriterion("category <>", value, "category");
return (Criteria) this;
}
public Criteria andCategoryGreaterThan(String value) {
addCriterion("category >", value, "category");
return (Criteria) this;
}
public Criteria andCategoryGreaterThanOrEqualTo(String value) {
addCriterion("category >=", value, "category");
return (Criteria) this;
}
public Criteria andCategoryLessThan(String value) {
addCriterion("category <", value, "category");
return (Criteria) this;
}
public Criteria andCategoryLessThanOrEqualTo(String value) {
addCriterion("category <=", value, "category");
return (Criteria) this;
}
public Criteria andCategoryLike(String value) {
addCriterion("category like", value, "category");
return (Criteria) this;
}
public Criteria andCategoryNotLike(String value) {
addCriterion("category not like", value, "category");
return (Criteria) this;
}
public Criteria andCategoryIn(List<String> values) {
addCriterion("category in", values, "category");
return (Criteria) this;
}
public Criteria andCategoryNotIn(List<String> values) {
addCriterion("category not in", values, "category");
return (Criteria) this;
}
public Criteria andCategoryBetween(String value1, String value2) {
addCriterion("category between", value1, value2, "category");
return (Criteria) this;
}
public Criteria andCategoryNotBetween(String value1, String value2) {
addCriterion("category not between", value1, value2, "category");
return (Criteria) this;
}
public Criteria andFlagIsNull() {
addCriterion("flag is null");
return (Criteria) this;
}
public Criteria andFlagIsNotNull() {
addCriterion("flag is not null");
return (Criteria) this;
}
public Criteria andFlagEqualTo(Integer value) {
addCriterion("flag =", value, "flag");
return (Criteria) this;
}
public Criteria andFlagNotEqualTo(Integer value) {
addCriterion("flag <>", value, "flag");
return (Criteria) this;
}
public Criteria andFlagGreaterThan(Integer value) {
addCriterion("flag >", value, "flag");
return (Criteria) this;
}
public Criteria andFlagGreaterThanOrEqualTo(Integer value) {
addCriterion("flag >=", value, "flag");
return (Criteria) this;
}
public Criteria andFlagLessThan(Integer value) {
addCriterion("flag <", value, "flag");
return (Criteria) this;
}
public Criteria andFlagLessThanOrEqualTo(Integer value) {
addCriterion("flag <=", value, "flag");
return (Criteria) this;
}
public Criteria andFlagIn(List<Integer> values) {
addCriterion("flag in", values, "flag");
return (Criteria) this;
}
public Criteria andFlagNotIn(List<Integer> values) {
addCriterion("flag not in", values, "flag");
return (Criteria) this;
}
public Criteria andFlagBetween(Integer value1, Integer value2) {
addCriterion("flag between", value1, value2, "flag");
return (Criteria) this;
}
public Criteria andFlagNotBetween(Integer value1, Integer value2) {
addCriterion("flag not between", value1, value2, "flag");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Long value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Long value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Long value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Long value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Long value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Long value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Long> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Long> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Long value1, Long value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Long value1, Long value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedByIsNull() {
addCriterion("created_by is null");
return (Criteria) this;
}
public Criteria andCreatedByIsNotNull() {
addCriterion("created_by is not null");
return (Criteria) this;
}
public Criteria andCreatedByEqualTo(Long value) {
addCriterion("created_by =", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByNotEqualTo(Long value) {
addCriterion("created_by <>", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByGreaterThan(Long value) {
addCriterion("created_by >", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByGreaterThanOrEqualTo(Long value) {
addCriterion("created_by >=", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByLessThan(Long value) {
addCriterion("created_by <", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByLessThanOrEqualTo(Long value) {
addCriterion("created_by <=", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByIn(List<Long> values) {
addCriterion("created_by in", values, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByNotIn(List<Long> values) {
addCriterion("created_by not in", values, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByBetween(Long value1, Long value2) {
addCriterion("created_by between", value1, value2, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByNotBetween(Long value1, Long value2) {
addCriterion("created_by not between", value1, value2, "createdBy");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Long value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Long value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Long value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Long value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Long value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Long value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Long> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Long> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Long value1, Long value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Long value1, Long value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedByIsNull() {
addCriterion("updated_by is null");
return (Criteria) this;
}
public Criteria andUpdatedByIsNotNull() {
addCriterion("updated_by is not null");
return (Criteria) this;
}
public Criteria andUpdatedByEqualTo(Long value) {
addCriterion("updated_by =", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByNotEqualTo(Long value) {
addCriterion("updated_by <>", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByGreaterThan(Long value) {
addCriterion("updated_by >", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByGreaterThanOrEqualTo(Long value) {
addCriterion("updated_by >=", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByLessThan(Long value) {
addCriterion("updated_by <", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByLessThanOrEqualTo(Long value) {
addCriterion("updated_by <=", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByIn(List<Long> values) {
addCriterion("updated_by in", values, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByNotIn(List<Long> values) {
addCriterion("updated_by not in", values, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByBetween(Long value1, Long value2) {
addCriterion("updated_by between", value1, value2, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByNotBetween(Long value1, Long value2) {
addCriterion("updated_by not between", value1, value2, "updatedBy");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table dashboard_notification
*
* @mbg.generated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table dashboard_notification
*
* @mbg.generated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

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

@ -30,6 +30,15 @@ public class DeviceGroup implements Serializable {
*/
private Long buildingId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_device_group.class_id
*
* @mbg.generated
*/
private Integer classId;
/**
*
* This field was generated by MyBatis Generator.
@ -155,6 +164,30 @@ public class DeviceGroup implements Serializable {
this.buildingId = buildingId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_device_group.class_id
*
* @return the value of dashboard_device_group.class_id
*
* @mbg.generated
*/
public Integer getClassId() {
return classId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_device_group.class_id
*
* @param classId the value for dashboard_device_group.class_id
*
* @mbg.generated
*/
public void setClassId(Integer classId) {
this.classId = classId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_device_group.name
@ -290,6 +323,7 @@ public class DeviceGroup implements Serializable {
sb.append(", id=").append(id);
sb.append(", companyId=").append(companyId);
sb.append(", buildingId=").append(buildingId);
sb.append(", classId=").append(classId);
sb.append(", name=").append(name);
sb.append(", remark=").append(remark);
sb.append(", flag=").append(flag);

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

@ -374,6 +374,66 @@ public class DeviceGroupExample {
return (Criteria) this;
}
public Criteria andClassIdIsNull() {
addCriterion("class_id is null");
return (Criteria) this;
}
public Criteria andClassIdIsNotNull() {
addCriterion("class_id is not null");
return (Criteria) this;
}
public Criteria andClassIdEqualTo(Integer value) {
addCriterion("class_id =", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotEqualTo(Integer value) {
addCriterion("class_id <>", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdGreaterThan(Integer value) {
addCriterion("class_id >", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdGreaterThanOrEqualTo(Integer value) {
addCriterion("class_id >=", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdLessThan(Integer value) {
addCriterion("class_id <", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdLessThanOrEqualTo(Integer value) {
addCriterion("class_id <=", value, "classId");
return (Criteria) this;
}
public Criteria andClassIdIn(List<Integer> values) {
addCriterion("class_id in", values, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotIn(List<Integer> values) {
addCriterion("class_id not in", values, "classId");
return (Criteria) this;
}
public Criteria andClassIdBetween(Integer value1, Integer value2) {
addCriterion("class_id between", value1, value2, "classId");
return (Criteria) this;
}
public Criteria andClassIdNotBetween(Integer value1, Integer value2) {
addCriterion("class_id not between", value1, value2, "classId");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;

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

@ -94,6 +94,15 @@ public class DeviceInfo implements Serializable {
*/
private Long assetId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_info.gateway_client_id
*
* @mbg.generated
*/
private Integer gatewayClientId;
/**
*
* This field was generated by MyBatis Generator.
@ -229,6 +238,15 @@ public class DeviceInfo implements Serializable {
*/
private String unit;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column device_info.dashboard_decimal_places
*
* @mbg.generated
*/
private Integer dashboardDecimalPlaces;
/**
*
* This field was generated by MyBatis Generator.
@ -486,6 +504,30 @@ public class DeviceInfo implements Serializable {
this.assetId = assetId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_info.gateway_client_id
*
* @return the value of device_info.gateway_client_id
*
* @mbg.generated
*/
public Integer getGatewayClientId() {
return gatewayClientId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_info.gateway_client_id
*
* @param gatewayClientId the value for device_info.gateway_client_id
*
* @mbg.generated
*/
public void setGatewayClientId(Integer gatewayClientId) {
this.gatewayClientId = gatewayClientId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_info.flag
@ -846,6 +888,30 @@ public class DeviceInfo implements Serializable {
this.unit = unit == null ? null : unit.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_info.dashboard_decimal_places
*
* @return the value of device_info.dashboard_decimal_places
*
* @mbg.generated
*/
public Integer getDashboardDecimalPlaces() {
return dashboardDecimalPlaces;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column device_info.dashboard_decimal_places
*
* @param dashboardDecimalPlaces the value for device_info.dashboard_decimal_places
*
* @mbg.generated
*/
public void setDashboardDecimalPlaces(Integer dashboardDecimalPlaces) {
this.dashboardDecimalPlaces = dashboardDecimalPlaces;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column device_info.data_mapping
@ -892,6 +958,7 @@ public class DeviceInfo implements Serializable {
sb.append(", remark=").append(remark);
sb.append(", buildingId=").append(buildingId);
sb.append(", assetId=").append(assetId);
sb.append(", gatewayClientId=").append(gatewayClientId);
sb.append(", flag=").append(flag);
sb.append(", companyId=").append(companyId);
sb.append(", createdBy=").append(createdBy);
@ -907,6 +974,7 @@ public class DeviceInfo implements Serializable {
sb.append(", alarmLevel=").append(alarmLevel);
sb.append(", retainAlert=").append(retainAlert);
sb.append(", unit=").append(unit);
sb.append(", dashboardDecimalPlaces=").append(dashboardDecimalPlaces);
sb.append(", dataMapping=").append(dataMapping);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");

120
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DeviceInfoExample.java

@ -835,6 +835,66 @@ public class DeviceInfoExample {
return (Criteria) this;
}
public Criteria andGatewayClientIdIsNull() {
addCriterion("gateway_client_id is null");
return (Criteria) this;
}
public Criteria andGatewayClientIdIsNotNull() {
addCriterion("gateway_client_id is not null");
return (Criteria) this;
}
public Criteria andGatewayClientIdEqualTo(Integer value) {
addCriterion("gateway_client_id =", value, "gatewayClientId");
return (Criteria) this;
}
public Criteria andGatewayClientIdNotEqualTo(Integer value) {
addCriterion("gateway_client_id <>", value, "gatewayClientId");
return (Criteria) this;
}
public Criteria andGatewayClientIdGreaterThan(Integer value) {
addCriterion("gateway_client_id >", value, "gatewayClientId");
return (Criteria) this;
}
public Criteria andGatewayClientIdGreaterThanOrEqualTo(Integer value) {
addCriterion("gateway_client_id >=", value, "gatewayClientId");
return (Criteria) this;
}
public Criteria andGatewayClientIdLessThan(Integer value) {
addCriterion("gateway_client_id <", value, "gatewayClientId");
return (Criteria) this;
}
public Criteria andGatewayClientIdLessThanOrEqualTo(Integer value) {
addCriterion("gateway_client_id <=", value, "gatewayClientId");
return (Criteria) this;
}
public Criteria andGatewayClientIdIn(List<Integer> values) {
addCriterion("gateway_client_id in", values, "gatewayClientId");
return (Criteria) this;
}
public Criteria andGatewayClientIdNotIn(List<Integer> values) {
addCriterion("gateway_client_id not in", values, "gatewayClientId");
return (Criteria) this;
}
public Criteria andGatewayClientIdBetween(Integer value1, Integer value2) {
addCriterion("gateway_client_id between", value1, value2, "gatewayClientId");
return (Criteria) this;
}
public Criteria andGatewayClientIdNotBetween(Integer value1, Integer value2) {
addCriterion("gateway_client_id not between", value1, value2, "gatewayClientId");
return (Criteria) this;
}
public Criteria andFlagIsNull() {
addCriterion("flag is null");
return (Criteria) this;
@ -1754,6 +1814,66 @@ public class DeviceInfoExample {
addCriterion("unit not between", value1, value2, "unit");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesIsNull() {
addCriterion("dashboard_decimal_places is null");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesIsNotNull() {
addCriterion("dashboard_decimal_places is not null");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesEqualTo(Integer value) {
addCriterion("dashboard_decimal_places =", value, "dashboardDecimalPlaces");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesNotEqualTo(Integer value) {
addCriterion("dashboard_decimal_places <>", value, "dashboardDecimalPlaces");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesGreaterThan(Integer value) {
addCriterion("dashboard_decimal_places >", value, "dashboardDecimalPlaces");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesGreaterThanOrEqualTo(Integer value) {
addCriterion("dashboard_decimal_places >=", value, "dashboardDecimalPlaces");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesLessThan(Integer value) {
addCriterion("dashboard_decimal_places <", value, "dashboardDecimalPlaces");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesLessThanOrEqualTo(Integer value) {
addCriterion("dashboard_decimal_places <=", value, "dashboardDecimalPlaces");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesIn(List<Integer> values) {
addCriterion("dashboard_decimal_places in", values, "dashboardDecimalPlaces");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesNotIn(List<Integer> values) {
addCriterion("dashboard_decimal_places not in", values, "dashboardDecimalPlaces");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesBetween(Integer value1, Integer value2) {
addCriterion("dashboard_decimal_places between", value1, value2, "dashboardDecimalPlaces");
return (Criteria) this;
}
public Criteria andDashboardDecimalPlacesNotBetween(Integer value1, Integer value2) {
addCriterion("dashboard_decimal_places not between", value1, value2, "dashboardDecimalPlaces");
return (Criteria) this;
}
}
/**

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

@ -120,6 +120,24 @@ public class GatewayClients implements Serializable {
*/
private Integer alertSwitch;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column gateway_clients.project_id
*
* @mbg.generated
*/
private Long projectId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column gateway_clients.building_id
*
* @mbg.generated
*/
private Long buildingId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table gateway_clients
@ -440,6 +458,54 @@ public class GatewayClients implements Serializable {
this.alertSwitch = alertSwitch;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column gateway_clients.project_id
*
* @return the value of gateway_clients.project_id
*
* @mbg.generated
*/
public Long getProjectId() {
return projectId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column gateway_clients.project_id
*
* @param projectId the value for gateway_clients.project_id
*
* @mbg.generated
*/
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column gateway_clients.building_id
*
* @return the value of gateway_clients.building_id
*
* @mbg.generated
*/
public Long getBuildingId() {
return buildingId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column gateway_clients.building_id
*
* @param buildingId the value for gateway_clients.building_id
*
* @mbg.generated
*/
public void setBuildingId(Long buildingId) {
this.buildingId = buildingId;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table gateway_clients
@ -465,6 +531,8 @@ public class GatewayClients implements Serializable {
sb.append(", dataAmountThresholdAlarm=").append(dataAmountThresholdAlarm);
sb.append(", dataAccumulatedTotals=").append(dataAccumulatedTotals);
sb.append(", alertSwitch=").append(alertSwitch);
sb.append(", projectId=").append(projectId);
sb.append(", buildingId=").append(buildingId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

120
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/GatewayClientsExample.java

@ -1003,6 +1003,126 @@ public class GatewayClientsExample {
addCriterion("alert_switch not between", value1, value2, "alertSwitch");
return (Criteria) this;
}
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(Long value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(Long value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(Long value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(Long value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(Long value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(Long value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<Long> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<Long> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(Long value1, Long value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(Long value1, Long value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andBuildingIdIsNull() {
addCriterion("building_id is null");
return (Criteria) this;
}
public Criteria andBuildingIdIsNotNull() {
addCriterion("building_id is not null");
return (Criteria) this;
}
public Criteria andBuildingIdEqualTo(Long value) {
addCriterion("building_id =", value, "buildingId");
return (Criteria) this;
}
public Criteria andBuildingIdNotEqualTo(Long value) {
addCriterion("building_id <>", value, "buildingId");
return (Criteria) this;
}
public Criteria andBuildingIdGreaterThan(Long value) {
addCriterion("building_id >", value, "buildingId");
return (Criteria) this;
}
public Criteria andBuildingIdGreaterThanOrEqualTo(Long value) {
addCriterion("building_id >=", value, "buildingId");
return (Criteria) this;
}
public Criteria andBuildingIdLessThan(Long value) {
addCriterion("building_id <", value, "buildingId");
return (Criteria) this;
}
public Criteria andBuildingIdLessThanOrEqualTo(Long value) {
addCriterion("building_id <=", value, "buildingId");
return (Criteria) this;
}
public Criteria andBuildingIdIn(List<Long> values) {
addCriterion("building_id in", values, "buildingId");
return (Criteria) this;
}
public Criteria andBuildingIdNotIn(List<Long> values) {
addCriterion("building_id not in", values, "buildingId");
return (Criteria) this;
}
public Criteria andBuildingIdBetween(Long value1, Long value2) {
addCriterion("building_id between", value1, value2, "buildingId");
return (Criteria) this;
}
public Criteria andBuildingIdNotBetween(Long value1, Long value2) {
addCriterion("building_id not between", value1, value2, "buildingId");
return (Criteria) this;
}
}
/**

31
data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/dashboardnotification/DashboardNotificationPageVO.java

@ -0,0 +1,31 @@
package com.techsor.datacenter.business.vo.dashboardnotification;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @author Mr.Jiang
* @time 2022年7月21日 下午8:50:31
*/
@Data
public class DashboardNotificationPageVO {
@Schema(description = "Provider unique identifier ID, not required for new entries", example = "2738967")
private Long dashboardNotificationId;
@Schema(description = "Company ID", example = "2738967", hidden = true)
private Long companyId;
@Schema(description = "demand time", example = "testProvider1")
private String demandTime;
@Schema(description = "category", example = "remark")
private String category;
@Schema(description ="content", example = "2")
private String content;
@Schema(description = "created time", example = "2738967")
private Long createdAt;
}

3
data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/device/DeviceVO.java

@ -132,4 +132,7 @@ public class DeviceVO {
@Schema(description = "data mapping", example = "{\"default\":{\"1\":\"漏水\",\"2\":\"漏电\",\"3\":\"起火\"}")
private String dataMapping;
@Schema(description = "dashboard数据小数位数", example = "1")
private Integer dashboardDecimalPlaces;
}

24
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/DashboardNotificationService.java

@ -0,0 +1,24 @@
package com.techsor.datacenter.business.service;
import com.techsor.datacenter.business.common.response.PageInfo;
import com.techsor.datacenter.business.common.response.SimpleDataResponse;
import com.techsor.datacenter.business.dto.dashboardnotification.DashboardNotificationSearchParams;
import com.techsor.datacenter.business.dto.dashboardnotification.DeleteDashboardNotificationParams;
import com.techsor.datacenter.business.dto.dashboardnotification.OptDashboardNotificationParams;
import com.techsor.datacenter.business.vo.dashboardnotification.DashboardNotificationPageVO;
public interface DashboardNotificationService {
SimpleDataResponse add(OptDashboardNotificationParams optDashboardNotificationParams, Long userId, Long companyId,
Integer languageType);
SimpleDataResponse edit(OptDashboardNotificationParams optDashboardNotificationParams, Long userId, Long companyId,
Integer languageType);
SimpleDataResponse batchDelete(DeleteDashboardNotificationParams deleteParams, Long userId, Long companyId,
Integer languageType);
PageInfo<DashboardNotificationPageVO> getListPage(DashboardNotificationSearchParams searchParams, Long companyId, Long userId,
Integer languageType, Integer uTCOffset);
}

266
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DashboardNotificationServiceImpl.java

@ -0,0 +1,266 @@
package com.techsor.datacenter.business.service.impl;
import com.github.pagehelper.PageHelper;
import com.google.gson.Gson;
import com.techsor.datacenter.business.common.Constants;
import com.techsor.datacenter.business.common.exception.MsgCodeException;
import com.techsor.datacenter.business.common.language.msg.MsgLanguageChange;
import com.techsor.datacenter.business.common.response.PageInfo;
import com.techsor.datacenter.business.common.response.ResponseCode;
import com.techsor.datacenter.business.common.response.SimpleDataResponse;
import com.techsor.datacenter.business.dao.ex.DashboardNotificationMapperExt;
import com.techsor.datacenter.business.dao.ex.DeviceInfoMapperExt;
import com.techsor.datacenter.business.dto.dashboardnotification.DashboardNotificationSearchParams;
import com.techsor.datacenter.business.dto.dashboardnotification.DeleteDashboardNotificationParams;
import com.techsor.datacenter.business.dto.dashboardnotification.OptDashboardNotificationParams;
import com.techsor.datacenter.business.model.DashboardNotification;
import com.techsor.datacenter.business.model.DashboardNotificationExample;
import com.techsor.datacenter.business.model.DeviceInfoExample;
import com.techsor.datacenter.business.service.DashboardNotificationService;
import com.techsor.datacenter.business.service.UserOperationLogsService;
import com.techsor.datacenter.business.service.common.CommonOpt;
import com.techsor.datacenter.business.util.CommonUtil;
import com.techsor.datacenter.business.vo.dashboardnotification.DashboardNotificationPageVO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.ObjectUtils;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
*
* @author jwy-style
*
*/
@Service
public class DashboardNotificationServiceImpl implements DashboardNotificationService {
private static Logger logger = LoggerFactory.getLogger(DashboardNotificationServiceImpl.class);
@Autowired
private CommonOpt commonOpt;
@Autowired
private MsgLanguageChange msgLanguageChange;
@Autowired
private DashboardNotificationMapperExt dashboardNotificationMapperExt;
@Autowired
private UserOperationLogsService userOperationLogsService;
@Autowired
private DeviceInfoMapperExt deviceInfoMapperExt;
/**
* Adds a new dashboardNotification based on the provided parameters.
* Validates company ownership, performs common verification, and inserts the dashboardNotification into the database.
*
* @param optDashboardNotificationParams Parameters for the new dashboardNotification to be added
* @param userId ID of the user performing the operation
* @param companyId ID of the company associated with the dashboardNotification
* @param languageType Language type for error messages
* @return SimpleDataResponse indicating success or failure of the operation
*/
@Override
@Transactional
public SimpleDataResponse add(OptDashboardNotificationParams optDashboardNotificationParams, Long userId, Long companyId,
Integer languageType) {
try {
optDashboardNotificationParams.setDashboardNotificationId(null);
try {
// Validate company ownership to prevent unauthorized operations
if (ObjectUtils.isEmpty(optDashboardNotificationParams.getCompanyId())) {
optDashboardNotificationParams.setCompanyId(companyId);
} else {
checkCompany(optDashboardNotificationParams, languageType, companyId);
}
// Perform common verification for the dashboardNotification parameters
commonVerifyOpt(optDashboardNotificationParams, companyId, languageType);
} catch (MsgCodeException e) {
return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage());
}
long currentUnix = System.currentTimeMillis();
DashboardNotification dashboardNotification = new DashboardNotification();
BeanUtils.copyProperties(optDashboardNotificationParams,dashboardNotification);
dashboardNotification.setId(null);
dashboardNotification.setCreatedAt(currentUnix);
dashboardNotification.setCreatedBy(userId);
dashboardNotificationMapperExt.insertSelective(dashboardNotification);
return SimpleDataResponse.success();
} catch (Exception e) {
logger.error("Error occurred while adding a new dashboardNotification", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "server error");
}
}
/**
* Performs common verification operations on the dashboardNotification parameters.
* Checks parameter validity and existence of the dashboardNotification name.
*
* @param optDashboardNotificationParams Parameters of the dashboardNotification to be verified
* @param companyId ID of the company associated with the dashboardNotification
* @param languageType Language type for error messages
*/
private void commonVerifyOpt(OptDashboardNotificationParams optDashboardNotificationParams, Long companyId, Integer languageType) {
checkParam(optDashboardNotificationParams, languageType);
}
/**
* Checks if the specified dashboardNotification's company ID matches the logged-in user's company or its subsidiary.
* Throws a MsgCodeException if the company ID does not match.
*
* @param optDashboardNotificationParams Parameters of the dashboardNotification to be checked
* @param languageType Language type for error messages
* @param companyId ID of the company associated with the logged-in user
* @throws MsgCodeException If the operation is not authorized for the given company
*/
private void checkCompany(OptDashboardNotificationParams optDashboardNotificationParams, Integer languageType, Long companyId) {
if (!commonOpt.isSubCompany(companyId, optDashboardNotificationParams.getCompanyId())) {
throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth"));
}
}
/**
* Checks the validity of the dashboardNotification name parameter.
* Throws a MsgCodeException if the dashboardNotification name is blank or exceeds 100 characters.
*
* @param optDashboardNotificationParams Parameters of the dashboardNotification to be checked
* @param languageType Language type for error messages
* @throws MsgCodeException If the dashboardNotification name parameter is invalid
*/
private void checkParam(OptDashboardNotificationParams optDashboardNotificationParams, Integer languageType) {
if(StringUtils.isNotBlank(optDashboardNotificationParams.getDemandTime()) && optDashboardNotificationParams.getDemandTime().length() > 100){
throw new MsgCodeException("Parameter error [demandTime]");
}
if(StringUtils.isNotBlank(optDashboardNotificationParams.getCategory()) && optDashboardNotificationParams.getCategory().length() > 255){
throw new MsgCodeException("Parameter error [category]");
}
}
/**
* Updates an existing dashboardNotification with the provided parameters.
* Performs validation checks on the dashboardNotification parameters and authorization.
*
* @param optDashboardNotificationParams Parameters of the dashboardNotification to be updated
* @param userId ID of the user performing the update
* @param companyId ID of the company associated with the dashboardNotification
* @param languageType Language type for error messages
* @return SimpleDataResponse indicating success or failure of the update operation
*/
@Override
@Transactional
public SimpleDataResponse edit(OptDashboardNotificationParams optDashboardNotificationParams, Long userId, Long companyId,
Integer languageType) {
try {
DashboardNotification oldBP = dashboardNotificationMapperExt.selectByPrimaryKey(optDashboardNotificationParams.getDashboardNotificationId());
if (ObjectUtils.isEmpty(oldBP) || 1 == oldBP.getFlag()){
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found");
}
try {
List<Long> selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId);
if (!selfAndSubCompanyList.contains(oldBP.getCompanyId())){
throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth"));
}
//
if (ObjectUtils.isEmpty(optDashboardNotificationParams.getCompanyId())) {
optDashboardNotificationParams.setCompanyId(oldBP.getCompanyId());
} else if(!selfAndSubCompanyList.contains(optDashboardNotificationParams.getCompanyId())){//设置的所属企业不属于自己权限企业
throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth"));
}
commonVerifyOpt(optDashboardNotificationParams, companyId, languageType);
} catch (MsgCodeException e) {
return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage());
}
DashboardNotification dashboardNotification = new DashboardNotification();
BeanUtils.copyProperties(optDashboardNotificationParams,dashboardNotification);
DashboardNotificationExample example = new DashboardNotificationExample();
DashboardNotificationExample.Criteria criteria = example.createCriteria();
criteria.andIdEqualTo(optDashboardNotificationParams.getDashboardNotificationId());
dashboardNotificationMapperExt.updateByExampleSelective(dashboardNotification, example);
return SimpleDataResponse.success();
} catch (Exception e) {
logger.error("Edit dashboardNotification error", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "server error");
}
}
/**
* Batch deletes dashboardNotifications based on the provided dashboardNotification IDs.
* Performs validation checks on the dashboardNotification IDs and authorization.
*
* @param deleteDashboardNotificationParams Parameters containing dashboardNotification IDs to be deleted
* @param userId ID of the user performing the deletion
* @param companyId ID of the company associated with the dashboardNotifications
* @param languageType Language type for error messages
* @return SimpleDataResponse indicating success or failure of the batch deletion operation
*/
@Override
@Transactional
public SimpleDataResponse batchDelete(DeleteDashboardNotificationParams deleteDashboardNotificationParams, Long userId,
Long companyId, Integer languageType) {
if (StringUtils.isBlank(deleteDashboardNotificationParams.getDashboardNotificationIds())) {
return SimpleDataResponse.success();
}
try {
List<Long> ids = Arrays.asList(StringUtils.split(deleteDashboardNotificationParams.getDashboardNotificationIds(), ",")).stream()
.map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList());
DashboardNotificationExample dashboardNotificationExample = new DashboardNotificationExample();
DashboardNotificationExample.Criteria criteria = dashboardNotificationExample.createCriteria();
criteria.andIdIn(ids).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId));
DashboardNotification dashboardNotification = new DashboardNotification();
dashboardNotification.setFlag(1);
dashboardNotificationMapperExt.updateByExampleSelective(dashboardNotification, dashboardNotificationExample);
return SimpleDataResponse.success();
} catch (Exception e) {
logger.error("Batch delete dashboardNotification error", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "server error");
}
}
@Override
public PageInfo<DashboardNotificationPageVO> getListPage(DashboardNotificationSearchParams pageSearchParam, Long companyId,
Long userId, Integer languageType, Integer uTCOffset) {
//list防${}注入
if (StringUtils.isBlank(pageSearchParam.getCompanyIds())) {
pageSearchParam.setCompanyIdList(Arrays.asList(companyId));
} else {
pageSearchParam.setCompanyIdList(commonOpt.filterCompanyIds(companyId, pageSearchParam.getCompanyIds()));
}
if (StringUtils.isNotBlank(pageSearchParam.getDashboardNotificationIds())) {
pageSearchParam.setDashboardNotificationIdList(CommonUtil.commaStr2LongList(pageSearchParam.getDashboardNotificationIds()));
}
PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize());
List<DashboardNotificationPageVO> resultList = dashboardNotificationMapperExt.getListPage(pageSearchParam);
return new PageInfo<>(resultList);
}
}
Loading…
Cancel
Save