Browse Source

dashboard通知增加分类管理

jwy
review512jwy@163.com 4 weeks ago
parent
commit
18ca9813a6
  1. 1
      data-center-business-common/src/main/resources/config/language/msg/msg_cn.yml
  2. 1
      data-center-business-common/src/main/resources/config/language/msg/msg_en.yml
  3. 1
      data-center-business-common/src/main/resources/config/language/msg/msg_jp.yml
  4. 94
      data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/DashboardNotificationCategoryController.java
  5. 38
      data-center-business-controller/src/main/resources/db/migration/V69__user_surname_name.sql
  6. 15
      data-center-business-controller/src/main/resources/db/migration/V70__notice_category_select.sql
  7. 96
      data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DashboardNotificationCategoryMapper.java
  8. 17
      data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/DashboardNotificationCategoryMapperExt.java
  9. 334
      data-center-business-dao/src/main/resources/mappers/auto/DashboardNotificationCategoryMapper.xml
  10. 33
      data-center-business-dao/src/main/resources/mappers/auto/DashboardNotificationMapper.xml
  11. 43
      data-center-business-dao/src/main/resources/mappers/ex/DashboardNotificationCategoryMapperExt.xml
  12. 4
      data-center-business-dao/src/main/resources/mappers/ex/DashboardNotificationMapperExt.xml
  13. 5
      data-center-business-dao/src/main/resources/mybatis-generator/generatorConfig.xml
  14. 25
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/DashboardNotificationCategorySearchParams.java
  15. 16
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/DeleteDashboardNotificationCategoryParams.java
  16. 21
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/OptDashboardNotificationCategoryParams.java
  17. 6
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/OptDashboardNotificationParams.java
  18. 34
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DashboardNotification.java
  19. 336
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DashboardNotificationCategory.java
  20. 862
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DashboardNotificationCategoryExample.java
  21. 60
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DashboardNotificationExample.java
  22. 28
      data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/dashboardnotification/DashboardNotificationCategoryPageVO.java
  23. 3
      data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/dashboardnotification/DashboardNotificationPageVO.java
  24. 24
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/DashboardNotificationCategoryService.java
  25. 272
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DashboardNotificationCategoryServiceImpl.java
  26. 6
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DashboardNotificationServiceImpl.java

1
data-center-business-common/src/main/resources/config/language/msg/msg_cn.yml

@ -201,3 +201,4 @@ msgcn:
levelRoleNameExist: 层级角色已存在 levelRoleNameExist: 层级角色已存在
roleHasBinded: 角色已绑定用户,请先解绑再删除 roleHasBinded: 角色已绑定用户,请先解绑再删除
dataMappingFormatError: 数据映射格式错误 dataMappingFormatError: 数据映射格式错误
categoryHasExisted: 分类已存在

1
data-center-business-common/src/main/resources/config/language/msg/msg_en.yml

@ -201,3 +201,4 @@ msgen:
levelRoleNameExist: The role already exists. levelRoleNameExist: The role already exists.
roleHasBinded: The role is assigned to users. Please unbind them before deleting. roleHasBinded: The role is assigned to users. Please unbind them before deleting.
dataMappingFormatError: Invalid data mapping format dataMappingFormatError: Invalid data mapping format
categoryHasExisted: Category already exists.

1
data-center-business-common/src/main/resources/config/language/msg/msg_jp.yml

@ -201,3 +201,4 @@ msgjp:
levelRoleNameExist: 役割名が既に登録済み levelRoleNameExist: 役割名が既に登録済み
roleHasBinded: 役割はユーザーにバインドされている ので、削除する前にバインドを解除してください roleHasBinded: 役割はユーザーにバインドされている ので、削除する前にバインドを解除してください
dataMappingFormatError: データマッピング形式が不正です dataMappingFormatError: データマッピング形式が不正です
categoryHasExisted: カテゴリは既に存在します。

94
data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/DashboardNotificationCategoryController.java

@ -0,0 +1,94 @@
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.DashboardNotificationCategorySearchParams;
import com.techsor.datacenter.business.dto.dashboardnotification.DeleteDashboardNotificationCategoryParams;
import com.techsor.datacenter.business.dto.dashboardnotification.OptDashboardNotificationCategoryParams;
import com.techsor.datacenter.business.service.DashboardNotificationCategoryService;
import com.techsor.datacenter.business.vo.dashboardnotification.DashboardNotificationCategoryPageVO;
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("/dashboardNotificationCategory")
@Tag(name = "dashboard通知里的分类管理", description = "Data Provider manage API")
@SuppressWarnings("unchecked")
public class DashboardNotificationCategoryController {
private static Logger logger = LoggerFactory.getLogger(DashboardNotificationCategoryController.class);
@Autowired
private DashboardNotificationCategoryService dashboardNotificationCategoryService;
@Operation(summary = "Add category")
@RequestMapping(value = "/add", method = RequestMethod.POST)
public SimpleDataResponse add(
@RequestBody OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams,
@RequestHeader String LoginName,
@RequestHeader String AccessToken,
@RequestHeader Long UserId,
@RequestHeader(required = false) Long CompanyId,
@RequestHeader Integer LanguageType) {
return dashboardNotificationCategoryService.add(optDashboardNotificationCategoryParams, UserId, CompanyId, LanguageType);
}
@Operation(summary = "Edit category")
@RequestMapping(value = "/edit", method = RequestMethod.POST)
public SimpleDataResponse edit(
@RequestBody OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams,
@RequestHeader String LoginName,
@RequestHeader String AccessToken,
@RequestHeader Long UserId,
@RequestHeader(required = false) Long CompanyId,
@RequestHeader Integer LanguageType) {
return dashboardNotificationCategoryService.edit(optDashboardNotificationCategoryParams, UserId, CompanyId, LanguageType);
}
@Operation(summary = "Delete category")
@RequestMapping(value = "/batchDelete", method = RequestMethod.POST)
public SimpleDataResponse batchDelete(
@RequestBody DeleteDashboardNotificationCategoryParams deleteParams,
@RequestHeader String LoginName,
@RequestHeader String AccessToken,
@RequestHeader Long UserId,
@RequestHeader(required = false) Long CompanyId,
@RequestHeader Integer LanguageType) {
return dashboardNotificationCategoryService.batchDelete(deleteParams, UserId, CompanyId, LanguageType);
}
@Operation(summary = "Get category list")
@RequestMapping(value = "/getListPage", method = RequestMethod.GET)
public PageResponse<PageInfo<DashboardNotificationCategoryPageVO>> getListPage(
@RequestHeader String LoginName,
@RequestHeader String AccessToken,
@RequestHeader Long UserId,
@RequestHeader(required = false) Long CompanyId,
@RequestHeader Integer LanguageType,
@RequestHeader Integer UTCOffset,
DashboardNotificationCategorySearchParams searchParams) throws BusinessException {
searchParams.setUserId(UserId);
PageResponse<PageInfo<DashboardNotificationCategoryPageVO>> response = new PageResponse<>();
try {
response.setData(dashboardNotificationCategoryService.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;
}
}

38
data-center-business-controller/src/main/resources/db/migration/V69__user_surname_name.sql

@ -0,0 +1,38 @@
USE `data_center_aeon_admin`;
DROP PROCEDURE IF EXISTS `add_user_name_column`;
DELIMITER $$
CREATE PROCEDURE add_user_name_column()
BEGIN
-- 姓
IF NOT EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_user'
AND column_name = 'last_name'
) THEN
ALTER TABLE basic_user
ADD COLUMN `last_name` VARCHAR(50) DEFAULT NULL COMMENT '';
END IF;
-- 名
IF NOT EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_schema = 'data_center_aeon_admin'
AND table_name = 'basic_user'
AND column_name = 'first_name'
) THEN
ALTER TABLE basic_user
ADD COLUMN `first_name` VARCHAR(50) DEFAULT NULL COMMENT '';
END IF;
END$$
DELIMITER ;
CALL add_user_name_column();
DROP PROCEDURE IF EXISTS `add_user_name_column`;

15
data-center-business-controller/src/main/resources/db/migration/V70__notice_category_select.sql

@ -0,0 +1,15 @@
ALTER TABLE dashboard_notification ADD `category_id` bigint DEFAULT NULL after category;
ALTER TABLE dashboard_notification MODIFY COLUMN `category` varchar(255) DEFAULT NULL COMMENT '分类';
CREATE TABLE dashboard_notification_category (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
company_id bigint DEFAULT NULL,
name VARCHAR(255) NOT NULL,
remark VARCHAR(255) NULL,
`flag` int NOT NULL DEFAULT '0' COMMENT '0-正常,1-删除',
created_by BIGINT NULL,
created_at BIGINT NULL,
updated_at BIGINT NULL,
updated_by BIGINT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '通知表里的分类';

96
data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/DashboardNotificationCategoryMapper.java

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

17
data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/DashboardNotificationCategoryMapperExt.java

@ -0,0 +1,17 @@
package com.techsor.datacenter.business.dao.ex;
import com.techsor.datacenter.business.dao.auto.DashboardNotificationCategoryMapper;
import com.techsor.datacenter.business.dto.dashboardnotification.DashboardNotificationCategorySearchParams;
import com.techsor.datacenter.business.dto.dashboardnotification.OptDashboardNotificationCategoryParams;
import com.techsor.datacenter.business.vo.dashboardnotification.DashboardNotificationCategoryPageVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface DashboardNotificationCategoryMapperExt extends DashboardNotificationCategoryMapper {
int checkExist(OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams);
List<DashboardNotificationCategoryPageVO> getListPage(DashboardNotificationCategorySearchParams pageSearchParam);
}

334
data-center-business-dao/src/main/resources/mappers/auto/DashboardNotificationCategoryMapper.xml

@ -0,0 +1,334 @@
<?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.DashboardNotificationCategoryMapper">
<resultMap id="BaseResultMap" type="com.techsor.datacenter.business.model.DashboardNotificationCategory">
<!--
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="name" jdbcType="VARCHAR" property="name" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="flag" jdbcType="INTEGER" property="flag" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</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, `name`, remark, flag, created_by, created_at, updated_at, updated_by
</sql>
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.DashboardNotificationCategoryExample" 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_category
<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="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from dashboard_notification_category
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_category
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.techsor.datacenter.business.model.DashboardNotificationCategoryExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from dashboard_notification_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.techsor.datacenter.business.model.DashboardNotificationCategory">
<!--
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_category (company_id, `name`, remark,
flag, created_by, created_at,
updated_at, updated_by)
values (#{companyId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{flag,jdbcType=INTEGER}, #{createdBy,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT},
#{updatedAt,jdbcType=BIGINT}, #{updatedBy,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.DashboardNotificationCategory">
<!--
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_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyId != null">
company_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="remark != null">
remark,
</if>
<if test="flag != null">
flag,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="companyId != null">
#{companyId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="flag != null">
#{flag,jdbcType=INTEGER},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=BIGINT},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.DashboardNotificationCategoryExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from dashboard_notification_category
<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_category
<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.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.flag != null">
flag = #{record.flag,jdbcType=INTEGER},
</if>
<if test="record.createdBy != null">
created_by = #{record.createdBy,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,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>
</set>
<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_category
set id = #{record.id,jdbcType=BIGINT},
company_id = #{record.companyId,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
flag = #{record.flag,jdbcType=INTEGER},
created_by = #{record.createdBy,jdbcType=BIGINT},
created_at = #{record.createdAt,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.DashboardNotificationCategory">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_notification_category
<set>
<if test="companyId != null">
company_id = #{companyId,jdbcType=BIGINT},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="flag != null">
flag = #{flag,jdbcType=INTEGER},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=BIGINT},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.techsor.datacenter.business.model.DashboardNotificationCategory">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update dashboard_notification_category
set company_id = #{companyId,jdbcType=BIGINT},
`name` = #{name,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
flag = #{flag,jdbcType=INTEGER},
created_by = #{createdBy,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

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

@ -10,6 +10,7 @@
<result column="company_id" jdbcType="BIGINT" property="companyId" /> <result column="company_id" jdbcType="BIGINT" property="companyId" />
<result column="demand_time" jdbcType="VARCHAR" property="demandTime" /> <result column="demand_time" jdbcType="VARCHAR" property="demandTime" />
<result column="category" jdbcType="VARCHAR" property="category" /> <result column="category" jdbcType="VARCHAR" property="category" />
<result column="category_id" jdbcType="BIGINT" property="categoryId" />
<result column="flag" jdbcType="INTEGER" property="flag" /> <result column="flag" jdbcType="INTEGER" property="flag" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" /> <result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" /> <result column="created_by" jdbcType="BIGINT" property="createdBy" />
@ -94,8 +95,8 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, company_id, demand_time, category, flag, created_at, created_by, updated_at, id, company_id, demand_time, category, category_id, flag, created_at, created_by,
updated_by updated_at, updated_by
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
<!-- <!--
@ -183,13 +184,13 @@
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into dashboard_notification (company_id, demand_time, category, insert into dashboard_notification (company_id, demand_time, category,
flag, created_at, created_by, category_id, flag, created_at,
updated_at, updated_by, content created_by, updated_at, updated_by,
) content)
values (#{companyId,jdbcType=BIGINT}, #{demandTime,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR}, values (#{companyId,jdbcType=BIGINT}, #{demandTime,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR},
#{flag,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{createdBy,jdbcType=BIGINT}, #{categoryId,jdbcType=BIGINT}, #{flag,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT},
#{updatedAt,jdbcType=BIGINT}, #{updatedBy,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR} #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{updatedBy,jdbcType=BIGINT},
) #{content,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.DashboardNotification"> <insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.DashboardNotification">
<!-- <!--
@ -210,6 +211,9 @@
<if test="category != null"> <if test="category != null">
category, category,
</if> </if>
<if test="categoryId != null">
category_id,
</if>
<if test="flag != null"> <if test="flag != null">
flag, flag,
</if> </if>
@ -239,6 +243,9 @@
<if test="category != null"> <if test="category != null">
#{category,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR},
</if> </if>
<if test="categoryId != null">
#{categoryId,jdbcType=BIGINT},
</if>
<if test="flag != null"> <if test="flag != null">
#{flag,jdbcType=INTEGER}, #{flag,jdbcType=INTEGER},
</if> </if>
@ -288,6 +295,9 @@
<if test="record.category != null"> <if test="record.category != null">
category = #{record.category,jdbcType=VARCHAR}, category = #{record.category,jdbcType=VARCHAR},
</if> </if>
<if test="record.categoryId != null">
category_id = #{record.categoryId,jdbcType=BIGINT},
</if>
<if test="record.flag != null"> <if test="record.flag != null">
flag = #{record.flag,jdbcType=INTEGER}, flag = #{record.flag,jdbcType=INTEGER},
</if> </if>
@ -321,6 +331,7 @@
company_id = #{record.companyId,jdbcType=BIGINT}, company_id = #{record.companyId,jdbcType=BIGINT},
demand_time = #{record.demandTime,jdbcType=VARCHAR}, demand_time = #{record.demandTime,jdbcType=VARCHAR},
category = #{record.category,jdbcType=VARCHAR}, category = #{record.category,jdbcType=VARCHAR},
category_id = #{record.categoryId,jdbcType=BIGINT},
flag = #{record.flag,jdbcType=INTEGER}, flag = #{record.flag,jdbcType=INTEGER},
created_at = #{record.createdAt,jdbcType=BIGINT}, created_at = #{record.createdAt,jdbcType=BIGINT},
created_by = #{record.createdBy,jdbcType=BIGINT}, created_by = #{record.createdBy,jdbcType=BIGINT},
@ -341,6 +352,7 @@
company_id = #{record.companyId,jdbcType=BIGINT}, company_id = #{record.companyId,jdbcType=BIGINT},
demand_time = #{record.demandTime,jdbcType=VARCHAR}, demand_time = #{record.demandTime,jdbcType=VARCHAR},
category = #{record.category,jdbcType=VARCHAR}, category = #{record.category,jdbcType=VARCHAR},
category_id = #{record.categoryId,jdbcType=BIGINT},
flag = #{record.flag,jdbcType=INTEGER}, flag = #{record.flag,jdbcType=INTEGER},
created_at = #{record.createdAt,jdbcType=BIGINT}, created_at = #{record.createdAt,jdbcType=BIGINT},
created_by = #{record.createdBy,jdbcType=BIGINT}, created_by = #{record.createdBy,jdbcType=BIGINT},
@ -366,6 +378,9 @@
<if test="category != null"> <if test="category != null">
category = #{category,jdbcType=VARCHAR}, category = #{category,jdbcType=VARCHAR},
</if> </if>
<if test="categoryId != null">
category_id = #{categoryId,jdbcType=BIGINT},
</if>
<if test="flag != null"> <if test="flag != null">
flag = #{flag,jdbcType=INTEGER}, flag = #{flag,jdbcType=INTEGER},
</if> </if>
@ -396,6 +411,7 @@
set company_id = #{companyId,jdbcType=BIGINT}, set company_id = #{companyId,jdbcType=BIGINT},
demand_time = #{demandTime,jdbcType=VARCHAR}, demand_time = #{demandTime,jdbcType=VARCHAR},
category = #{category,jdbcType=VARCHAR}, category = #{category,jdbcType=VARCHAR},
category_id = #{categoryId,jdbcType=BIGINT},
flag = #{flag,jdbcType=INTEGER}, flag = #{flag,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=BIGINT}, created_at = #{createdAt,jdbcType=BIGINT},
created_by = #{createdBy,jdbcType=BIGINT}, created_by = #{createdBy,jdbcType=BIGINT},
@ -413,6 +429,7 @@
set company_id = #{companyId,jdbcType=BIGINT}, set company_id = #{companyId,jdbcType=BIGINT},
demand_time = #{demandTime,jdbcType=VARCHAR}, demand_time = #{demandTime,jdbcType=VARCHAR},
category = #{category,jdbcType=VARCHAR}, category = #{category,jdbcType=VARCHAR},
category_id = #{categoryId,jdbcType=BIGINT},
flag = #{flag,jdbcType=INTEGER}, flag = #{flag,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=BIGINT}, created_at = #{createdAt,jdbcType=BIGINT},
created_by = #{createdBy,jdbcType=BIGINT}, created_by = #{createdBy,jdbcType=BIGINT},

43
data-center-business-dao/src/main/resources/mappers/ex/DashboardNotificationCategoryMapperExt.xml

@ -0,0 +1,43 @@
<?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.DashboardNotificationCategoryMapperExt">
<select id="checkExist" resultType="java.lang.Integer">
SELECT
COUNT(1)
FROM
dashboard_notification_category
WHERE
flag != 1 AND name = #{name}
<if test="companyId != null">
AND company_id = #{companyId}
</if>
<if test="categoryId != null">
AND id != #{categoryId}
</if>
</select>
<select id="getListPage" resultType="com.techsor.datacenter.business.vo.dashboardnotification.DashboardNotificationCategoryPageVO">
SELECT
dn.id categoryId,
dn.company_id,
dn.`name`,
dn.remark,
dn.created_at
FROM
dashboard_notification_category dn
WHERE
dn.flag != 1
AND dn.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
<if test="categoryIdList != null">
AND dn.id IN <foreach collection="categoryIdList" item="item" open="(" separator="," close=")">#{item}</foreach>
</if>
<if test="name != null and name != ''">
AND dn.name LIKE CONCAT('%',#{name},'%')
</if>
ORDER BY dn.id DESC
</select>
</mapper>

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

@ -8,11 +8,13 @@
dn.id dashboardNotificationId, dn.id dashboardNotificationId,
dn.company_id, dn.company_id,
dn.`demand_time`, dn.`demand_time`,
dn.category, dnc.`name` AS category,
dnc.id AS categoryId,
dn.content, dn.content,
dn.created_at dn.created_at
FROM FROM
dashboard_notification dn dashboard_notification dn
left join dashboard_notification_category dnc on dn.category_id = dnc.id and dnc.flag != 1
WHERE WHERE
dn.flag != 1 dn.flag != 1
AND dn.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach> AND dn.company_id IN <foreach collection="companyIdList" item="item" open="(" separator="," close=")">#{item}</foreach>

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

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

25
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/DashboardNotificationCategorySearchParams.java

@ -0,0 +1,25 @@
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 DashboardNotificationCategorySearchParams extends BaseSearchParams{
@Schema(description = "IDs, comma-separated", example = "1,47")
private String categoryIds;
@Schema(description = "name", example = "name47")
private String name;
@Schema(description = "ID list", hidden = true)
private List<Long> categoryIdList;
}

16
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/DeleteDashboardNotificationCategoryParams.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 DeleteDashboardNotificationCategoryParams {
@Schema(description = "IDs, separated by commas", example = "2738967,587")
private String categoryIds;
}

21
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/dashboardnotification/OptDashboardNotificationCategoryParams.java

@ -0,0 +1,21 @@
package com.techsor.datacenter.business.dto.dashboardnotification;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class OptDashboardNotificationCategoryParams {
@Schema(description = "unique identifier ID, not required for new entries", example = "2738967")
private Long categoryId;
@Schema(description = "Company ID", example = "2738967", hidden = true)
private Long companyId;
@Schema(description = "name", example = "webhook", required = true)
private String name;
@Schema(description = "remark", example = "remark")
private String remark;
}

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

@ -15,8 +15,10 @@ public class OptDashboardNotificationParams {
@Schema(description = "demand time", example = "testProvider1") @Schema(description = "demand time", example = "testProvider1")
private String demandTime; private String demandTime;
@Schema(description = "category", example = "remark") // @Schema(description = "category", example = "remark")
private String category; // private String category;
@Schema(description = "Category ID", example = "2738967")
private Long categoryId;
@Schema(description ="content", example = "2") @Schema(description ="content", example = "2")
private String content; private String content;

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

@ -39,6 +39,15 @@ public class DashboardNotification implements Serializable {
*/ */
private String category; private String category;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification.category_id
*
* @mbg.generated
*/
private Long categoryId;
/** /**
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
@ -197,6 +206,30 @@ public class DashboardNotification implements Serializable {
this.category = category == null ? null : category.trim(); 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.category_id
*
* @return the value of dashboard_notification.category_id
*
* @mbg.generated
*/
public Long getCategoryId() {
return categoryId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification.category_id
*
* @param categoryId the value for dashboard_notification.category_id
*
* @mbg.generated
*/
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification.flag * This method returns the value of the database column dashboard_notification.flag
@ -357,6 +390,7 @@ public class DashboardNotification implements Serializable {
sb.append(", companyId=").append(companyId); sb.append(", companyId=").append(companyId);
sb.append(", demandTime=").append(demandTime); sb.append(", demandTime=").append(demandTime);
sb.append(", category=").append(category); sb.append(", category=").append(category);
sb.append(", categoryId=").append(categoryId);
sb.append(", flag=").append(flag); sb.append(", flag=").append(flag);
sb.append(", createdAt=").append(createdAt); sb.append(", createdAt=").append(createdAt);
sb.append(", createdBy=").append(createdBy); sb.append(", createdBy=").append(createdBy);

336
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/DashboardNotificationCategory.java

@ -0,0 +1,336 @@
package com.techsor.datacenter.business.model;
import java.io.Serializable;
public class DashboardNotificationCategory implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification_category.id
*
* @mbg.generated
*/
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification_category.company_id
*
* @mbg.generated
*/
private Long companyId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification_category.name
*
* @mbg.generated
*/
private String name;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification_category.remark
*
* @mbg.generated
*/
private String remark;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification_category.flag
*
* @mbg.generated
*/
private Integer flag;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification_category.created_by
*
* @mbg.generated
*/
private Long createdBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification_category.created_at
*
* @mbg.generated
*/
private Long createdAt;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification_category.updated_at
*
* @mbg.generated
*/
private Long updatedAt;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dashboard_notification_category.updated_by
*
* @mbg.generated
*/
private Long updatedBy;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notification_category
*
* @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_category.id
*
* @return the value of dashboard_notification_category.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_category.id
*
* @param id the value for dashboard_notification_category.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_category.company_id
*
* @return the value of dashboard_notification_category.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_category.company_id
*
* @param companyId the value for dashboard_notification_category.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_category.name
*
* @return the value of dashboard_notification_category.name
*
* @mbg.generated
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification_category.name
*
* @param name the value for dashboard_notification_category.name
*
* @mbg.generated
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification_category.remark
*
* @return the value of dashboard_notification_category.remark
*
* @mbg.generated
*/
public String getRemark() {
return remark;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column dashboard_notification_category.remark
*
* @param remark the value for dashboard_notification_category.remark
*
* @mbg.generated
*/
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column dashboard_notification_category.flag
*
* @return the value of dashboard_notification_category.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_category.flag
*
* @param flag the value for dashboard_notification_category.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_category.created_by
*
* @return the value of dashboard_notification_category.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_category.created_by
*
* @param createdBy the value for dashboard_notification_category.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_category.created_at
*
* @return the value of dashboard_notification_category.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_category.created_at
*
* @param createdAt the value for dashboard_notification_category.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_category.updated_at
*
* @return the value of dashboard_notification_category.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_category.updated_at
*
* @param updatedAt the value for dashboard_notification_category.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_category.updated_by
*
* @return the value of dashboard_notification_category.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_category.updated_by
*
* @param updatedBy the value for dashboard_notification_category.updated_by
*
* @mbg.generated
*/
public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification_category
*
* @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(", name=").append(name);
sb.append(", remark=").append(remark);
sb.append(", flag=").append(flag);
sb.append(", createdBy=").append(createdBy);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", updatedBy=").append(updatedBy);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

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

@ -0,0 +1,862 @@
package com.techsor.datacenter.business.model;
import java.util.ArrayList;
import java.util.List;
public class DashboardNotificationCategoryExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notification_category
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notification_category
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table dashboard_notification_category
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification_category
*
* @mbg.generated
*/
public DashboardNotificationCategoryExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification_category
*
* @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_category
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification_category
*
* @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_category
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification_category
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dashboard_notification_category
*
* @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_category
*
* @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_category
*
* @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_category
*
* @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_category
*
* @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_category
*
* @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 andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
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 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 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 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_category
*
* @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_category
*
* @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);
}
}
}

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

@ -454,6 +454,66 @@ public class DashboardNotificationExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCategoryIdIsNull() {
addCriterion("category_id is null");
return (Criteria) this;
}
public Criteria andCategoryIdIsNotNull() {
addCriterion("category_id is not null");
return (Criteria) this;
}
public Criteria andCategoryIdEqualTo(Long value) {
addCriterion("category_id =", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotEqualTo(Long value) {
addCriterion("category_id <>", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdGreaterThan(Long value) {
addCriterion("category_id >", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdGreaterThanOrEqualTo(Long value) {
addCriterion("category_id >=", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdLessThan(Long value) {
addCriterion("category_id <", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdLessThanOrEqualTo(Long value) {
addCriterion("category_id <=", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdIn(List<Long> values) {
addCriterion("category_id in", values, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotIn(List<Long> values) {
addCriterion("category_id not in", values, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdBetween(Long value1, Long value2) {
addCriterion("category_id between", value1, value2, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotBetween(Long value1, Long value2) {
addCriterion("category_id not between", value1, value2, "categoryId");
return (Criteria) this;
}
public Criteria andFlagIsNull() { public Criteria andFlagIsNull() {
addCriterion("flag is null"); addCriterion("flag is null");
return (Criteria) this; return (Criteria) this;

28
data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/dashboardnotification/DashboardNotificationCategoryPageVO.java

@ -0,0 +1,28 @@
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 DashboardNotificationCategoryPageVO {
@Schema(description = "unique identifier ID, not required for new entries", example = "2738967")
private Long categoryId;
@Schema(description = "Company ID", example = "2738967", hidden = true)
private Long companyId;
@Schema(description = "name", example = "webhook", required = true)
private String name;
@Schema(description = "remark", example = "remark")
private String remark;
@Schema(description = "created time", example = "2738967")
private Long createdAt;
}

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

@ -22,6 +22,9 @@ public class DashboardNotificationPageVO {
@Schema(description = "category", example = "remark") @Schema(description = "category", example = "remark")
private String category; private String category;
@Schema(description = "Category ID", example = "2738967")
private Long categoryId;
@Schema(description ="content", example = "2") @Schema(description ="content", example = "2")
private String content; private String content;

24
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/DashboardNotificationCategoryService.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.DashboardNotificationCategorySearchParams;
import com.techsor.datacenter.business.dto.dashboardnotification.DeleteDashboardNotificationCategoryParams;
import com.techsor.datacenter.business.dto.dashboardnotification.OptDashboardNotificationCategoryParams;
import com.techsor.datacenter.business.vo.dashboardnotification.DashboardNotificationCategoryPageVO;
public interface DashboardNotificationCategoryService {
SimpleDataResponse add(OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams, Long userId, Long companyId,
Integer languageType);
SimpleDataResponse edit(OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams, Long userId, Long companyId,
Integer languageType);
SimpleDataResponse batchDelete(DeleteDashboardNotificationCategoryParams deleteParams, Long userId, Long companyId,
Integer languageType);
PageInfo<DashboardNotificationCategoryPageVO> getListPage(DashboardNotificationCategorySearchParams searchParams, Long companyId, Long userId,
Integer languageType, Integer uTCOffset);
}

272
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DashboardNotificationCategoryServiceImpl.java

@ -0,0 +1,272 @@
package com.techsor.datacenter.business.service.impl;
import com.github.pagehelper.PageHelper;
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.DashboardNotificationCategoryMapperExt;
import com.techsor.datacenter.business.dao.ex.DeviceInfoMapperExt;
import com.techsor.datacenter.business.dto.dashboardnotification.DashboardNotificationCategorySearchParams;
import com.techsor.datacenter.business.dto.dashboardnotification.DeleteDashboardNotificationCategoryParams;
import com.techsor.datacenter.business.dto.dashboardnotification.OptDashboardNotificationCategoryParams;
import com.techsor.datacenter.business.model.DashboardNotificationCategory;
import com.techsor.datacenter.business.model.DashboardNotificationCategoryExample;
import com.techsor.datacenter.business.service.DashboardNotificationCategoryService;
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.DashboardNotificationCategoryPageVO;
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 DashboardNotificationCategoryServiceImpl implements DashboardNotificationCategoryService {
private static Logger logger = LoggerFactory.getLogger(DashboardNotificationCategoryServiceImpl.class);
@Autowired
private CommonOpt commonOpt;
@Autowired
private MsgLanguageChange msgLanguageChange;
@Autowired
private DashboardNotificationCategoryMapperExt dashboardNotificationCategoryMapperExt;
@Autowired
private UserOperationLogsService userOperationLogsService;
@Autowired
private DeviceInfoMapperExt deviceInfoMapperExt;
/**
* Adds a new dashboardNotificationCategory based on the provided parameters.
* Validates company ownership, performs common verification, and inserts the dashboardNotificationCategory into the database.
*
* @param optDashboardNotificationCategoryParams Parameters for the new dashboardNotificationCategory to be added
* @param userId ID of the user performing the operation
* @param companyId ID of the company associated with the dashboardNotificationCategory
* @param languageType Language type for error messages
* @return SimpleDataResponse indicating success or failure of the operation
*/
@Override
@Transactional
public SimpleDataResponse add(OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams, Long userId, Long companyId,
Integer languageType) {
try {
optDashboardNotificationCategoryParams.setCategoryId(null);
try {
// Validate company ownership to prevent unauthorized operations
if (ObjectUtils.isEmpty(optDashboardNotificationCategoryParams.getCompanyId())) {
optDashboardNotificationCategoryParams.setCompanyId(companyId);
} else {
checkCompany(optDashboardNotificationCategoryParams, languageType, companyId);
}
// Perform common verification for the dashboardNotificationCategory parameters
commonVerifyOpt(optDashboardNotificationCategoryParams, companyId, languageType);
} catch (MsgCodeException e) {
return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage());
}
long currentUnix = System.currentTimeMillis();
DashboardNotificationCategory dashboardNotificationCategory = new DashboardNotificationCategory();
BeanUtils.copyProperties(optDashboardNotificationCategoryParams,dashboardNotificationCategory);
dashboardNotificationCategory.setId(null);
dashboardNotificationCategory.setCreatedAt(currentUnix);
dashboardNotificationCategory.setCreatedBy(userId);
dashboardNotificationCategoryMapperExt.insertSelective(dashboardNotificationCategory);
return SimpleDataResponse.success();
} catch (Exception e) {
logger.error("Error occurred while adding a new dashboardNotificationCategory", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "server error");
}
}
/**
* Performs common verification operations on the dashboardNotificationCategory parameters.
* Checks parameter validity and existence of the dashboardNotificationCategory name.
*
* @param optDashboardNotificationCategoryParams Parameters of the dashboardNotificationCategory to be verified
* @param companyId ID of the company associated with the dashboardNotificationCategory
* @param languageType Language type for error messages
*/
private void commonVerifyOpt(OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams, Long companyId, Integer languageType) {
checkParam(optDashboardNotificationCategoryParams, languageType);
checkExist(optDashboardNotificationCategoryParams, languageType);
}
private void checkExist(OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams, Integer languageType) {
if (dashboardNotificationCategoryMapperExt.checkExist(optDashboardNotificationCategoryParams) > 0) {
throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "categoryHasExisted"));
}
}
/**
* Checks if the specified dashboardNotificationCategory's company ID matches the logged-in user's company or its subsidiary.
* Throws a MsgCodeException if the company ID does not match.
*
* @param optDashboardNotificationCategoryParams Parameters of the dashboardNotificationCategory 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(OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams, Integer languageType, Long companyId) {
if (!commonOpt.isSubCompany(companyId, optDashboardNotificationCategoryParams.getCompanyId())) {
throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth"));
}
}
/**
* Checks the validity of the dashboardNotificationCategory name parameter.
* Throws a MsgCodeException if the dashboardNotificationCategory name is blank or exceeds 100 characters.
*
* @param optDashboardNotificationCategoryParams Parameters of the dashboardNotificationCategory to be checked
* @param languageType Language type for error messages
* @throws MsgCodeException If the dashboardNotificationCategory name parameter is invalid
*/
private void checkParam(OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams, Integer languageType) {
if(StringUtils.isBlank(optDashboardNotificationCategoryParams.getName()) || optDashboardNotificationCategoryParams.getName().length() > 255){
throw new MsgCodeException("Parameter error [name]");
}
if(StringUtils.isNotBlank(optDashboardNotificationCategoryParams.getRemark()) && optDashboardNotificationCategoryParams.getRemark().length() > 255){
throw new MsgCodeException("Parameter error [remark]");
}
}
/**
* Updates an existing dashboardNotificationCategory with the provided parameters.
* Performs validation checks on the dashboardNotificationCategory parameters and authorization.
*
* @param optDashboardNotificationCategoryParams Parameters of the dashboardNotificationCategory to be updated
* @param userId ID of the user performing the update
* @param companyId ID of the company associated with the dashboardNotificationCategory
* @param languageType Language type for error messages
* @return SimpleDataResponse indicating success or failure of the update operation
*/
@Override
@Transactional
public SimpleDataResponse edit(OptDashboardNotificationCategoryParams optDashboardNotificationCategoryParams, Long userId, Long companyId,
Integer languageType) {
try {
DashboardNotificationCategory oldBP = dashboardNotificationCategoryMapperExt.selectByPrimaryKey(optDashboardNotificationCategoryParams.getCategoryId());
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(optDashboardNotificationCategoryParams.getCompanyId())) {
optDashboardNotificationCategoryParams.setCompanyId(oldBP.getCompanyId());
} else if(!selfAndSubCompanyList.contains(optDashboardNotificationCategoryParams.getCompanyId())){//设置的所属企业不属于自己权限企业
throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth"));
}
commonVerifyOpt(optDashboardNotificationCategoryParams, companyId, languageType);
} catch (MsgCodeException e) {
return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage());
}
DashboardNotificationCategory dashboardNotificationCategory = new DashboardNotificationCategory();
BeanUtils.copyProperties(optDashboardNotificationCategoryParams,dashboardNotificationCategory);
dashboardNotificationCategory.setUpdatedAt(System.currentTimeMillis());
dashboardNotificationCategory.setUpdatedBy(userId);
DashboardNotificationCategoryExample example = new DashboardNotificationCategoryExample();
DashboardNotificationCategoryExample.Criteria criteria = example.createCriteria();
criteria.andIdEqualTo(optDashboardNotificationCategoryParams.getCategoryId());
dashboardNotificationCategoryMapperExt.updateByExampleSelective(dashboardNotificationCategory, example);
return SimpleDataResponse.success();
} catch (Exception e) {
logger.error("Edit dashboardNotificationCategory error", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "server error");
}
}
/**
* Batch deletes dashboardNotificationCategorys based on the provided dashboardNotificationCategory IDs.
* Performs validation checks on the dashboardNotificationCategory IDs and authorization.
*
* @param deleteDashboardNotificationCategoryParams Parameters containing dashboardNotificationCategory IDs to be deleted
* @param userId ID of the user performing the deletion
* @param companyId ID of the company associated with the dashboardNotificationCategorys
* @param languageType Language type for error messages
* @return SimpleDataResponse indicating success or failure of the batch deletion operation
*/
@Override
@Transactional
public SimpleDataResponse batchDelete(DeleteDashboardNotificationCategoryParams deleteDashboardNotificationCategoryParams, Long userId,
Long companyId, Integer languageType) {
if (StringUtils.isBlank(deleteDashboardNotificationCategoryParams.getCategoryIds())) {
return SimpleDataResponse.success();
}
try {
List<Long> ids = Arrays.asList(StringUtils.split(deleteDashboardNotificationCategoryParams.getCategoryIds(), ",")).stream()
.map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList());
DashboardNotificationCategoryExample dashboardNotificationCategoryExample = new DashboardNotificationCategoryExample();
DashboardNotificationCategoryExample.Criteria criteria = dashboardNotificationCategoryExample.createCriteria();
criteria.andIdIn(ids).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId));
DashboardNotificationCategory dashboardNotificationCategory = new DashboardNotificationCategory();
dashboardNotificationCategory.setFlag(1);
dashboardNotificationCategoryMapperExt.updateByExampleSelective(dashboardNotificationCategory, dashboardNotificationCategoryExample);
return SimpleDataResponse.success();
} catch (Exception e) {
logger.error("Batch delete dashboardNotificationCategory error", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "server error");
}
}
@Override
public PageInfo<DashboardNotificationCategoryPageVO> getListPage(DashboardNotificationCategorySearchParams 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.getCategoryIds())) {
pageSearchParam.setCategoryIdList(CommonUtil.commaStr2LongList(pageSearchParam.getCategoryIds()));
}
PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize());
List<DashboardNotificationCategoryPageVO> resultList = dashboardNotificationCategoryMapperExt.getListPage(pageSearchParam);
return new PageInfo<>(resultList);
}
}

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

@ -145,8 +145,8 @@ public class DashboardNotificationServiceImpl implements DashboardNotificationSe
if(StringUtils.isNotBlank(optDashboardNotificationParams.getDemandTime()) && optDashboardNotificationParams.getDemandTime().length() > 100){ if(StringUtils.isNotBlank(optDashboardNotificationParams.getDemandTime()) && optDashboardNotificationParams.getDemandTime().length() > 100){
throw new MsgCodeException("Parameter error [demandTime]"); throw new MsgCodeException("Parameter error [demandTime]");
} }
if(StringUtils.isNotBlank(optDashboardNotificationParams.getCategory()) && optDashboardNotificationParams.getCategory().length() > 255){ if(null == optDashboardNotificationParams.getCategoryId()){
throw new MsgCodeException("Parameter error [category]"); throw new MsgCodeException("Parameter error [categoryId]");
} }
} }
@ -190,6 +190,8 @@ public class DashboardNotificationServiceImpl implements DashboardNotificationSe
DashboardNotification dashboardNotification = new DashboardNotification(); DashboardNotification dashboardNotification = new DashboardNotification();
BeanUtils.copyProperties(optDashboardNotificationParams,dashboardNotification); BeanUtils.copyProperties(optDashboardNotificationParams,dashboardNotification);
dashboardNotification.setUpdatedAt(System.currentTimeMillis());
dashboardNotification.setUpdatedBy(userId);
DashboardNotificationExample example = new DashboardNotificationExample(); DashboardNotificationExample example = new DashboardNotificationExample();
DashboardNotificationExample.Criteria criteria = example.createCriteria(); DashboardNotificationExample.Criteria criteria = example.createCriteria();

Loading…
Cancel
Save