18 changed files with 2874 additions and 0 deletions
Binary file not shown.
@ -0,0 +1,93 @@ |
|||||
|
package com.techsor.datacenter.business.controller; |
||||
|
|
||||
|
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.facility.FacilityAddParam; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityDeleteParam; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityEditParam; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityQueryParam; |
||||
|
import com.techsor.datacenter.business.service.FacilityService; |
||||
|
import com.techsor.datacenter.business.vo.facility.FacilityPageVO; |
||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||
|
import io.swagger.v3.oas.annotations.Parameter; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
@RestController |
||||
|
@AccessRequired |
||||
|
@RequestMapping("/facility") |
||||
|
@Tag(name = "FacilityController", description = "Facility Management Module - APIs for managing facility information") |
||||
|
@Slf4j |
||||
|
public class FacilityController { |
||||
|
|
||||
|
@Autowired |
||||
|
private FacilityService facilityService; |
||||
|
|
||||
|
@Operation(summary = "Get facility list by param") |
||||
|
@GetMapping(path = "/getListPage") |
||||
|
public PageResponse<PageInfo<FacilityPageVO>> getListPage( |
||||
|
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, |
||||
|
@Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, |
||||
|
@Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, |
||||
|
@Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, |
||||
|
@Parameter(name = "LanguageType", description = "Language type 0: Chinese 1: English 2: Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, |
||||
|
@Parameter(name = "UTCOffset", description = "Offset between GMT and local time in minutes, e.g., -480 for GMT+8") @RequestHeader(required = true) Integer UTCOffset, |
||||
|
FacilityQueryParam param) { |
||||
|
PageResponse<PageInfo<FacilityPageVO>> pageResponse = new PageResponse<>(); |
||||
|
try { |
||||
|
pageResponse.setData(facilityService.query(param, UserId, CompanyId, LanguageType)); |
||||
|
pageResponse.setCode(ResponseCode.SUCCESS); |
||||
|
pageResponse.setMsg("success"); |
||||
|
} catch (Exception e) { |
||||
|
log.error("Error querying facility list", e); |
||||
|
pageResponse.setCode(ResponseCode.SERVER_ERROR); |
||||
|
pageResponse.setMsg("service error"); |
||||
|
} |
||||
|
return pageResponse; |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "Add facility") |
||||
|
@PostMapping(path = "/add") |
||||
|
public SimpleDataResponse add( |
||||
|
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, |
||||
|
@Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, |
||||
|
@Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, |
||||
|
@Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, |
||||
|
@Parameter(name = "LanguageType", description = "Language type 0: Chinese 1: English 2: Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, |
||||
|
@Parameter(name = "UTCOffset", description = "Offset between GMT and local time in minutes, e.g., -480 for GMT+8") @RequestHeader(required = true) Integer UTCOffset, |
||||
|
@RequestBody FacilityAddParam param) { |
||||
|
return facilityService.add(param, UserId, CompanyId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "Edit facility") |
||||
|
@PostMapping(path = "/edit") |
||||
|
public SimpleDataResponse edit( |
||||
|
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, |
||||
|
@Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, |
||||
|
@Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, |
||||
|
@Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, |
||||
|
@Parameter(name = "LanguageType", description = "Language type 0: Chinese 1: English 2: Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, |
||||
|
@Parameter(name = "UTCOffset", description = "Offset between GMT and local time in minutes, e.g., -480 for GMT+8") @RequestHeader(required = true) Integer UTCOffset, |
||||
|
@RequestBody FacilityEditParam param) { |
||||
|
return facilityService.edit(param, UserId, CompanyId, LanguageType); |
||||
|
} |
||||
|
|
||||
|
@Operation(summary = "Batch delete facilities") |
||||
|
@PostMapping(path = "/delete") |
||||
|
public SimpleDataResponse delete( |
||||
|
@Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, |
||||
|
@Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, |
||||
|
@Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, |
||||
|
@Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, |
||||
|
@Parameter(name = "LanguageType", description = "Language type 0: Chinese 1: English 2: Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, |
||||
|
@Parameter(name = "UTCOffset", description = "Offset between GMT and local time in minutes, e.g., -480 for GMT+8") @RequestHeader(required = true) Integer UTCOffset, |
||||
|
@RequestBody FacilityDeleteParam param) { |
||||
|
return facilityService.batchDelete(param, UserId, CompanyId, LanguageType); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
CREATE TABLE `basic_facility` ( |
||||
|
`facility_id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID', |
||||
|
`building_id` bigint NOT NULL COMMENT '关联楼宇ID', |
||||
|
`company_id` bigint DEFAULT NULL COMMENT '企业ID', |
||||
|
`security_company_name` varchar(255) DEFAULT NULL COMMENT '常驻警备公司名称', |
||||
|
`machine_security_company` varchar(255) DEFAULT NULL COMMENT '机械警备公司名称', |
||||
|
`machine_security_tel` varchar(40) DEFAULT NULL COMMENT '机械警备联系电话', |
||||
|
`machine_security_customer_code` varchar(40) DEFAULT NULL COMMENT '机械警备客户代码', |
||||
|
`night_shift_type` varchar(50) DEFAULT NULL COMMENT '夜间体制区分', |
||||
|
`night_guard_count` int DEFAULT NULL COMMENT '夜间常驻人数', |
||||
|
`security_switch_time` varchar(10) DEFAULT NULL COMMENT '常驻→机械 切换时间', |
||||
|
`security_phs` varchar(40) DEFAULT NULL COMMENT '警备员PHS号码', |
||||
|
`mall_security_tel` varchar(40) DEFAULT NULL COMMENT '商场侧警备电话', |
||||
|
`facility_side_type` varchar(50) DEFAULT NULL COMMENT '商场/永旺侧区分', |
||||
|
`ad_direct_tel` varchar(40) DEFAULT NULL COMMENT 'AD直通电话', |
||||
|
`alarm_reception_note` varchar(2000) DEFAULT NULL COMMENT '警报接收特记', |
||||
|
`escalation_flow` varchar(2000) DEFAULT NULL COMMENT '联络流程', |
||||
|
`contract_start_date` date DEFAULT NULL COMMENT '合同开始日', |
||||
|
`open_date` date DEFAULT NULL COMMENT '开业日', |
||||
|
`contract_end_date` date DEFAULT NULL COMMENT '解约日/闭店日', |
||||
|
`legacy_address` varchar(20) DEFAULT NULL COMMENT '旧地址', |
||||
|
`legacy_property_flag` tinyint DEFAULT '0' COMMENT '旧物业标志 0:否 1:是', |
||||
|
`name_change_history` varchar(255) DEFAULT NULL COMMENT '名称变更履历', |
||||
|
`communication_info` varchar(255) DEFAULT NULL COMMENT 'SIM/通信线路', |
||||
|
`nap_time` varchar(20) DEFAULT NULL COMMENT '值班小睡时段', |
||||
|
`note_updated_by` varchar(128) DEFAULT NULL COMMENT '记载者/更新日', |
||||
|
`flag` int DEFAULT '0' COMMENT '删除标记 0:正常 1:已删除', |
||||
|
`create_time` bigint DEFAULT NULL COMMENT '创建时间', |
||||
|
`creator_id` bigint DEFAULT NULL COMMENT '创建人ID', |
||||
|
`modify_time` bigint DEFAULT NULL COMMENT '修改时间', |
||||
|
`modifier_id` bigint DEFAULT NULL COMMENT '修改人ID', |
||||
|
PRIMARY KEY (`facility_id`), |
||||
|
KEY `idx_building_id` (`building_id`), |
||||
|
KEY `idx_company_id` (`company_id`) |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设施信息表'; |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.techsor.datacenter.business.dao.auto; |
||||
|
|
||||
|
import com.techsor.datacenter.business.model.BasicFacility; |
||||
|
import com.techsor.datacenter.business.model.BasicFacilityExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface BasicFacilityMapper { |
||||
|
|
||||
|
long countByExample(BasicFacilityExample example); |
||||
|
|
||||
|
int deleteByExample(BasicFacilityExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long facilityId); |
||||
|
|
||||
|
int insert(BasicFacility record); |
||||
|
|
||||
|
int insertSelective(BasicFacility record); |
||||
|
|
||||
|
List<BasicFacility> selectByExample(BasicFacilityExample example); |
||||
|
|
||||
|
BasicFacility selectByPrimaryKey(Long facilityId); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") BasicFacility record, @Param("example") BasicFacilityExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") BasicFacility record, @Param("example") BasicFacilityExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(BasicFacility record); |
||||
|
|
||||
|
int updateByPrimaryKey(BasicFacility record); |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
package com.techsor.datacenter.business.dao.ex; |
||||
|
|
||||
|
import com.techsor.datacenter.business.dao.auto.BasicFacilityMapper; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityQueryParam; |
||||
|
import com.techsor.datacenter.business.vo.facility.FacilityPageVO; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface BasicFacilityMapperExt extends BasicFacilityMapper { |
||||
|
|
||||
|
List<FacilityPageVO> getListPage(@Param("param") FacilityQueryParam param, @Param("companyId") Long companyId); |
||||
|
} |
||||
@ -0,0 +1,623 @@ |
|||||
|
<?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.BasicFacilityMapper"> |
||||
|
|
||||
|
<resultMap id="BaseResultMap" type="com.techsor.datacenter.business.model.BasicFacility"> |
||||
|
<id column="facility_id" jdbcType="BIGINT" property="facilityId" /> |
||||
|
<result column="building_id" jdbcType="BIGINT" property="buildingId" /> |
||||
|
<result column="company_id" jdbcType="BIGINT" property="companyId" /> |
||||
|
<result column="security_company_name" jdbcType="VARCHAR" property="securityCompanyName" /> |
||||
|
<result column="machine_security_company" jdbcType="VARCHAR" property="machineSecurityCompany" /> |
||||
|
<result column="machine_security_tel" jdbcType="VARCHAR" property="machineSecurityTel" /> |
||||
|
<result column="machine_security_customer_code" jdbcType="VARCHAR" property="machineSecurityCustomerCode" /> |
||||
|
<result column="night_shift_type" jdbcType="VARCHAR" property="nightShiftType" /> |
||||
|
<result column="night_guard_count" jdbcType="INTEGER" property="nightGuardCount" /> |
||||
|
<result column="security_switch_time" jdbcType="VARCHAR" property="securitySwitchTime" /> |
||||
|
<result column="security_phs" jdbcType="VARCHAR" property="securityPhs" /> |
||||
|
<result column="mall_security_tel" jdbcType="VARCHAR" property="mallSecurityTel" /> |
||||
|
<result column="facility_side_type" jdbcType="VARCHAR" property="facilitySideType" /> |
||||
|
<result column="ad_direct_tel" jdbcType="VARCHAR" property="adDirectTel" /> |
||||
|
<result column="alarm_reception_note" jdbcType="VARCHAR" property="alarmReceptionNote" /> |
||||
|
<result column="escalation_flow" jdbcType="VARCHAR" property="escalationFlow" /> |
||||
|
<result column="contract_start_date" jdbcType="DATE" property="contractStartDate" /> |
||||
|
<result column="open_date" jdbcType="DATE" property="openDate" /> |
||||
|
<result column="contract_end_date" jdbcType="DATE" property="contractEndDate" /> |
||||
|
<result column="legacy_address" jdbcType="VARCHAR" property="legacyAddress" /> |
||||
|
<result column="legacy_property_flag" jdbcType="TINYINT" property="legacyPropertyFlag" /> |
||||
|
<result column="name_change_history" jdbcType="VARCHAR" property="nameChangeHistory" /> |
||||
|
<result column="communication_info" jdbcType="VARCHAR" property="communicationInfo" /> |
||||
|
<result column="nap_time" jdbcType="VARCHAR" property="napTime" /> |
||||
|
<result column="note_updated_by" jdbcType="VARCHAR" property="noteUpdatedBy" /> |
||||
|
<result column="flag" jdbcType="INTEGER" property="flag" /> |
||||
|
<result column="create_time" jdbcType="BIGINT" property="createTime" /> |
||||
|
<result column="creator_id" jdbcType="BIGINT" property="creatorId" /> |
||||
|
<result column="modify_time" jdbcType="BIGINT" property="modifyTime" /> |
||||
|
<result column="modifier_id" jdbcType="BIGINT" property="modifierId" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<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"> |
||||
|
<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"> |
||||
|
facility_id, building_id, company_id, security_company_name, machine_security_company, |
||||
|
machine_security_tel, machine_security_customer_code, night_shift_type, night_guard_count, |
||||
|
security_switch_time, security_phs, mall_security_tel, facility_side_type, ad_direct_tel, |
||||
|
alarm_reception_note, escalation_flow, contract_start_date, open_date, contract_end_date, |
||||
|
legacy_address, legacy_property_flag, name_change_history, communication_info, nap_time, |
||||
|
note_updated_by, flag, create_time, creator_id, modify_time, modifier_id |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectByExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from basic_facility |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from basic_facility |
||||
|
where facility_id = #{facilityId,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
|
||||
|
<delete id="deleteByPrimaryKey"> |
||||
|
delete from basic_facility |
||||
|
where facility_id = #{facilityId,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteByExample"> |
||||
|
delete from basic_facility |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
|
||||
|
<insert id="insert" parameterType="com.techsor.datacenter.business.model.BasicFacility"> |
||||
|
insert into basic_facility (facility_id, building_id, company_id, |
||||
|
security_company_name, machine_security_company, machine_security_tel, |
||||
|
machine_security_customer_code, night_shift_type, night_guard_count, |
||||
|
security_switch_time, security_phs, mall_security_tel, |
||||
|
facility_side_type, ad_direct_tel, alarm_reception_note, |
||||
|
escalation_flow, contract_start_date, open_date, |
||||
|
contract_end_date, legacy_address, legacy_property_flag, |
||||
|
name_change_history, communication_info, nap_time, |
||||
|
note_updated_by, flag, create_time, |
||||
|
creator_id, modify_time, modifier_id) |
||||
|
values (#{facilityId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, |
||||
|
#{securityCompanyName,jdbcType=VARCHAR}, #{machineSecurityCompany,jdbcType=VARCHAR}, #{machineSecurityTel,jdbcType=VARCHAR}, |
||||
|
#{machineSecurityCustomerCode,jdbcType=VARCHAR}, #{nightShiftType,jdbcType=VARCHAR}, #{nightGuardCount,jdbcType=INTEGER}, |
||||
|
#{securitySwitchTime,jdbcType=VARCHAR}, #{securityPhs,jdbcType=VARCHAR}, #{mallSecurityTel,jdbcType=VARCHAR}, |
||||
|
#{facilitySideType,jdbcType=VARCHAR}, #{adDirectTel,jdbcType=VARCHAR}, #{alarmReceptionNote,jdbcType=VARCHAR}, |
||||
|
#{escalationFlow,jdbcType=VARCHAR}, #{contractStartDate,jdbcType=DATE}, #{openDate,jdbcType=DATE}, |
||||
|
#{contractEndDate,jdbcType=DATE}, #{legacyAddress,jdbcType=VARCHAR}, #{legacyPropertyFlag,jdbcType=TINYINT}, |
||||
|
#{nameChangeHistory,jdbcType=VARCHAR}, #{communicationInfo,jdbcType=VARCHAR}, #{napTime,jdbcType=VARCHAR}, |
||||
|
#{noteUpdatedBy,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, |
||||
|
#{creatorId,jdbcType=BIGINT}, #{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT}) |
||||
|
</insert> |
||||
|
|
||||
|
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.BasicFacility"> |
||||
|
insert into basic_facility |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="facilityId != null"> |
||||
|
facility_id, |
||||
|
</if> |
||||
|
<if test="buildingId != null"> |
||||
|
building_id, |
||||
|
</if> |
||||
|
<if test="companyId != null"> |
||||
|
company_id, |
||||
|
</if> |
||||
|
<if test="securityCompanyName != null"> |
||||
|
security_company_name, |
||||
|
</if> |
||||
|
<if test="machineSecurityCompany != null"> |
||||
|
machine_security_company, |
||||
|
</if> |
||||
|
<if test="machineSecurityTel != null"> |
||||
|
machine_security_tel, |
||||
|
</if> |
||||
|
<if test="machineSecurityCustomerCode != null"> |
||||
|
machine_security_customer_code, |
||||
|
</if> |
||||
|
<if test="nightShiftType != null"> |
||||
|
night_shift_type, |
||||
|
</if> |
||||
|
<if test="nightGuardCount != null"> |
||||
|
night_guard_count, |
||||
|
</if> |
||||
|
<if test="securitySwitchTime != null"> |
||||
|
security_switch_time, |
||||
|
</if> |
||||
|
<if test="securityPhs != null"> |
||||
|
security_phs, |
||||
|
</if> |
||||
|
<if test="mallSecurityTel != null"> |
||||
|
mall_security_tel, |
||||
|
</if> |
||||
|
<if test="facilitySideType != null"> |
||||
|
facility_side_type, |
||||
|
</if> |
||||
|
<if test="adDirectTel != null"> |
||||
|
ad_direct_tel, |
||||
|
</if> |
||||
|
<if test="alarmReceptionNote != null"> |
||||
|
alarm_reception_note, |
||||
|
</if> |
||||
|
<if test="escalationFlow != null"> |
||||
|
escalation_flow, |
||||
|
</if> |
||||
|
<if test="contractStartDate != null"> |
||||
|
contract_start_date, |
||||
|
</if> |
||||
|
<if test="openDate != null"> |
||||
|
open_date, |
||||
|
</if> |
||||
|
<if test="contractEndDate != null"> |
||||
|
contract_end_date, |
||||
|
</if> |
||||
|
<if test="legacyAddress != null"> |
||||
|
legacy_address, |
||||
|
</if> |
||||
|
<if test="legacyPropertyFlag != null"> |
||||
|
legacy_property_flag, |
||||
|
</if> |
||||
|
<if test="nameChangeHistory != null"> |
||||
|
name_change_history, |
||||
|
</if> |
||||
|
<if test="communicationInfo != null"> |
||||
|
communication_info, |
||||
|
</if> |
||||
|
<if test="napTime != null"> |
||||
|
nap_time, |
||||
|
</if> |
||||
|
<if test="noteUpdatedBy != null"> |
||||
|
note_updated_by, |
||||
|
</if> |
||||
|
<if test="flag != null"> |
||||
|
flag, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
create_time, |
||||
|
</if> |
||||
|
<if test="creatorId != null"> |
||||
|
creator_id, |
||||
|
</if> |
||||
|
<if test="modifyTime != null"> |
||||
|
modify_time, |
||||
|
</if> |
||||
|
<if test="modifierId != null"> |
||||
|
modifier_id, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="facilityId != null"> |
||||
|
#{facilityId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="buildingId != null"> |
||||
|
#{buildingId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="companyId != null"> |
||||
|
#{companyId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="securityCompanyName != null"> |
||||
|
#{securityCompanyName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="machineSecurityCompany != null"> |
||||
|
#{machineSecurityCompany,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="machineSecurityTel != null"> |
||||
|
#{machineSecurityTel,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="machineSecurityCustomerCode != null"> |
||||
|
#{machineSecurityCustomerCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="nightShiftType != null"> |
||||
|
#{nightShiftType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="nightGuardCount != null"> |
||||
|
#{nightGuardCount,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="securitySwitchTime != null"> |
||||
|
#{securitySwitchTime,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="securityPhs != null"> |
||||
|
#{securityPhs,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="mallSecurityTel != null"> |
||||
|
#{mallSecurityTel,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="facilitySideType != null"> |
||||
|
#{facilitySideType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="adDirectTel != null"> |
||||
|
#{adDirectTel,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="alarmReceptionNote != null"> |
||||
|
#{alarmReceptionNote,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="escalationFlow != null"> |
||||
|
#{escalationFlow,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="contractStartDate != null"> |
||||
|
#{contractStartDate,jdbcType=DATE}, |
||||
|
</if> |
||||
|
<if test="openDate != null"> |
||||
|
#{openDate,jdbcType=DATE}, |
||||
|
</if> |
||||
|
<if test="contractEndDate != null"> |
||||
|
#{contractEndDate,jdbcType=DATE}, |
||||
|
</if> |
||||
|
<if test="legacyAddress != null"> |
||||
|
#{legacyAddress,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="legacyPropertyFlag != null"> |
||||
|
#{legacyPropertyFlag,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="nameChangeHistory != null"> |
||||
|
#{nameChangeHistory,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="communicationInfo != null"> |
||||
|
#{communicationInfo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="napTime != null"> |
||||
|
#{napTime,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="noteUpdatedBy != null"> |
||||
|
#{noteUpdatedBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="flag != null"> |
||||
|
#{flag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
#{createTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="creatorId != null"> |
||||
|
#{creatorId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="modifyTime != null"> |
||||
|
#{modifyTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="modifierId != null"> |
||||
|
#{modifierId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<select id="countByExample" resultType="java.lang.Long"> |
||||
|
select count(*) from basic_facility |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
|
||||
|
<update id="updateByExampleSelective"> |
||||
|
update basic_facility |
||||
|
<set> |
||||
|
<if test="record.facilityId != null"> |
||||
|
facility_id = #{record.facilityId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.buildingId != null"> |
||||
|
building_id = #{record.buildingId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.companyId != null"> |
||||
|
company_id = #{record.companyId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.securityCompanyName != null"> |
||||
|
security_company_name = #{record.securityCompanyName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.machineSecurityCompany != null"> |
||||
|
machine_security_company = #{record.machineSecurityCompany,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.machineSecurityTel != null"> |
||||
|
machine_security_tel = #{record.machineSecurityTel,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.machineSecurityCustomerCode != null"> |
||||
|
machine_security_customer_code = #{record.machineSecurityCustomerCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.nightShiftType != null"> |
||||
|
night_shift_type = #{record.nightShiftType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.nightGuardCount != null"> |
||||
|
night_guard_count = #{record.nightGuardCount,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="record.securitySwitchTime != null"> |
||||
|
security_switch_time = #{record.securitySwitchTime,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.securityPhs != null"> |
||||
|
security_phs = #{record.securityPhs,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.mallSecurityTel != null"> |
||||
|
mall_security_tel = #{record.mallSecurityTel,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.facilitySideType != null"> |
||||
|
facility_side_type = #{record.facilitySideType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.adDirectTel != null"> |
||||
|
ad_direct_tel = #{record.adDirectTel,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.alarmReceptionNote != null"> |
||||
|
alarm_reception_note = #{record.alarmReceptionNote,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.escalationFlow != null"> |
||||
|
escalation_flow = #{record.escalationFlow,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.contractStartDate != null"> |
||||
|
contract_start_date = #{record.contractStartDate,jdbcType=DATE}, |
||||
|
</if> |
||||
|
<if test="record.openDate != null"> |
||||
|
open_date = #{record.openDate,jdbcType=DATE}, |
||||
|
</if> |
||||
|
<if test="record.contractEndDate != null"> |
||||
|
contract_end_date = #{record.contractEndDate,jdbcType=DATE}, |
||||
|
</if> |
||||
|
<if test="record.legacyAddress != null"> |
||||
|
legacy_address = #{record.legacyAddress,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.legacyPropertyFlag != null"> |
||||
|
legacy_property_flag = #{record.legacyPropertyFlag,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="record.nameChangeHistory != null"> |
||||
|
name_change_history = #{record.nameChangeHistory,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.communicationInfo != null"> |
||||
|
communication_info = #{record.communicationInfo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.napTime != null"> |
||||
|
nap_time = #{record.napTime,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.noteUpdatedBy != null"> |
||||
|
note_updated_by = #{record.noteUpdatedBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.flag != null"> |
||||
|
flag = #{record.flag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="record.createTime != null"> |
||||
|
create_time = #{record.createTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.creatorId != null"> |
||||
|
creator_id = #{record.creatorId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.modifyTime != null"> |
||||
|
modify_time = #{record.modifyTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.modifierId != null"> |
||||
|
modifier_id = #{record.modifierId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
|
||||
|
<update id="updateByExample"> |
||||
|
update basic_facility |
||||
|
set facility_id = #{record.facilityId,jdbcType=BIGINT}, |
||||
|
building_id = #{record.buildingId,jdbcType=BIGINT}, |
||||
|
company_id = #{record.companyId,jdbcType=BIGINT}, |
||||
|
security_company_name = #{record.securityCompanyName,jdbcType=VARCHAR}, |
||||
|
machine_security_company = #{record.machineSecurityCompany,jdbcType=VARCHAR}, |
||||
|
machine_security_tel = #{record.machineSecurityTel,jdbcType=VARCHAR}, |
||||
|
machine_security_customer_code = #{record.machineSecurityCustomerCode,jdbcType=VARCHAR}, |
||||
|
night_shift_type = #{record.nightShiftType,jdbcType=VARCHAR}, |
||||
|
night_guard_count = #{record.nightGuardCount,jdbcType=INTEGER}, |
||||
|
security_switch_time = #{record.securitySwitchTime,jdbcType=VARCHAR}, |
||||
|
security_phs = #{record.securityPhs,jdbcType=VARCHAR}, |
||||
|
mall_security_tel = #{record.mallSecurityTel,jdbcType=VARCHAR}, |
||||
|
facility_side_type = #{record.facilitySideType,jdbcType=VARCHAR}, |
||||
|
ad_direct_tel = #{record.adDirectTel,jdbcType=VARCHAR}, |
||||
|
alarm_reception_note = #{record.alarmReceptionNote,jdbcType=VARCHAR}, |
||||
|
escalation_flow = #{record.escalationFlow,jdbcType=VARCHAR}, |
||||
|
contract_start_date = #{record.contractStartDate,jdbcType=DATE}, |
||||
|
open_date = #{record.openDate,jdbcType=DATE}, |
||||
|
contract_end_date = #{record.contractEndDate,jdbcType=DATE}, |
||||
|
legacy_address = #{record.legacyAddress,jdbcType=VARCHAR}, |
||||
|
legacy_property_flag = #{record.legacyPropertyFlag,jdbcType=TINYINT}, |
||||
|
name_change_history = #{record.nameChangeHistory,jdbcType=VARCHAR}, |
||||
|
communication_info = #{record.communicationInfo,jdbcType=VARCHAR}, |
||||
|
nap_time = #{record.napTime,jdbcType=VARCHAR}, |
||||
|
note_updated_by = #{record.noteUpdatedBy,jdbcType=VARCHAR}, |
||||
|
flag = #{record.flag,jdbcType=INTEGER}, |
||||
|
create_time = #{record.createTime,jdbcType=BIGINT}, |
||||
|
creator_id = #{record.creatorId,jdbcType=BIGINT}, |
||||
|
modify_time = #{record.modifyTime,jdbcType=BIGINT}, |
||||
|
modifier_id = #{record.modifierId,jdbcType=BIGINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
|
||||
|
<update id="updateByPrimaryKeySelective"> |
||||
|
update basic_facility |
||||
|
<set> |
||||
|
<if test="buildingId != null"> |
||||
|
building_id = #{buildingId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="companyId != null"> |
||||
|
company_id = #{companyId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="securityCompanyName != null"> |
||||
|
security_company_name = #{securityCompanyName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="machineSecurityCompany != null"> |
||||
|
machine_security_company = #{machineSecurityCompany,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="machineSecurityTel != null"> |
||||
|
machine_security_tel = #{machineSecurityTel,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="machineSecurityCustomerCode != null"> |
||||
|
machine_security_customer_code = #{machineSecurityCustomerCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="nightShiftType != null"> |
||||
|
night_shift_type = #{nightShiftType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="nightGuardCount != null"> |
||||
|
night_guard_count = #{nightGuardCount,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="securitySwitchTime != null"> |
||||
|
security_switch_time = #{securitySwitchTime,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="securityPhs != null"> |
||||
|
security_phs = #{securityPhs,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="mallSecurityTel != null"> |
||||
|
mall_security_tel = #{mallSecurityTel,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="facilitySideType != null"> |
||||
|
facility_side_type = #{facilitySideType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="adDirectTel != null"> |
||||
|
ad_direct_tel = #{adDirectTel,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="alarmReceptionNote != null"> |
||||
|
alarm_reception_note = #{alarmReceptionNote,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="escalationFlow != null"> |
||||
|
escalation_flow = #{escalationFlow,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="contractStartDate != null"> |
||||
|
contract_start_date = #{contractStartDate,jdbcType=DATE}, |
||||
|
</if> |
||||
|
<if test="openDate != null"> |
||||
|
open_date = #{openDate,jdbcType=DATE}, |
||||
|
</if> |
||||
|
<if test="contractEndDate != null"> |
||||
|
contract_end_date = #{contractEndDate,jdbcType=DATE}, |
||||
|
</if> |
||||
|
<if test="legacyAddress != null"> |
||||
|
legacy_address = #{legacyAddress,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="legacyPropertyFlag != null"> |
||||
|
legacy_property_flag = #{legacyPropertyFlag,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="nameChangeHistory != null"> |
||||
|
name_change_history = #{nameChangeHistory,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="communicationInfo != null"> |
||||
|
communication_info = #{communicationInfo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="napTime != null"> |
||||
|
nap_time = #{napTime,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="noteUpdatedBy != null"> |
||||
|
note_updated_by = #{noteUpdatedBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="flag != null"> |
||||
|
flag = #{flag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
create_time = #{createTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="creatorId != null"> |
||||
|
creator_id = #{creatorId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="modifyTime != null"> |
||||
|
modify_time = #{modifyTime,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="modifierId != null"> |
||||
|
modifier_id = #{modifierId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where facility_id = #{facilityId,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
|
||||
|
<update id="updateByPrimaryKey"> |
||||
|
update basic_facility |
||||
|
set building_id = #{buildingId,jdbcType=BIGINT}, |
||||
|
company_id = #{companyId,jdbcType=BIGINT}, |
||||
|
security_company_name = #{securityCompanyName,jdbcType=VARCHAR}, |
||||
|
machine_security_company = #{machineSecurityCompany,jdbcType=VARCHAR}, |
||||
|
machine_security_tel = #{machineSecurityTel,jdbcType=VARCHAR}, |
||||
|
machine_security_customer_code = #{machineSecurityCustomerCode,jdbcType=VARCHAR}, |
||||
|
night_shift_type = #{nightShiftType,jdbcType=VARCHAR}, |
||||
|
night_guard_count = #{nightGuardCount,jdbcType=INTEGER}, |
||||
|
security_switch_time = #{securitySwitchTime,jdbcType=VARCHAR}, |
||||
|
security_phs = #{securityPhs,jdbcType=VARCHAR}, |
||||
|
mall_security_tel = #{mallSecurityTel,jdbcType=VARCHAR}, |
||||
|
facility_side_type = #{facilitySideType,jdbcType=VARCHAR}, |
||||
|
ad_direct_tel = #{adDirectTel,jdbcType=VARCHAR}, |
||||
|
alarm_reception_note = #{alarmReceptionNote,jdbcType=VARCHAR}, |
||||
|
escalation_flow = #{escalationFlow,jdbcType=VARCHAR}, |
||||
|
contract_start_date = #{contractStartDate,jdbcType=DATE}, |
||||
|
open_date = #{openDate,jdbcType=DATE}, |
||||
|
contract_end_date = #{contractEndDate,jdbcType=DATE}, |
||||
|
legacy_address = #{legacyAddress,jdbcType=VARCHAR}, |
||||
|
legacy_property_flag = #{legacyPropertyFlag,jdbcType=TINYINT}, |
||||
|
name_change_history = #{nameChangeHistory,jdbcType=VARCHAR}, |
||||
|
communication_info = #{communicationInfo,jdbcType=VARCHAR}, |
||||
|
nap_time = #{napTime,jdbcType=VARCHAR}, |
||||
|
note_updated_by = #{noteUpdatedBy,jdbcType=VARCHAR}, |
||||
|
flag = #{flag,jdbcType=INTEGER}, |
||||
|
create_time = #{createTime,jdbcType=BIGINT}, |
||||
|
creator_id = #{creatorId,jdbcType=BIGINT}, |
||||
|
modify_time = #{modifyTime,jdbcType=BIGINT}, |
||||
|
modifier_id = #{modifierId,jdbcType=BIGINT} |
||||
|
where facility_id = #{facilityId,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,54 @@ |
|||||
|
<?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.BasicFacilityMapperExt"> |
||||
|
|
||||
|
<select id="getListPage" resultType="com.techsor.datacenter.business.vo.facility.FacilityPageVO"> |
||||
|
select |
||||
|
bf.facility_id as facilityId, |
||||
|
bf.building_id as buildingId, |
||||
|
bb.name as buildingName, |
||||
|
bf.company_id as companyId, |
||||
|
bf.security_company_name as securityCompanyName, |
||||
|
bf.machine_security_company as machineSecurityCompany, |
||||
|
bf.machine_security_tel as machineSecurityTel, |
||||
|
bf.machine_security_customer_code as machineSecurityCustomerCode, |
||||
|
bf.night_shift_type as nightShiftType, |
||||
|
bf.night_guard_count as nightGuardCount, |
||||
|
bf.security_switch_time as securitySwitchTime, |
||||
|
bf.security_phs as securityPhs, |
||||
|
bf.mall_security_tel as mallSecurityTel, |
||||
|
bf.facility_side_type as facilitySideType, |
||||
|
bf.ad_direct_tel as adDirectTel, |
||||
|
bf.alarm_reception_note as alarmReceptionNote, |
||||
|
bf.escalation_flow as escalationFlow, |
||||
|
bf.contract_start_date as contractStartDate, |
||||
|
bf.open_date as openDate, |
||||
|
bf.contract_end_date as contractEndDate, |
||||
|
bf.legacy_address as legacyAddress, |
||||
|
bf.legacy_property_flag as legacyPropertyFlag, |
||||
|
bf.name_change_history as nameChangeHistory, |
||||
|
bf.communication_info as communicationInfo, |
||||
|
bf.nap_time as napTime, |
||||
|
bf.note_updated_by as noteUpdatedBy |
||||
|
from |
||||
|
basic_facility bf |
||||
|
left join basic_building bb on bf.building_id = bb.building_id |
||||
|
<where> |
||||
|
<if test="param.buildingId != null"> |
||||
|
and bf.building_id = #{param.buildingId} |
||||
|
</if> |
||||
|
<if test="param.securityCompanyName != null and param.securityCompanyName != ''"> |
||||
|
and bf.security_company_name like CONCAT('%',#{param.securityCompanyName},'%') |
||||
|
</if> |
||||
|
<if test="param.machineSecurityCompany != null and param.machineSecurityCompany != ''"> |
||||
|
and bf.machine_security_company like CONCAT('%',#{param.machineSecurityCompany},'%') |
||||
|
</if> |
||||
|
and bf.flag = 0 |
||||
|
<if test="companyId != null"> |
||||
|
and bf.company_id = #{companyId} |
||||
|
</if> |
||||
|
</where> |
||||
|
order by bf.facility_id desc |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,77 @@ |
|||||
|
package com.techsor.datacenter.business.dto.facility; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class FacilityAddParam { |
||||
|
|
||||
|
@Schema(description = "楼宇ID", example = "1", required = true) |
||||
|
private Long buildingId; |
||||
|
|
||||
|
@Schema(description = "常驻警备公司名称", example = "ABC Security") |
||||
|
private String securityCompanyName; |
||||
|
|
||||
|
@Schema(description = "机械警备公司名称", example = "XYZ Machine Security") |
||||
|
private String machineSecurityCompany; |
||||
|
|
||||
|
@Schema(description = "机械警备联系电话", example = "03-1234-5678") |
||||
|
private String machineSecurityTel; |
||||
|
|
||||
|
@Schema(description = "机械警备客户代码", example = "CUST001") |
||||
|
private String machineSecurityCustomerCode; |
||||
|
|
||||
|
@Schema(description = "夜间体制区分", example = "A") |
||||
|
private String nightShiftType; |
||||
|
|
||||
|
@Schema(description = "夜间常驻人数", example = "2") |
||||
|
private Integer nightGuardCount; |
||||
|
|
||||
|
@Schema(description = "常驻→机械 切换时间", example = "22:00") |
||||
|
private String securitySwitchTime; |
||||
|
|
||||
|
@Schema(description = "警备员PHS号码", example = "070-1234-5678") |
||||
|
private String securityPhs; |
||||
|
|
||||
|
@Schema(description = "商场侧警备电话", example = "03-8765-4321") |
||||
|
private String mallSecurityTel; |
||||
|
|
||||
|
@Schema(description = "商场/永旺侧区分", example = "Mall") |
||||
|
private String facilitySideType; |
||||
|
|
||||
|
@Schema(description = "AD直通电话", example = "03-1111-2222") |
||||
|
private String adDirectTel; |
||||
|
|
||||
|
@Schema(description = "警报接收特记", example = "注意事项...") |
||||
|
private String alarmReceptionNote; |
||||
|
|
||||
|
@Schema(description = "联络流程", example = "联络流程说明...") |
||||
|
private String escalationFlow; |
||||
|
|
||||
|
@Schema(description = "合同开始日", example = "2024-01-01") |
||||
|
private String contractStartDate; |
||||
|
|
||||
|
@Schema(description = "开业日", example = "2024-04-01") |
||||
|
private String openDate; |
||||
|
|
||||
|
@Schema(description = "解约日/闭店日", example = "2025-12-31") |
||||
|
private String contractEndDate; |
||||
|
|
||||
|
@Schema(description = "旧地址", example = "旧地址信息") |
||||
|
private String legacyAddress; |
||||
|
|
||||
|
@Schema(description = "旧物业标志 0:否 1:是", example = "0") |
||||
|
private Integer legacyPropertyFlag; |
||||
|
|
||||
|
@Schema(description = "名称变更履历", example = "变更履历...") |
||||
|
private String nameChangeHistory; |
||||
|
|
||||
|
@Schema(description = "SIM/通信线路", example = "通信线路信息") |
||||
|
private String communicationInfo; |
||||
|
|
||||
|
@Schema(description = "值班小睡时段", example = "23:00-06:00") |
||||
|
private String napTime; |
||||
|
|
||||
|
@Schema(description = "记载者/更新日", example = "张三") |
||||
|
private String noteUpdatedBy; |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
package com.techsor.datacenter.business.dto.facility; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class FacilityDeleteParam { |
||||
|
|
||||
|
@Schema(description = "设施ID, 逗号分隔", example = "1,2,3") |
||||
|
private String facilityIds; |
||||
|
} |
||||
@ -0,0 +1,80 @@ |
|||||
|
package com.techsor.datacenter.business.dto.facility; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class FacilityEditParam { |
||||
|
|
||||
|
@Schema(description = "设施ID", example = "1", required = true) |
||||
|
private Long facilityId; |
||||
|
|
||||
|
@Schema(description = "楼宇ID", example = "1") |
||||
|
private Long buildingId; |
||||
|
|
||||
|
@Schema(description = "常驻警备公司名称", example = "ABC Security") |
||||
|
private String securityCompanyName; |
||||
|
|
||||
|
@Schema(description = "机械警备公司名称", example = "XYZ Machine Security") |
||||
|
private String machineSecurityCompany; |
||||
|
|
||||
|
@Schema(description = "机械警备联系电话", example = "03-1234-5678") |
||||
|
private String machineSecurityTel; |
||||
|
|
||||
|
@Schema(description = "机械警备客户代码", example = "CUST001") |
||||
|
private String machineSecurityCustomerCode; |
||||
|
|
||||
|
@Schema(description = "夜间体制区分", example = "A") |
||||
|
private String nightShiftType; |
||||
|
|
||||
|
@Schema(description = "夜间常驻人数", example = "2") |
||||
|
private Integer nightGuardCount; |
||||
|
|
||||
|
@Schema(description = "常驻→机械 切换时间", example = "22:00") |
||||
|
private String securitySwitchTime; |
||||
|
|
||||
|
@Schema(description = "警备员PHS号码", example = "070-1234-5678") |
||||
|
private String securityPhs; |
||||
|
|
||||
|
@Schema(description = "商场侧警备电话", example = "03-8765-4321") |
||||
|
private String mallSecurityTel; |
||||
|
|
||||
|
@Schema(description = "商场/永旺侧区分", example = "Mall") |
||||
|
private String facilitySideType; |
||||
|
|
||||
|
@Schema(description = "AD直通电话", example = "03-1111-2222") |
||||
|
private String adDirectTel; |
||||
|
|
||||
|
@Schema(description = "警报接收特记", example = "注意事项...") |
||||
|
private String alarmReceptionNote; |
||||
|
|
||||
|
@Schema(description = "联络流程", example = "联络流程说明...") |
||||
|
private String escalationFlow; |
||||
|
|
||||
|
@Schema(description = "合同开始日", example = "2024-01-01") |
||||
|
private String contractStartDate; |
||||
|
|
||||
|
@Schema(description = "开业日", example = "2024-04-01") |
||||
|
private String openDate; |
||||
|
|
||||
|
@Schema(description = "解约日/闭店日", example = "2025-12-31") |
||||
|
private String contractEndDate; |
||||
|
|
||||
|
@Schema(description = "旧地址", example = "旧地址信息") |
||||
|
private String legacyAddress; |
||||
|
|
||||
|
@Schema(description = "旧物业标志 0:否 1:是", example = "0") |
||||
|
private Integer legacyPropertyFlag; |
||||
|
|
||||
|
@Schema(description = "名称变更履历", example = "变更履历...") |
||||
|
private String nameChangeHistory; |
||||
|
|
||||
|
@Schema(description = "SIM/通信线路", example = "通信线路信息") |
||||
|
private String communicationInfo; |
||||
|
|
||||
|
@Schema(description = "值班小睡时段", example = "23:00-06:00") |
||||
|
private String napTime; |
||||
|
|
||||
|
@Schema(description = "记载者/更新日", example = "张三") |
||||
|
private String noteUpdatedBy; |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.techsor.datacenter.business.dto.facility; |
||||
|
|
||||
|
import com.techsor.datacenter.business.dto.BaseSearchParams; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class FacilityQueryParam extends BaseSearchParams { |
||||
|
|
||||
|
@Schema(description = "楼宇ID", example = "1") |
||||
|
private Long buildingId; |
||||
|
|
||||
|
@Schema(description = "常驻警备公司名称关键字", example = "ABC") |
||||
|
private String securityCompanyName; |
||||
|
|
||||
|
@Schema(description = "机械警备公司名称关键字", example = "XYZ") |
||||
|
private String machineSecurityCompany; |
||||
|
} |
||||
@ -0,0 +1,279 @@ |
|||||
|
package com.techsor.datacenter.business.model; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class BasicFacility implements Serializable { |
||||
|
private Long facilityId; |
||||
|
private Long buildingId; |
||||
|
private Long companyId; |
||||
|
private String securityCompanyName; |
||||
|
private String machineSecurityCompany; |
||||
|
private String machineSecurityTel; |
||||
|
private String machineSecurityCustomerCode; |
||||
|
private String nightShiftType; |
||||
|
private Integer nightGuardCount; |
||||
|
private String securitySwitchTime; |
||||
|
private String securityPhs; |
||||
|
private String mallSecurityTel; |
||||
|
private String facilitySideType; |
||||
|
private String adDirectTel; |
||||
|
private String alarmReceptionNote; |
||||
|
private String escalationFlow; |
||||
|
private Date contractStartDate; |
||||
|
private Date openDate; |
||||
|
private Date contractEndDate; |
||||
|
private String legacyAddress; |
||||
|
private Integer legacyPropertyFlag; |
||||
|
private String nameChangeHistory; |
||||
|
private String communicationInfo; |
||||
|
private String napTime; |
||||
|
private String noteUpdatedBy; |
||||
|
private Integer flag; |
||||
|
private Long createTime; |
||||
|
private Long creatorId; |
||||
|
private Long modifyTime; |
||||
|
private Long modifierId; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getFacilityId() { |
||||
|
return facilityId; |
||||
|
} |
||||
|
|
||||
|
public void setFacilityId(Long facilityId) { |
||||
|
this.facilityId = facilityId; |
||||
|
} |
||||
|
|
||||
|
public Long getBuildingId() { |
||||
|
return buildingId; |
||||
|
} |
||||
|
|
||||
|
public void setBuildingId(Long buildingId) { |
||||
|
this.buildingId = buildingId; |
||||
|
} |
||||
|
|
||||
|
public Long getCompanyId() { |
||||
|
return companyId; |
||||
|
} |
||||
|
|
||||
|
public void setCompanyId(Long companyId) { |
||||
|
this.companyId = companyId; |
||||
|
} |
||||
|
|
||||
|
public String getSecurityCompanyName() { |
||||
|
return securityCompanyName; |
||||
|
} |
||||
|
|
||||
|
public void setSecurityCompanyName(String securityCompanyName) { |
||||
|
this.securityCompanyName = securityCompanyName; |
||||
|
} |
||||
|
|
||||
|
public String getMachineSecurityCompany() { |
||||
|
return machineSecurityCompany; |
||||
|
} |
||||
|
|
||||
|
public void setMachineSecurityCompany(String machineSecurityCompany) { |
||||
|
this.machineSecurityCompany = machineSecurityCompany; |
||||
|
} |
||||
|
|
||||
|
public String getMachineSecurityTel() { |
||||
|
return machineSecurityTel; |
||||
|
} |
||||
|
|
||||
|
public void setMachineSecurityTel(String machineSecurityTel) { |
||||
|
this.machineSecurityTel = machineSecurityTel; |
||||
|
} |
||||
|
|
||||
|
public String getMachineSecurityCustomerCode() { |
||||
|
return machineSecurityCustomerCode; |
||||
|
} |
||||
|
|
||||
|
public void setMachineSecurityCustomerCode(String machineSecurityCustomerCode) { |
||||
|
this.machineSecurityCustomerCode = machineSecurityCustomerCode; |
||||
|
} |
||||
|
|
||||
|
public String getNightShiftType() { |
||||
|
return nightShiftType; |
||||
|
} |
||||
|
|
||||
|
public void setNightShiftType(String nightShiftType) { |
||||
|
this.nightShiftType = nightShiftType; |
||||
|
} |
||||
|
|
||||
|
public Integer getNightGuardCount() { |
||||
|
return nightGuardCount; |
||||
|
} |
||||
|
|
||||
|
public void setNightGuardCount(Integer nightGuardCount) { |
||||
|
this.nightGuardCount = nightGuardCount; |
||||
|
} |
||||
|
|
||||
|
public String getSecuritySwitchTime() { |
||||
|
return securitySwitchTime; |
||||
|
} |
||||
|
|
||||
|
public void setSecuritySwitchTime(String securitySwitchTime) { |
||||
|
this.securitySwitchTime = securitySwitchTime; |
||||
|
} |
||||
|
|
||||
|
public String getSecurityPhs() { |
||||
|
return securityPhs; |
||||
|
} |
||||
|
|
||||
|
public void setSecurityPhs(String securityPhs) { |
||||
|
this.securityPhs = securityPhs; |
||||
|
} |
||||
|
|
||||
|
public String getMallSecurityTel() { |
||||
|
return mallSecurityTel; |
||||
|
} |
||||
|
|
||||
|
public void setMallSecurityTel(String mallSecurityTel) { |
||||
|
this.mallSecurityTel = mallSecurityTel; |
||||
|
} |
||||
|
|
||||
|
public String getFacilitySideType() { |
||||
|
return facilitySideType; |
||||
|
} |
||||
|
|
||||
|
public void setFacilitySideType(String facilitySideType) { |
||||
|
this.facilitySideType = facilitySideType; |
||||
|
} |
||||
|
|
||||
|
public String getAdDirectTel() { |
||||
|
return adDirectTel; |
||||
|
} |
||||
|
|
||||
|
public void setAdDirectTel(String adDirectTel) { |
||||
|
this.adDirectTel = adDirectTel; |
||||
|
} |
||||
|
|
||||
|
public String getAlarmReceptionNote() { |
||||
|
return alarmReceptionNote; |
||||
|
} |
||||
|
|
||||
|
public void setAlarmReceptionNote(String alarmReceptionNote) { |
||||
|
this.alarmReceptionNote = alarmReceptionNote; |
||||
|
} |
||||
|
|
||||
|
public String getEscalationFlow() { |
||||
|
return escalationFlow; |
||||
|
} |
||||
|
|
||||
|
public void setEscalationFlow(String escalationFlow) { |
||||
|
this.escalationFlow = escalationFlow; |
||||
|
} |
||||
|
|
||||
|
public Date getContractStartDate() { |
||||
|
return contractStartDate; |
||||
|
} |
||||
|
|
||||
|
public void setContractStartDate(Date contractStartDate) { |
||||
|
this.contractStartDate = contractStartDate; |
||||
|
} |
||||
|
|
||||
|
public Date getOpenDate() { |
||||
|
return openDate; |
||||
|
} |
||||
|
|
||||
|
public void setOpenDate(Date openDate) { |
||||
|
this.openDate = openDate; |
||||
|
} |
||||
|
|
||||
|
public Date getContractEndDate() { |
||||
|
return contractEndDate; |
||||
|
} |
||||
|
|
||||
|
public void setContractEndDate(Date contractEndDate) { |
||||
|
this.contractEndDate = contractEndDate; |
||||
|
} |
||||
|
|
||||
|
public String getLegacyAddress() { |
||||
|
return legacyAddress; |
||||
|
} |
||||
|
|
||||
|
public void setLegacyAddress(String legacyAddress) { |
||||
|
this.legacyAddress = legacyAddress; |
||||
|
} |
||||
|
|
||||
|
public Integer getLegacyPropertyFlag() { |
||||
|
return legacyPropertyFlag; |
||||
|
} |
||||
|
|
||||
|
public void setLegacyPropertyFlag(Integer legacyPropertyFlag) { |
||||
|
this.legacyPropertyFlag = legacyPropertyFlag; |
||||
|
} |
||||
|
|
||||
|
public String getNameChangeHistory() { |
||||
|
return nameChangeHistory; |
||||
|
} |
||||
|
|
||||
|
public void setNameChangeHistory(String nameChangeHistory) { |
||||
|
this.nameChangeHistory = nameChangeHistory; |
||||
|
} |
||||
|
|
||||
|
public String getCommunicationInfo() { |
||||
|
return communicationInfo; |
||||
|
} |
||||
|
|
||||
|
public void setCommunicationInfo(String communicationInfo) { |
||||
|
this.communicationInfo = communicationInfo; |
||||
|
} |
||||
|
|
||||
|
public String getNapTime() { |
||||
|
return napTime; |
||||
|
} |
||||
|
|
||||
|
public void setNapTime(String napTime) { |
||||
|
this.napTime = napTime; |
||||
|
} |
||||
|
|
||||
|
public String getNoteUpdatedBy() { |
||||
|
return noteUpdatedBy; |
||||
|
} |
||||
|
|
||||
|
public void setNoteUpdatedBy(String noteUpdatedBy) { |
||||
|
this.noteUpdatedBy = noteUpdatedBy; |
||||
|
} |
||||
|
|
||||
|
public Integer getFlag() { |
||||
|
return flag; |
||||
|
} |
||||
|
|
||||
|
public void setFlag(Integer flag) { |
||||
|
this.flag = flag; |
||||
|
} |
||||
|
|
||||
|
public Long getCreateTime() { |
||||
|
return createTime; |
||||
|
} |
||||
|
|
||||
|
public void setCreateTime(Long createTime) { |
||||
|
this.createTime = createTime; |
||||
|
} |
||||
|
|
||||
|
public Long getCreatorId() { |
||||
|
return creatorId; |
||||
|
} |
||||
|
|
||||
|
public void setCreatorId(Long creatorId) { |
||||
|
this.creatorId = creatorId; |
||||
|
} |
||||
|
|
||||
|
public Long getModifyTime() { |
||||
|
return modifyTime; |
||||
|
} |
||||
|
|
||||
|
public void setModifyTime(Long modifyTime) { |
||||
|
this.modifyTime = modifyTime; |
||||
|
} |
||||
|
|
||||
|
public Long getModifierId() { |
||||
|
return modifierId; |
||||
|
} |
||||
|
|
||||
|
public void setModifierId(Long modifierId) { |
||||
|
this.modifierId = modifierId; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,180 @@ |
|||||
|
package com.techsor.datacenter.business.model; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class BasicFacilityExample { |
||||
|
protected String orderByClause; |
||||
|
protected boolean distinct; |
||||
|
protected List<Criteria> oredCriteria; |
||||
|
|
||||
|
public BasicFacilityExample() { |
||||
|
oredCriteria = new ArrayList<>(); |
||||
|
} |
||||
|
|
||||
|
public void setOrderByClause(String orderByClause) { |
||||
|
this.orderByClause = orderByClause; |
||||
|
} |
||||
|
|
||||
|
public String getOrderByClause() { |
||||
|
return orderByClause; |
||||
|
} |
||||
|
|
||||
|
public void setDistinct(boolean distinct) { |
||||
|
this.distinct = distinct; |
||||
|
} |
||||
|
|
||||
|
public boolean isDistinct() { |
||||
|
return distinct; |
||||
|
} |
||||
|
|
||||
|
public List<Criteria> getOredCriteria() { |
||||
|
return oredCriteria; |
||||
|
} |
||||
|
|
||||
|
public void or(Criteria criteria) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
|
||||
|
public Criteria createCriteria() { |
||||
|
Criteria criteria = new Criteria(); |
||||
|
if (oredCriteria.size() == 0) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public void clear() { |
||||
|
oredCriteria.clear(); |
||||
|
orderByClause = null; |
||||
|
distinct = false; |
||||
|
} |
||||
|
|
||||
|
public static class Criteria { |
||||
|
protected List<Criterion> criteria; |
||||
|
|
||||
|
protected Criteria() { |
||||
|
criteria = new ArrayList<>(); |
||||
|
} |
||||
|
|
||||
|
public boolean isValid() { |
||||
|
return criteria.size() > 0; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition) { |
||||
|
criteria.add(new Criterion(condition)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value) { |
||||
|
criteria.add(new Criterion(condition, value)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value1, Object value2) { |
||||
|
criteria.add(new Criterion(condition, value1, value2)); |
||||
|
} |
||||
|
|
||||
|
public Criteria andFacilityIdEqualTo(Long value) { |
||||
|
addCriterion("facility_id =", value); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andFacilityIdIn(List<Long> values) { |
||||
|
addCriterion("facility_id in", values); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBuildingIdEqualTo(Long value) { |
||||
|
addCriterion("building_id =", value); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andBuildingIdIn(List<Long> values) { |
||||
|
addCriterion("building_id in", values); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdEqualTo(Long value) { |
||||
|
addCriterion("company_id =", value); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdIn(List<Long> values) { |
||||
|
addCriterion("company_id in", values); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andFlagEqualTo(Integer value) { |
||||
|
addCriterion("flag =", value); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andFlagNotEqualTo(Integer value) { |
||||
|
addCriterion("flag <>", value); |
||||
|
return this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
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; |
||||
|
|
||||
|
protected Criterion(String condition) { |
||||
|
this.condition = condition; |
||||
|
this.noValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value) { |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
if (value instanceof List<?>) { |
||||
|
this.listValue = true; |
||||
|
} else { |
||||
|
this.singleValue = true; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue) { |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.secondValue = secondValue; |
||||
|
this.betweenValue = true; |
||||
|
} |
||||
|
|
||||
|
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; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,86 @@ |
|||||
|
package com.techsor.datacenter.business.vo.facility; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class FacilityPageVO { |
||||
|
|
||||
|
@Schema(description = "设施ID") |
||||
|
private Long facilityId; |
||||
|
|
||||
|
@Schema(description = "楼宇ID") |
||||
|
private Long buildingId; |
||||
|
|
||||
|
@Schema(description = "楼宇名称") |
||||
|
private String buildingName; |
||||
|
|
||||
|
@Schema(description = "企业ID") |
||||
|
private Long companyId; |
||||
|
|
||||
|
@Schema(description = "常驻警备公司名称") |
||||
|
private String securityCompanyName; |
||||
|
|
||||
|
@Schema(description = "机械警备公司名称") |
||||
|
private String machineSecurityCompany; |
||||
|
|
||||
|
@Schema(description = "机械警备联系电话") |
||||
|
private String machineSecurityTel; |
||||
|
|
||||
|
@Schema(description = "机械警备客户代码") |
||||
|
private String machineSecurityCustomerCode; |
||||
|
|
||||
|
@Schema(description = "夜间体制区分") |
||||
|
private String nightShiftType; |
||||
|
|
||||
|
@Schema(description = "夜间常驻人数") |
||||
|
private Integer nightGuardCount; |
||||
|
|
||||
|
@Schema(description = "常驻→机械 切换时间") |
||||
|
private String securitySwitchTime; |
||||
|
|
||||
|
@Schema(description = "警备员PHS号码") |
||||
|
private String securityPhs; |
||||
|
|
||||
|
@Schema(description = "商场侧警备电话") |
||||
|
private String mallSecurityTel; |
||||
|
|
||||
|
@Schema(description = "商场/永旺侧区分") |
||||
|
private String facilitySideType; |
||||
|
|
||||
|
@Schema(description = "AD直通电话") |
||||
|
private String adDirectTel; |
||||
|
|
||||
|
@Schema(description = "警报接收特记") |
||||
|
private String alarmReceptionNote; |
||||
|
|
||||
|
@Schema(description = "联络流程") |
||||
|
private String escalationFlow; |
||||
|
|
||||
|
@Schema(description = "合同开始日") |
||||
|
private String contractStartDate; |
||||
|
|
||||
|
@Schema(description = "开业日") |
||||
|
private String openDate; |
||||
|
|
||||
|
@Schema(description = "解约日/闭店日") |
||||
|
private String contractEndDate; |
||||
|
|
||||
|
@Schema(description = "旧地址") |
||||
|
private String legacyAddress; |
||||
|
|
||||
|
@Schema(description = "旧物业标志 0:否 1:是") |
||||
|
private Integer legacyPropertyFlag; |
||||
|
|
||||
|
@Schema(description = "名称变更履历") |
||||
|
private String nameChangeHistory; |
||||
|
|
||||
|
@Schema(description = "SIM/通信线路") |
||||
|
private String communicationInfo; |
||||
|
|
||||
|
@Schema(description = "值班小睡时段") |
||||
|
private String napTime; |
||||
|
|
||||
|
@Schema(description = "记载者/更新日") |
||||
|
private String noteUpdatedBy; |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
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.facility.FacilityAddParam; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityDeleteParam; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityEditParam; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityQueryParam; |
||||
|
import com.techsor.datacenter.business.vo.facility.FacilityPageVO; |
||||
|
|
||||
|
public interface FacilityService { |
||||
|
|
||||
|
PageInfo<FacilityPageVO> query(FacilityQueryParam param, Long userId, Long companyId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse add(FacilityAddParam param, Long userId, Long companyId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse edit(FacilityEditParam param, Long userId, Long companyId, Integer languageType); |
||||
|
|
||||
|
SimpleDataResponse batchDelete(FacilityDeleteParam param, Long userId, Long companyId, Integer languageType); |
||||
|
} |
||||
@ -0,0 +1,243 @@ |
|||||
|
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.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.BasicFacilityMapperExt; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityAddParam; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityDeleteParam; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityEditParam; |
||||
|
import com.techsor.datacenter.business.dto.facility.FacilityQueryParam; |
||||
|
import com.techsor.datacenter.business.model.BasicFacility; |
||||
|
import com.techsor.datacenter.business.model.BasicFacilityExample; |
||||
|
import com.techsor.datacenter.business.service.FacilityService; |
||||
|
import com.techsor.datacenter.business.service.UserOperationLogsService; |
||||
|
import com.techsor.datacenter.business.vo.facility.FacilityPageVO; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
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.text.SimpleDateFormat; |
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class FacilityServiceImpl implements FacilityService { |
||||
|
|
||||
|
private static Logger logger = LoggerFactory.getLogger(FacilityServiceImpl.class); |
||||
|
|
||||
|
@Autowired |
||||
|
private MsgLanguageChange msgLanguageChange; |
||||
|
|
||||
|
@Autowired |
||||
|
private BasicFacilityMapperExt basicFacilityMapperExt; |
||||
|
|
||||
|
@Autowired |
||||
|
private UserOperationLogsService userOperationLogsService; |
||||
|
|
||||
|
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); |
||||
|
|
||||
|
@Override |
||||
|
public PageInfo<FacilityPageVO> query(FacilityQueryParam param, Long userId, Long companyId, Integer languageType) { |
||||
|
PageHelper.startPage(param.getPageNum() == null ? 1 : param.getPageNum(), param.getPageSize() == null ? 20 : param.getPageSize()); |
||||
|
List<FacilityPageVO> resultList = basicFacilityMapperExt.getListPage(param, companyId); |
||||
|
return new PageInfo<>(resultList); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional |
||||
|
public SimpleDataResponse add(FacilityAddParam param, Long userId, Long companyId, Integer languageType) { |
||||
|
try { |
||||
|
if (ObjectUtils.isEmpty(param.getBuildingId())) { |
||||
|
return SimpleDataResponse.fail(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "paramsFormatError")); |
||||
|
} |
||||
|
|
||||
|
BasicFacility insertObj = new BasicFacility(); |
||||
|
insertObj.setBuildingId(param.getBuildingId()); |
||||
|
insertObj.setCompanyId(companyId); |
||||
|
insertObj.setSecurityCompanyName(param.getSecurityCompanyName()); |
||||
|
insertObj.setMachineSecurityCompany(param.getMachineSecurityCompany()); |
||||
|
insertObj.setMachineSecurityTel(param.getMachineSecurityTel()); |
||||
|
insertObj.setMachineSecurityCustomerCode(param.getMachineSecurityCustomerCode()); |
||||
|
insertObj.setNightShiftType(param.getNightShiftType()); |
||||
|
insertObj.setNightGuardCount(param.getNightGuardCount()); |
||||
|
insertObj.setSecuritySwitchTime(param.getSecuritySwitchTime()); |
||||
|
insertObj.setSecurityPhs(param.getSecurityPhs()); |
||||
|
insertObj.setMallSecurityTel(param.getMallSecurityTel()); |
||||
|
insertObj.setFacilitySideType(param.getFacilitySideType()); |
||||
|
insertObj.setAdDirectTel(param.getAdDirectTel()); |
||||
|
insertObj.setAlarmReceptionNote(param.getAlarmReceptionNote()); |
||||
|
insertObj.setEscalationFlow(param.getEscalationFlow()); |
||||
|
if (StringUtils.isNotBlank(param.getContractStartDate())) { |
||||
|
try { |
||||
|
insertObj.setContractStartDate(DATE_FORMAT.parse(param.getContractStartDate())); |
||||
|
} catch (Exception e) { |
||||
|
log.warn("Invalid contractStartDate: {}", param.getContractStartDate()); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(param.getOpenDate())) { |
||||
|
try { |
||||
|
insertObj.setOpenDate(DATE_FORMAT.parse(param.getOpenDate())); |
||||
|
} catch (Exception e) { |
||||
|
log.warn("Invalid openDate: {}", param.getOpenDate()); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(param.getContractEndDate())) { |
||||
|
try { |
||||
|
insertObj.setContractEndDate(DATE_FORMAT.parse(param.getContractEndDate())); |
||||
|
} catch (Exception e) { |
||||
|
log.warn("Invalid contractEndDate: {}", param.getContractEndDate()); |
||||
|
} |
||||
|
} |
||||
|
insertObj.setLegacyAddress(param.getLegacyAddress()); |
||||
|
insertObj.setLegacyPropertyFlag(param.getLegacyPropertyFlag()); |
||||
|
insertObj.setNameChangeHistory(param.getNameChangeHistory()); |
||||
|
insertObj.setCommunicationInfo(param.getCommunicationInfo()); |
||||
|
insertObj.setNapTime(param.getNapTime()); |
||||
|
insertObj.setNoteUpdatedBy(param.getNoteUpdatedBy()); |
||||
|
insertObj.setFlag(0); |
||||
|
insertObj.setCreateTime(System.currentTimeMillis()); |
||||
|
insertObj.setCreatorId(userId); |
||||
|
|
||||
|
basicFacilityMapperExt.insertSelective(insertObj); |
||||
|
|
||||
|
userOperationLogsService.recordLog(companyId, userId, "添加设施信息:" + insertObj.getFacilityId(), |
||||
|
"Add Facility:" + insertObj.getFacilityId(), |
||||
|
"施設情報を追加:" + insertObj.getFacilityId(), |
||||
|
"Success", Constants.USER_OPERATION_LOG_TYPE_ASSET_LOG, |
||||
|
new Gson().toJson(insertObj)); |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("Error adding facility", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional |
||||
|
public SimpleDataResponse edit(FacilityEditParam param, Long userId, Long companyId, Integer languageType) { |
||||
|
try { |
||||
|
if (ObjectUtils.isEmpty(param.getFacilityId())) { |
||||
|
return SimpleDataResponse.fail(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "paramsFormatError")); |
||||
|
} |
||||
|
|
||||
|
BasicFacilityExample example = new BasicFacilityExample(); |
||||
|
example.createCriteria().andFacilityIdEqualTo(param.getFacilityId()).andFlagEqualTo(0); |
||||
|
long cnt = basicFacilityMapperExt.countByExample(example); |
||||
|
if (cnt == 0) { |
||||
|
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "facilityNotExist")); |
||||
|
} |
||||
|
|
||||
|
BasicFacility updateObj = new BasicFacility(); |
||||
|
updateObj.setFacilityId(param.getFacilityId()); |
||||
|
if (param.getBuildingId() != null) { |
||||
|
updateObj.setBuildingId(param.getBuildingId()); |
||||
|
} |
||||
|
updateObj.setSecurityCompanyName(param.getSecurityCompanyName()); |
||||
|
updateObj.setMachineSecurityCompany(param.getMachineSecurityCompany()); |
||||
|
updateObj.setMachineSecurityTel(param.getMachineSecurityTel()); |
||||
|
updateObj.setMachineSecurityCustomerCode(param.getMachineSecurityCustomerCode()); |
||||
|
updateObj.setNightShiftType(param.getNightShiftType()); |
||||
|
updateObj.setNightGuardCount(param.getNightGuardCount()); |
||||
|
updateObj.setSecuritySwitchTime(param.getSecuritySwitchTime()); |
||||
|
updateObj.setSecurityPhs(param.getSecurityPhs()); |
||||
|
updateObj.setMallSecurityTel(param.getMallSecurityTel()); |
||||
|
updateObj.setFacilitySideType(param.getFacilitySideType()); |
||||
|
updateObj.setAdDirectTel(param.getAdDirectTel()); |
||||
|
updateObj.setAlarmReceptionNote(param.getAlarmReceptionNote()); |
||||
|
updateObj.setEscalationFlow(param.getEscalationFlow()); |
||||
|
if (StringUtils.isNotBlank(param.getContractStartDate())) { |
||||
|
try { |
||||
|
updateObj.setContractStartDate(DATE_FORMAT.parse(param.getContractStartDate())); |
||||
|
} catch (Exception e) { |
||||
|
log.warn("Invalid contractStartDate: {}", param.getContractStartDate()); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(param.getOpenDate())) { |
||||
|
try { |
||||
|
updateObj.setOpenDate(DATE_FORMAT.parse(param.getOpenDate())); |
||||
|
} catch (Exception e) { |
||||
|
log.warn("Invalid openDate: {}", param.getOpenDate()); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(param.getContractEndDate())) { |
||||
|
try { |
||||
|
updateObj.setContractEndDate(DATE_FORMAT.parse(param.getContractEndDate())); |
||||
|
} catch (Exception e) { |
||||
|
log.warn("Invalid contractEndDate: {}", param.getContractEndDate()); |
||||
|
} |
||||
|
} |
||||
|
updateObj.setLegacyAddress(param.getLegacyAddress()); |
||||
|
updateObj.setLegacyPropertyFlag(param.getLegacyPropertyFlag()); |
||||
|
updateObj.setNameChangeHistory(param.getNameChangeHistory()); |
||||
|
updateObj.setCommunicationInfo(param.getCommunicationInfo()); |
||||
|
updateObj.setNapTime(param.getNapTime()); |
||||
|
updateObj.setNoteUpdatedBy(param.getNoteUpdatedBy()); |
||||
|
updateObj.setModifyTime(System.currentTimeMillis()); |
||||
|
updateObj.setModifierId(userId); |
||||
|
|
||||
|
basicFacilityMapperExt.updateByPrimaryKeySelective(updateObj); |
||||
|
|
||||
|
userOperationLogsService.recordLog(companyId, userId, "编辑设施信息:" + updateObj.getFacilityId(), |
||||
|
"Edit Facility:" + updateObj.getFacilityId(), |
||||
|
"施設情報を編集:" + updateObj.getFacilityId(), |
||||
|
"Success", Constants.USER_OPERATION_LOG_TYPE_ASSET_LOG, |
||||
|
new Gson().toJson(updateObj)); |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("Error editing facility", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional |
||||
|
public SimpleDataResponse batchDelete(FacilityDeleteParam param, Long userId, Long companyId, Integer languageType) { |
||||
|
try { |
||||
|
if (ObjectUtils.isEmpty(param.getFacilityIds())) { |
||||
|
return SimpleDataResponse.fail(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "paramsFormatError")); |
||||
|
} |
||||
|
|
||||
|
List<Long> idList = Arrays.stream(param.getFacilityIds().split(",")) |
||||
|
.map(String::trim) |
||||
|
.filter(s -> !s.isEmpty()) |
||||
|
.map(Long::parseLong) |
||||
|
.toList(); |
||||
|
|
||||
|
for (Long id : idList) { |
||||
|
BasicFacility updateObj = new BasicFacility(); |
||||
|
updateObj.setFacilityId(id); |
||||
|
updateObj.setModifyTime(System.currentTimeMillis()); |
||||
|
updateObj.setModifierId(userId); |
||||
|
updateObj.setFlag(1); |
||||
|
basicFacilityMapperExt.updateByPrimaryKeySelective(updateObj); |
||||
|
} |
||||
|
|
||||
|
userOperationLogsService.recordLog(companyId, userId, "删除设施信息:" + param.getFacilityIds(), |
||||
|
"Delete Facility:" + param.getFacilityIds(), |
||||
|
"施設情報を削除:" + param.getFacilityIds(), |
||||
|
"Success", Constants.USER_OPERATION_LOG_TYPE_ASSET_LOG, ""); |
||||
|
|
||||
|
return SimpleDataResponse.success(); |
||||
|
} catch (Exception e) { |
||||
|
logger.error("Error deleting facility", e); |
||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
||||
|
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Binary file not shown.
File diff suppressed because it is too large
Loading…
Reference in new issue