Compare commits
7 Commits
b8a2d03946
...
d60992349b
| Author | SHA1 | Date |
|---|---|---|
|
|
d60992349b | 1 month ago |
|
|
cbfb3d44cb | 1 month ago |
|
|
540abeea78 | 1 month ago |
|
|
17d06ec1ee | 2 months ago |
|
|
a3aa52f709 | 2 months ago |
|
|
f4da169fe3 | 2 months ago |
|
|
3b7c1adc4e | 2 months ago |
53 changed files with 5695 additions and 158 deletions
@ -0,0 +1,137 @@ |
|||
package com.techsor.datacenter.business.controller; |
|||
|
|||
import com.techsor.datacenter.business.dto.salesforce.SalesforceBingDeviceSearchParams; |
|||
import com.techsor.datacenter.business.vo.device.DeviceShortVO; |
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
|
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
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.salesforce.SalesforceSearchParams; |
|||
import com.techsor.datacenter.business.dto.salesforce.DeleteSalesforceParams; |
|||
import com.techsor.datacenter.business.dto.salesforce.OptSalesforceParams; |
|||
import com.techsor.datacenter.business.service.SalesforceService; |
|||
import com.techsor.datacenter.business.vo.salesforce.SalesforcePageVO; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* |
|||
* @author jwy-style |
|||
* |
|||
*/ |
|||
@RestController |
|||
@AccessRequired |
|||
@RequestMapping("/salesforce") |
|||
@Tag(name = "SalesforceController",description = "Salesforce manage") |
|||
@SuppressWarnings("unchecked") |
|||
public class SalesforceController { |
|||
|
|||
private static final Logger logger = LoggerFactory.getLogger(SalesforceController.class); |
|||
|
|||
@Autowired |
|||
private SalesforceService salesforceService; |
|||
|
|||
@Operation(summary = "Add Salesforce") |
|||
@RequestMapping(value = "/add", method = RequestMethod.POST) |
|||
public SimpleDataResponse add( |
|||
@RequestBody OptSalesforceParams optSalesforceParams, |
|||
@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) { |
|||
return salesforceService.add(optSalesforceParams, UserId, CompanyId, LanguageType); |
|||
} |
|||
|
|||
@Operation(summary = "Edit Salesforce") |
|||
@RequestMapping(value = "/edit", method = RequestMethod.POST) |
|||
public SimpleDataResponse edit( |
|||
@RequestBody OptSalesforceParams optSalesforceParams, |
|||
@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) { |
|||
return salesforceService.edit(optSalesforceParams, UserId, CompanyId, LanguageType); |
|||
} |
|||
|
|||
@Operation(summary = "Delete Salesforces in Batch") |
|||
@RequestMapping(value = "/batchDelete", method = RequestMethod.POST) |
|||
public SimpleDataResponse batchDelete( |
|||
@RequestBody DeleteSalesforceParams deleteSalesforceParams, |
|||
@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) { |
|||
return salesforceService.batchDelete(deleteSalesforceParams, UserId, CompanyId, LanguageType); |
|||
} |
|||
|
|||
|
|||
@Operation(summary = "Get Salesforce List") |
|||
@RequestMapping(value = "/getListPage", method = RequestMethod.GET) |
|||
public PageResponse<PageInfo<SalesforcePageVO>> 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 = "Time difference in minutes from UTC, e.g., East 8 is -480", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset, |
|||
SalesforceSearchParams pageSearchParam) throws BusinessException { |
|||
|
|||
pageSearchParam.setUserId(UserId); |
|||
|
|||
PageResponse<PageInfo<SalesforcePageVO>> pageResponse = new PageResponse<>(); |
|||
try { |
|||
pageResponse.setData(salesforceService.getListPage(pageSearchParam, CompanyId, UserId, LanguageType, UTCOffset)); |
|||
pageResponse.setCode(ResponseCode.SUCCESS); |
|||
pageResponse.setMsg("success"); |
|||
} catch (Exception e) { |
|||
logger.error("Error querying list", e); |
|||
pageResponse.setCode(ResponseCode.SERVER_ERROR); |
|||
pageResponse.setMsg("service error"); |
|||
} |
|||
return pageResponse; |
|||
} |
|||
|
|||
@Operation(summary = "Get device for binding") |
|||
@RequestMapping(value = "/getDevicePageForBinding", method = RequestMethod.GET) |
|||
public PageResponse<PageInfo<DeviceShortVO>> getDevicePageForBinding( |
|||
@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 = "Time difference in minutes from UTC, e.g., East 8 is -480", required = true, schema = @Schema(defaultValue = "-480")) @RequestHeader(required = true) Integer UTCOffset, |
|||
SalesforceBingDeviceSearchParams pageSearchParam) throws BusinessException { |
|||
|
|||
pageSearchParam.setUserId(UserId); |
|||
// pageSearchParam.setId(id);
|
|||
|
|||
PageResponse<PageInfo<DeviceShortVO>> pageResponse = new PageResponse<>(); |
|||
try { |
|||
pageResponse.setData(salesforceService.getDevicePageForBinding(pageSearchParam, CompanyId, UserId, LanguageType, UTCOffset)); |
|||
pageResponse.setCode(ResponseCode.SUCCESS); |
|||
pageResponse.setMsg("success"); |
|||
} catch (Exception e) { |
|||
logger.error("Error querying list", e); |
|||
pageResponse.setCode(ResponseCode.SERVER_ERROR); |
|||
pageResponse.setMsg("service error"); |
|||
} |
|||
return pageResponse; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
|
|||
|
|||
CREATE TABLE `basic_salesforce` ( |
|||
`id` bigint NOT NULL AUTO_INCREMENT, |
|||
`company_id` bigint DEFAULT NULL, |
|||
`salesforce_id` VARCHAR(255), |
|||
`remark` varchar(1000) COMMENT '备注', |
|||
`flag` int NOT NULL DEFAULT '0' COMMENT '0-正常,1-删除', |
|||
`create_time` bigint DEFAULT NULL, |
|||
`creator_id` bigint DEFAULT NULL, |
|||
`modify_time` bigint DEFAULT NULL, |
|||
`modifier_id` bigint DEFAULT NULL, |
|||
PRIMARY KEY (`id`) USING BTREE |
|||
) ENGINE=InnoDB COMMENT='salesforce表'; |
|||
|
|||
|
|||
CREATE TABLE `salesforce_facility` ( |
|||
`salesforce_id` varchar(255) DEFAULT NULL, |
|||
`facility_id_c` varchar(255) DEFAULT NULL COMMENT '施設ID', |
|||
`name` varchar(255) DEFAULT NULL, |
|||
`owner_id` varchar(255) DEFAULT NULL, |
|||
`is_deleted` tinyint(1) DEFAULT '0', |
|||
`extra_json` json DEFAULT NULL, |
|||
`created_at` datetime DEFAULT NULL, |
|||
`updated_at` datetime DEFAULT NULL, |
|||
UNIQUE KEY `salesforce_id` (`salesforce_id`) |
|||
) ENGINE=InnoDB COMMENT='salesforce同步信息'; |
|||
|
|||
|
|||
CREATE TABLE `salesforce_device_relation` ( |
|||
`salesforce_info_id` bigint NOT NULL, |
|||
`device_info_id` bigint NOT NULL, |
|||
`create_time` bigint DEFAULT NULL |
|||
) ENGINE=InnoDB COMMENT='salesforce和设备关系表'; |
|||
@ -0,0 +1,5 @@ |
|||
|
|||
ALTER TABLE basic_building ADD `special_notes` text COMMENT '特记事项'; |
|||
|
|||
ALTER TABLE basic_salesforce ADD building_id bigint AFTER salesforce_id; |
|||
|
|||
@ -0,0 +1,150 @@ |
|||
|
|||
# 创建新表(合并层) |
|||
CREATE TABLE dashboard_level_store_area_merge ( |
|||
id BIGINT NOT NULL AUTO_INCREMENT, |
|||
company_id BIGINT, |
|||
store_id BIGINT, |
|||
area_id BIGINT, |
|||
name VARCHAR(255), |
|||
code VARCHAR(255), |
|||
remark VARCHAR(255), |
|||
flag INT DEFAULT 0, |
|||
created_by BIGINT, |
|||
created_at BIGINT, |
|||
updated_at BIGINT, |
|||
updated_by BIGINT, |
|||
PRIMARY KEY (id) |
|||
); |
|||
|
|||
# 初始化数据 |
|||
INSERT INTO dashboard_level_store_area_merge ( |
|||
company_id, |
|||
store_id, |
|||
area_id, |
|||
name, |
|||
created_by, |
|||
created_at |
|||
) |
|||
SELECT |
|||
st.company_id, |
|||
r.store_id, |
|||
r.area_id, |
|||
CONCAT(st.name, ' ', ar.name), |
|||
r.created_by, |
|||
r.created_at |
|||
FROM dashboard_level_relation_store_area r |
|||
JOIN dashboard_level_store st ON st.id = r.store_id |
|||
JOIN dashboard_level_area ar ON ar.id = r.area_id |
|||
WHERE st.flag = 0 AND ar.flag = 0; |
|||
|
|||
# 重建 Branch 新层关系 |
|||
CREATE TABLE dashboard_level_relation_branch_store_area ( |
|||
branch_id BIGINT NOT NULL, |
|||
store_area_id BIGINT NOT NULL, |
|||
created_by BIGINT, |
|||
created_at BIGINT, |
|||
KEY idx_branch (branch_id), |
|||
KEY idx_store_area (store_area_id) |
|||
); |
|||
|
|||
# 数据迁移 |
|||
INSERT INTO dashboard_level_relation_branch_store_area ( |
|||
branch_id, |
|||
store_area_id, |
|||
created_by, |
|||
created_at |
|||
) |
|||
SELECT |
|||
bs.branch_id, |
|||
sam.id, |
|||
bs.created_by, |
|||
bs.created_at |
|||
FROM dashboard_level_relation_branch_store bs |
|||
JOIN dashboard_level_store_area_merge sam |
|||
ON bs.store_id = sam.store_id; |
|||
|
|||
# 重建 StoreArea-Site |
|||
CREATE TABLE dashboard_level_relation_store_area_site ( |
|||
store_area_id BIGINT NOT NULL, |
|||
site_id BIGINT NOT NULL, |
|||
created_by BIGINT, |
|||
created_at BIGINT, |
|||
KEY idx_sa (store_area_id), |
|||
KEY idx_site (site_id) |
|||
); |
|||
|
|||
# 数据迁移 |
|||
INSERT INTO dashboard_level_relation_store_area_site ( |
|||
store_area_id, |
|||
site_id, |
|||
created_by, |
|||
created_at |
|||
) |
|||
SELECT |
|||
sam.id, |
|||
ras.site_id, |
|||
ras.created_by, |
|||
ras.created_at |
|||
FROM dashboard_level_relation_area_site ras |
|||
JOIN dashboard_level_store_area_merge sam |
|||
ON ras.area_id = sam.area_id; |
|||
|
|||
# 迁移权限 |
|||
# 先改ENUM |
|||
ALTER TABLE dashboard_level_role_object MODIFY ref_type ENUM('BRANCH','STORE','AREA','SITE','BUILDING','STORE_AREA') NOT NULL; |
|||
# 迁移 AREA 权限 |
|||
INSERT IGNORE INTO dashboard_level_role_object ( |
|||
level_role_id, |
|||
ref_type, |
|||
ref_id, |
|||
created_by, |
|||
created_at, |
|||
updated_at, |
|||
updated_by |
|||
) |
|||
SELECT |
|||
ro.level_role_id, |
|||
'STORE_AREA', |
|||
sam.id, |
|||
ro.created_by, |
|||
ro.created_at, |
|||
ro.updated_at, |
|||
ro.updated_by |
|||
FROM dashboard_level_role_object ro |
|||
JOIN dashboard_level_store_area_merge sam |
|||
ON ro.ref_type = 'AREA' |
|||
AND ro.ref_id = sam.area_id; |
|||
|
|||
# 迁移 STORE 权限 |
|||
INSERT IGNORE INTO dashboard_level_role_object ( |
|||
level_role_id, |
|||
ref_type, |
|||
ref_id, |
|||
created_by, |
|||
created_at, |
|||
updated_at, |
|||
updated_by |
|||
) |
|||
SELECT |
|||
ro.level_role_id, |
|||
'STORE_AREA', |
|||
sam.id, |
|||
ro.created_by, |
|||
ro.created_at, |
|||
ro.updated_at, |
|||
ro.updated_by |
|||
FROM dashboard_level_role_object ro |
|||
JOIN dashboard_level_store_area_merge sam |
|||
ON ro.ref_type = 'STORE' |
|||
AND ro.ref_id = sam.store_id; |
|||
|
|||
# 删除旧权限 |
|||
DELETE FROM dashboard_level_role_object WHERE ref_type IN ('AREA','STORE'); |
|||
|
|||
# 最后改ENUM |
|||
ALTER TABLE dashboard_level_role_object MODIFY ref_type ENUM('BRANCH','STORE_AREA','SITE','BUILDING') NOT NULL; |
|||
|
|||
|
|||
# 添加编码 |
|||
ALTER TABLE dashboard_level_branch ADD code VARCHAR(255) AFTER `name`; |
|||
ALTER TABLE dashboard_level_site ADD code VARCHAR(255) AFTER `name`; |
|||
@ -0,0 +1,96 @@ |
|||
package com.techsor.datacenter.business.dao.auto; |
|||
|
|||
import com.techsor.datacenter.business.model.BasicSalesforce; |
|||
import com.techsor.datacenter.business.model.BasicSalesforceExample; |
|||
import java.util.List; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
public interface BasicSalesforceMapper { |
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
long countByExample(BasicSalesforceExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int deleteByExample(BasicSalesforceExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int deleteByPrimaryKey(Long id); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int insert(BasicSalesforce record); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int insertSelective(BasicSalesforce record); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
List<BasicSalesforce> selectByExample(BasicSalesforceExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
BasicSalesforce selectByPrimaryKey(Long id); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int updateByExampleSelective(@Param("record") BasicSalesforce record, @Param("example") BasicSalesforceExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int updateByExample(@Param("record") BasicSalesforce record, @Param("example") BasicSalesforceExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int updateByPrimaryKeySelective(BasicSalesforce record); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int updateByPrimaryKey(BasicSalesforce record); |
|||
} |
|||
@ -0,0 +1,64 @@ |
|||
package com.techsor.datacenter.business.dao.auto; |
|||
|
|||
import com.techsor.datacenter.business.model.SalesforceDeviceRelation; |
|||
import com.techsor.datacenter.business.model.SalesforceDeviceRelationExample; |
|||
import java.util.List; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
public interface SalesforceDeviceRelationMapper { |
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
long countByExample(SalesforceDeviceRelationExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int deleteByExample(SalesforceDeviceRelationExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int insert(SalesforceDeviceRelation record); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int insertSelective(SalesforceDeviceRelation record); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
List<SalesforceDeviceRelation> selectByExample(SalesforceDeviceRelationExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int updateByExampleSelective(@Param("record") SalesforceDeviceRelation record, @Param("example") SalesforceDeviceRelationExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int updateByExample(@Param("record") SalesforceDeviceRelation record, @Param("example") SalesforceDeviceRelationExample example); |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
package com.techsor.datacenter.business.dao.auto; |
|||
|
|||
import com.techsor.datacenter.business.model.SalesforceFacility; |
|||
import com.techsor.datacenter.business.model.SalesforceFacilityExample; |
|||
import java.util.List; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
public interface SalesforceFacilityMapper { |
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
long countByExample(SalesforceFacilityExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int deleteByExample(SalesforceFacilityExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int insert(SalesforceFacility record); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int insertSelective(SalesforceFacility record); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
List<SalesforceFacility> selectByExampleWithBLOBs(SalesforceFacilityExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
List<SalesforceFacility> selectByExample(SalesforceFacilityExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int updateByExampleSelective(@Param("record") SalesforceFacility record, @Param("example") SalesforceFacilityExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int updateByExampleWithBLOBs(@Param("record") SalesforceFacility record, @Param("example") SalesforceFacilityExample example); |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
int updateByExample(@Param("record") SalesforceFacility record, @Param("example") SalesforceFacilityExample example); |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.techsor.datacenter.business.dao.ex; |
|||
|
|||
import com.techsor.datacenter.business.dao.auto.BasicSalesforceMapper; |
|||
import com.techsor.datacenter.business.dto.salesforce.SalesforceBingDeviceSearchParams; |
|||
import com.techsor.datacenter.business.dto.salesforce.SalesforceSearchParams; |
|||
import com.techsor.datacenter.business.dto.salesforce.OptSalesforceParams; |
|||
import com.techsor.datacenter.business.vo.device.DeviceShortVO; |
|||
import com.techsor.datacenter.business.vo.salesforce.SalesforcePageVO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface BasicSalesforceMapperExt extends BasicSalesforceMapper { |
|||
|
|||
int checkExist(OptSalesforceParams optSalesforceParams); |
|||
|
|||
List<SalesforcePageVO> getListPage(SalesforceSearchParams pageSearchParam); |
|||
|
|||
List<DeviceShortVO> getDevicePageForBinding(SalesforceBingDeviceSearchParams pageSearchParam); |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
package com.techsor.datacenter.business.dao.ex; |
|||
|
|||
import com.techsor.datacenter.business.dao.auto.SalesforceDeviceRelationMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface SalesforceDeviceRelationMapperExt extends SalesforceDeviceRelationMapper { |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
package com.techsor.datacenter.business.dao.ex; |
|||
|
|||
import com.techsor.datacenter.business.dao.auto.SalesforceFacilityMapper; |
|||
import com.techsor.datacenter.business.model.SalesforceFacility; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface SalesforceFacilityMapperExt extends SalesforceFacilityMapper { |
|||
|
|||
void upsert(SalesforceFacility entity); |
|||
|
|||
} |
|||
@ -0,0 +1,352 @@ |
|||
<?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.BasicSalesforceMapper"> |
|||
<resultMap id="BaseResultMap" type="com.techsor.datacenter.business.model.BasicSalesforce"> |
|||
<!-- |
|||
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="salesforce_id" jdbcType="VARCHAR" property="salesforceId" /> |
|||
<result column="building_id" jdbcType="BIGINT" property="buildingId" /> |
|||
<result column="remark" jdbcType="VARCHAR" property="remark" /> |
|||
<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"> |
|||
<!-- |
|||
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, salesforce_id, building_id, remark, flag, create_time, creator_id, |
|||
modify_time, modifier_id |
|||
</sql> |
|||
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.BasicSalesforceExample" 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 basic_salesforce |
|||
<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 basic_salesforce |
|||
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 basic_salesforce |
|||
where id = #{id,jdbcType=BIGINT} |
|||
</delete> |
|||
<delete id="deleteByExample" parameterType="com.techsor.datacenter.business.model.BasicSalesforceExample"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
delete from basic_salesforce |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
</delete> |
|||
<insert id="insert" parameterType="com.techsor.datacenter.business.model.BasicSalesforce"> |
|||
<!-- |
|||
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 basic_salesforce (company_id, salesforce_id, building_id, |
|||
remark, flag, create_time, |
|||
creator_id, modify_time, modifier_id |
|||
) |
|||
values (#{companyId,jdbcType=BIGINT}, #{salesforceId,jdbcType=VARCHAR}, #{buildingId,jdbcType=BIGINT}, |
|||
#{remark,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.BasicSalesforce"> |
|||
<!-- |
|||
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 basic_salesforce |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="companyId != null"> |
|||
company_id, |
|||
</if> |
|||
<if test="salesforceId != null"> |
|||
salesforce_id, |
|||
</if> |
|||
<if test="buildingId != null"> |
|||
building_id, |
|||
</if> |
|||
<if test="remark != null"> |
|||
remark, |
|||
</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="companyId != null"> |
|||
#{companyId,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="salesforceId != null"> |
|||
#{salesforceId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="buildingId != null"> |
|||
#{buildingId,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="remark != null"> |
|||
#{remark,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" parameterType="com.techsor.datacenter.business.model.BasicSalesforceExample" resultType="java.lang.Long"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
select count(*) from basic_salesforce |
|||
<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 basic_salesforce |
|||
<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.salesforceId != null"> |
|||
salesforce_id = #{record.salesforceId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.buildingId != null"> |
|||
building_id = #{record.buildingId,jdbcType=BIGINT}, |
|||
</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.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" parameterType="map"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
update basic_salesforce |
|||
set id = #{record.id,jdbcType=BIGINT}, |
|||
company_id = #{record.companyId,jdbcType=BIGINT}, |
|||
salesforce_id = #{record.salesforceId,jdbcType=VARCHAR}, |
|||
building_id = #{record.buildingId,jdbcType=BIGINT}, |
|||
remark = #{record.remark,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" parameterType="com.techsor.datacenter.business.model.BasicSalesforce"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
update basic_salesforce |
|||
<set> |
|||
<if test="companyId != null"> |
|||
company_id = #{companyId,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="salesforceId != null"> |
|||
salesforce_id = #{salesforceId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="buildingId != null"> |
|||
building_id = #{buildingId,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="remark != null"> |
|||
remark = #{remark,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 id = #{id,jdbcType=BIGINT} |
|||
</update> |
|||
<update id="updateByPrimaryKey" parameterType="com.techsor.datacenter.business.model.BasicSalesforce"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
update basic_salesforce |
|||
set company_id = #{companyId,jdbcType=BIGINT}, |
|||
salesforce_id = #{salesforceId,jdbcType=VARCHAR}, |
|||
building_id = #{buildingId,jdbcType=BIGINT}, |
|||
remark = #{remark,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 id = #{id,jdbcType=BIGINT} |
|||
</update> |
|||
</mapper> |
|||
@ -0,0 +1,198 @@ |
|||
<?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.SalesforceDeviceRelationMapper"> |
|||
<resultMap id="BaseResultMap" type="com.techsor.datacenter.business.model.SalesforceDeviceRelation"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
<result column="salesforce_info_id" jdbcType="BIGINT" property="salesforceInfoId" /> |
|||
<result column="device_info_id" jdbcType="BIGINT" property="deviceInfoId" /> |
|||
<result column="create_time" jdbcType="BIGINT" property="createTime" /> |
|||
</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. |
|||
--> |
|||
salesforce_info_id, device_info_id, create_time |
|||
</sql> |
|||
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.SalesforceDeviceRelationExample" 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 salesforce_device_relation |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
<if test="orderByClause != null"> |
|||
order by ${orderByClause} |
|||
</if> |
|||
</select> |
|||
<delete id="deleteByExample" parameterType="com.techsor.datacenter.business.model.SalesforceDeviceRelationExample"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
delete from salesforce_device_relation |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
</delete> |
|||
<insert id="insert" parameterType="com.techsor.datacenter.business.model.SalesforceDeviceRelation"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
insert into salesforce_device_relation (salesforce_info_id, device_info_id, create_time |
|||
) |
|||
values (#{salesforceInfoId,jdbcType=BIGINT}, #{deviceInfoId,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT} |
|||
) |
|||
</insert> |
|||
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.SalesforceDeviceRelation"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
insert into salesforce_device_relation |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="salesforceInfoId != null"> |
|||
salesforce_info_id, |
|||
</if> |
|||
<if test="deviceInfoId != null"> |
|||
device_info_id, |
|||
</if> |
|||
<if test="createTime != null"> |
|||
create_time, |
|||
</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="salesforceInfoId != null"> |
|||
#{salesforceInfoId,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="deviceInfoId != null"> |
|||
#{deviceInfoId,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="createTime != null"> |
|||
#{createTime,jdbcType=BIGINT}, |
|||
</if> |
|||
</trim> |
|||
</insert> |
|||
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.SalesforceDeviceRelationExample" resultType="java.lang.Long"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
select count(*) from salesforce_device_relation |
|||
<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 salesforce_device_relation |
|||
<set> |
|||
<if test="record.salesforceInfoId != null"> |
|||
salesforce_info_id = #{record.salesforceInfoId,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="record.deviceInfoId != null"> |
|||
device_info_id = #{record.deviceInfoId,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="record.createTime != null"> |
|||
create_time = #{record.createTime,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 salesforce_device_relation |
|||
set salesforce_info_id = #{record.salesforceInfoId,jdbcType=BIGINT}, |
|||
device_info_id = #{record.deviceInfoId,jdbcType=BIGINT}, |
|||
create_time = #{record.createTime,jdbcType=BIGINT} |
|||
<if test="_parameter != null"> |
|||
<include refid="Update_By_Example_Where_Clause" /> |
|||
</if> |
|||
</update> |
|||
</mapper> |
|||
@ -0,0 +1,306 @@ |
|||
<?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.SalesforceFacilityMapper"> |
|||
<resultMap id="BaseResultMap" type="com.techsor.datacenter.business.model.SalesforceFacility"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
<result column="salesforce_id" jdbcType="VARCHAR" property="salesforceId" /> |
|||
<result column="facility_id_c" jdbcType="VARCHAR" property="facilityIdC" /> |
|||
<result column="name" jdbcType="VARCHAR" property="name" /> |
|||
<result column="owner_id" jdbcType="VARCHAR" property="ownerId" /> |
|||
<result column="is_deleted" jdbcType="BIT" property="isDeleted" /> |
|||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
|||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
|||
</resultMap> |
|||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.techsor.datacenter.business.model.SalesforceFacility"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
<result column="extra_json" jdbcType="LONGVARCHAR" property="extraJson" /> |
|||
</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. |
|||
--> |
|||
salesforce_id, facility_id_c, `name`, owner_id, is_deleted, created_at, updated_at |
|||
</sql> |
|||
<sql id="Blob_Column_List"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
extra_json |
|||
</sql> |
|||
<select id="selectByExampleWithBLOBs" parameterType="com.techsor.datacenter.business.model.SalesforceFacilityExample" resultMap="ResultMapWithBLOBs"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
select |
|||
<if test="distinct"> |
|||
distinct |
|||
</if> |
|||
'true' as QUERYID, |
|||
<include refid="Base_Column_List" /> |
|||
, |
|||
<include refid="Blob_Column_List" /> |
|||
from salesforce_facility |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
<if test="orderByClause != null"> |
|||
order by ${orderByClause} |
|||
</if> |
|||
</select> |
|||
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.SalesforceFacilityExample" 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 salesforce_facility |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
<if test="orderByClause != null"> |
|||
order by ${orderByClause} |
|||
</if> |
|||
</select> |
|||
<delete id="deleteByExample" parameterType="com.techsor.datacenter.business.model.SalesforceFacilityExample"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
delete from salesforce_facility |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
</delete> |
|||
<insert id="insert" parameterType="com.techsor.datacenter.business.model.SalesforceFacility"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
insert into salesforce_facility (salesforce_id, facility_id_c, `name`, |
|||
owner_id, is_deleted, created_at, |
|||
updated_at, extra_json) |
|||
values (#{salesforceId,jdbcType=VARCHAR}, #{facilityIdC,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, |
|||
#{ownerId,jdbcType=VARCHAR}, #{isDeleted,jdbcType=BIT}, #{createdAt,jdbcType=TIMESTAMP}, |
|||
#{updatedAt,jdbcType=TIMESTAMP}, #{extraJson,jdbcType=LONGVARCHAR}) |
|||
</insert> |
|||
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.SalesforceFacility"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
insert into salesforce_facility |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="salesforceId != null"> |
|||
salesforce_id, |
|||
</if> |
|||
<if test="facilityIdC != null"> |
|||
facility_id_c, |
|||
</if> |
|||
<if test="name != null"> |
|||
`name`, |
|||
</if> |
|||
<if test="ownerId != null"> |
|||
owner_id, |
|||
</if> |
|||
<if test="isDeleted != null"> |
|||
is_deleted, |
|||
</if> |
|||
<if test="createdAt != null"> |
|||
created_at, |
|||
</if> |
|||
<if test="updatedAt != null"> |
|||
updated_at, |
|||
</if> |
|||
<if test="extraJson != null"> |
|||
extra_json, |
|||
</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="salesforceId != null"> |
|||
#{salesforceId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="facilityIdC != null"> |
|||
#{facilityIdC,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="name != null"> |
|||
#{name,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="ownerId != null"> |
|||
#{ownerId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="isDeleted != null"> |
|||
#{isDeleted,jdbcType=BIT}, |
|||
</if> |
|||
<if test="createdAt != null"> |
|||
#{createdAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="updatedAt != null"> |
|||
#{updatedAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="extraJson != null"> |
|||
#{extraJson,jdbcType=LONGVARCHAR}, |
|||
</if> |
|||
</trim> |
|||
</insert> |
|||
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.SalesforceFacilityExample" resultType="java.lang.Long"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
select count(*) from salesforce_facility |
|||
<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 salesforce_facility |
|||
<set> |
|||
<if test="record.salesforceId != null"> |
|||
salesforce_id = #{record.salesforceId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.facilityIdC != null"> |
|||
facility_id_c = #{record.facilityIdC,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.name != null"> |
|||
`name` = #{record.name,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.ownerId != null"> |
|||
owner_id = #{record.ownerId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.isDeleted != null"> |
|||
is_deleted = #{record.isDeleted,jdbcType=BIT}, |
|||
</if> |
|||
<if test="record.createdAt != null"> |
|||
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="record.updatedAt != null"> |
|||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="record.extraJson != null"> |
|||
extra_json = #{record.extraJson,jdbcType=LONGVARCHAR}, |
|||
</if> |
|||
</set> |
|||
<if test="_parameter != null"> |
|||
<include refid="Update_By_Example_Where_Clause" /> |
|||
</if> |
|||
</update> |
|||
<update id="updateByExampleWithBLOBs" parameterType="map"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
update salesforce_facility |
|||
set salesforce_id = #{record.salesforceId,jdbcType=VARCHAR}, |
|||
facility_id_c = #{record.facilityIdC,jdbcType=VARCHAR}, |
|||
`name` = #{record.name,jdbcType=VARCHAR}, |
|||
owner_id = #{record.ownerId,jdbcType=VARCHAR}, |
|||
is_deleted = #{record.isDeleted,jdbcType=BIT}, |
|||
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
|||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
|||
extra_json = #{record.extraJson,jdbcType=LONGVARCHAR} |
|||
<if test="_parameter != null"> |
|||
<include refid="Update_By_Example_Where_Clause" /> |
|||
</if> |
|||
</update> |
|||
<update id="updateByExample" parameterType="map"> |
|||
<!-- |
|||
WARNING - @mbg.generated |
|||
This element is automatically generated by MyBatis Generator, do not modify. |
|||
--> |
|||
update salesforce_facility |
|||
set salesforce_id = #{record.salesforceId,jdbcType=VARCHAR}, |
|||
facility_id_c = #{record.facilityIdC,jdbcType=VARCHAR}, |
|||
`name` = #{record.name,jdbcType=VARCHAR}, |
|||
owner_id = #{record.ownerId,jdbcType=VARCHAR}, |
|||
is_deleted = #{record.isDeleted,jdbcType=BIT}, |
|||
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
|||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP} |
|||
<if test="_parameter != null"> |
|||
<include refid="Update_By_Example_Where_Clause" /> |
|||
</if> |
|||
</update> |
|||
</mapper> |
|||
@ -0,0 +1,190 @@ |
|||
<?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.BasicSalesforceMapperExt"> |
|||
|
|||
|
|||
<select id="checkExist" resultType="java.lang.Integer"> |
|||
SELECT |
|||
COUNT(1) |
|||
FROM |
|||
basic_salesforce |
|||
WHERE |
|||
flag != 1 AND salesforce_id = #{salesforceId} |
|||
<if test="companyId != null"> |
|||
AND company_id = #{companyId} |
|||
</if> |
|||
<if test="id != null"> |
|||
AND id != #{id} |
|||
</if> |
|||
</select> |
|||
|
|||
|
|||
<select id="getListPage" resultType="com.techsor.datacenter.business.vo.salesforce.SalesforcePageVO"> |
|||
|
|||
WITH |
|||
-- device 先聚合(解决 GROUP BY 问题的关键) |
|||
device_agg AS ( |
|||
SELECT |
|||
sdr.salesforce_info_id, |
|||
GROUP_CONCAT(DISTINCT di.id) AS deviceInfoIds, |
|||
GROUP_CONCAT(DISTINCT di.device_id) AS deviceIds |
|||
FROM salesforce_device_relation sdr |
|||
LEFT JOIN device_info di |
|||
ON di.id = sdr.device_info_id AND di.flag = 0 |
|||
GROUP BY sdr.salesforce_info_id |
|||
), |
|||
|
|||
-- building → 最新 site(唯一) |
|||
latest_site AS ( |
|||
SELECT * |
|||
FROM ( |
|||
SELECT |
|||
rsb.building_id, |
|||
rsb.site_id, |
|||
ROW_NUMBER() OVER ( |
|||
PARTITION BY rsb.building_id |
|||
ORDER BY rsb.created_at DESC, rsb.site_id DESC |
|||
) AS rn |
|||
FROM dashboard_level_relation_site_building rsb |
|||
) t |
|||
WHERE t.rn = 1 |
|||
), |
|||
|
|||
-- 基于 site → 最新 store_area |
|||
latest_store_area AS ( |
|||
SELECT * |
|||
FROM ( |
|||
SELECT |
|||
ls.building_id, |
|||
rsas.site_id, |
|||
rsas.store_area_id, |
|||
ROW_NUMBER() OVER ( |
|||
PARTITION BY ls.building_id |
|||
ORDER BY rsas.created_at DESC, rsas.store_area_id DESC |
|||
) AS rn |
|||
FROM latest_site ls |
|||
JOIN dashboard_level_relation_store_area_site rsas |
|||
ON ls.site_id = rsas.site_id |
|||
) t |
|||
WHERE t.rn = 1 |
|||
), |
|||
|
|||
-- 基于 store_area → 最新 branch |
|||
latest_branch AS ( |
|||
SELECT * |
|||
FROM ( |
|||
SELECT |
|||
lsa.building_id, |
|||
rbsa.store_area_id, |
|||
rbsa.branch_id, |
|||
ROW_NUMBER() OVER ( |
|||
PARTITION BY lsa.building_id |
|||
ORDER BY rbsa.created_at DESC, rbsa.branch_id DESC |
|||
) AS rn |
|||
FROM latest_store_area lsa |
|||
JOIN dashboard_level_relation_branch_store_area rbsa |
|||
ON lsa.store_area_id = rbsa.store_area_id |
|||
) t |
|||
WHERE t.rn = 1 |
|||
) |
|||
|
|||
SELECT |
|||
bsales.id, |
|||
bsales.company_id, |
|||
bsales.building_id, |
|||
bb.name AS buildingName, |
|||
bb.udf_building_id, |
|||
bcomp.company_name, |
|||
bsales.salesforce_id, |
|||
bsales.remark, |
|||
|
|||
da.deviceInfoIds, |
|||
da.deviceIds, |
|||
|
|||
s.id AS site_id, |
|||
s.code AS siteCode, |
|||
s.name AS siteName, |
|||
|
|||
sam.id AS store_area_id, |
|||
sam.code AS storeAreaCode, |
|||
sam.name AS storeAreaName, |
|||
|
|||
br.id AS branch_id, |
|||
br.code AS branchCode, |
|||
br.name AS branchName |
|||
|
|||
FROM |
|||
basic_salesforce bsales |
|||
|
|||
LEFT JOIN basic_building bb |
|||
ON bb.building_id = bsales.building_id |
|||
AND bb.flag = 0 |
|||
|
|||
INNER JOIN data_center_aeon_admin.basic_company bcomp |
|||
ON bcomp.id = bsales.company_id |
|||
|
|||
LEFT JOIN device_agg da |
|||
ON da.salesforce_info_id = bsales.id |
|||
|
|||
-- 严格链路 JOIN |
|||
LEFT JOIN latest_site ls |
|||
ON ls.building_id = bsales.building_id |
|||
|
|||
LEFT JOIN dashboard_level_site s |
|||
ON s.id = ls.site_id AND s.flag = 0 |
|||
|
|||
LEFT JOIN latest_store_area lsa |
|||
ON lsa.building_id = bsales.building_id |
|||
|
|||
LEFT JOIN dashboard_level_store_area_merge sam |
|||
ON sam.id = lsa.store_area_id AND sam.flag = 0 |
|||
|
|||
LEFT JOIN latest_branch lb |
|||
ON lb.building_id = bsales.building_id |
|||
|
|||
LEFT JOIN dashboard_level_branch br |
|||
ON br.id = lb.branch_id AND br.flag = 0 |
|||
|
|||
WHERE |
|||
bsales.flag != 1 |
|||
AND bcomp.flag != 1 |
|||
|
|||
AND bsales.company_id IN |
|||
<foreach collection="companyIdList" item="item" open="(" separator="," close=")"> |
|||
#{item} |
|||
</foreach> |
|||
|
|||
<if test="idList != null"> |
|||
AND bsales.id IN |
|||
<foreach collection="idList" item="item" open="(" separator="," close=")"> |
|||
#{item} |
|||
</foreach> |
|||
</if> |
|||
|
|||
<if test="salesforceId != null and salesforceId != '' "> |
|||
AND bsales.salesforce_id LIKE CONCAT('%',#{salesforceId},'%') |
|||
</if> |
|||
|
|||
ORDER BY bsales.id DESC |
|||
|
|||
</select> |
|||
|
|||
<select id="getDevicePageForBinding" resultType="com.techsor.datacenter.business.vo.device.DeviceShortVO"> |
|||
SELECT |
|||
di.* |
|||
FROM |
|||
device_info di |
|||
WHERE di.flag = 0 |
|||
AND di.company_id IN |
|||
<foreach collection="companyIdList" item="item" open="(" separator="," close=")"> |
|||
#{item} |
|||
</foreach> |
|||
AND NOT EXISTS ( |
|||
SELECT 1 FROM salesforce_device_relation sdr |
|||
WHERE sdr.device_info_id = di.id |
|||
<!-- AND sdr.salesforce_info_id = #{id}--> |
|||
) |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,36 @@ |
|||
<?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.SalesforceFacilityMapperExt"> |
|||
|
|||
|
|||
<insert id="upsert"> |
|||
INSERT INTO salesforce_facility ( |
|||
salesforce_id, |
|||
facility_id_c, |
|||
name, |
|||
owner_id, |
|||
is_deleted, |
|||
extra_json, |
|||
created_at, |
|||
updated_at |
|||
) |
|||
VALUES ( |
|||
#{salesforceId}, |
|||
#{facilityIdC}, |
|||
#{name}, |
|||
#{ownerId}, |
|||
#{isDeleted}, |
|||
#{extraJson}, |
|||
NOW(), |
|||
NOW() |
|||
) |
|||
ON DUPLICATE KEY UPDATE |
|||
facility_id_c = VALUES(facility_id_c), |
|||
name = VALUES(name), |
|||
owner_id = VALUES(owner_id), |
|||
is_deleted = VALUES(is_deleted), |
|||
extra_json = VALUES(extra_json), |
|||
updated_at = NOW() |
|||
</insert> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,16 @@ |
|||
package com.techsor.datacenter.business.dto.salesforce; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author Mr.Jiang |
|||
* @time 2022年7月21日 下午8:50:31 |
|||
*/ |
|||
@Data |
|||
public class DeleteSalesforceParams{ |
|||
|
|||
@Schema(description = "Salesforce IDs, multiple IDs separated by comma", example = "2738967,587") |
|||
private String ids; |
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.techsor.datacenter.business.dto.salesforce; |
|||
|
|||
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 OptSalesforceParams{ |
|||
|
|||
@Schema(description = "unique identifier ID, not required for new entries", example = "2738967") |
|||
private Long id; |
|||
|
|||
@Schema(description = "Company ID", example = "2738967", hidden = true) |
|||
private Long companyId; |
|||
|
|||
@Schema(description = "Salesforce id", example = "testSalesforce1", required = true) |
|||
private String salesforceId; |
|||
|
|||
@Schema(description = "Building ID", example = "25") |
|||
private Long buildingId; |
|||
|
|||
@Schema(description = "device primary key ID list", example = "[]") |
|||
private List<Long> deviceInfoIdList; |
|||
|
|||
@Schema(description = "备注", example = "user1", required = true) |
|||
private String remark; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.techsor.datacenter.business.dto.salesforce; |
|||
|
|||
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 SalesforceBingDeviceSearchParams extends BaseSearchParams{ |
|||
|
|||
|
|||
// @Schema(description = "Salesforce primary key ID", example = "1")
|
|||
// private Long id;
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.techsor.datacenter.business.dto.salesforce; |
|||
|
|||
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 SalesforceSearchParams extends BaseSearchParams{ |
|||
|
|||
|
|||
@Schema(description = "Salesforce id", example = "testSalesforce1", required = true) |
|||
private String salesforceId; |
|||
|
|||
@Schema(description = "Salesforce IDs, multiple IDs separated by comma", example = "1,47") |
|||
private String ids; |
|||
|
|||
@Schema(description = "Salesforce IDs", hidden = true) |
|||
private List<Long> idList; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,370 @@ |
|||
package com.techsor.datacenter.business.model; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
public class BasicSalesforce implements Serializable { |
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column basic_salesforce.id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Long id; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column basic_salesforce.company_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Long companyId; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column basic_salesforce.salesforce_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private String salesforceId; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column basic_salesforce.building_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Long buildingId; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column basic_salesforce.remark |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column basic_salesforce.flag |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Integer flag; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column basic_salesforce.create_time |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Long createTime; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column basic_salesforce.creator_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Long creatorId; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column basic_salesforce.modify_time |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Long modifyTime; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column basic_salesforce.modifier_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Long modifierId; |
|||
|
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column basic_salesforce.id |
|||
* |
|||
* @return the value of basic_salesforce.id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Long getId() { |
|||
return id; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column basic_salesforce.id |
|||
* |
|||
* @param id the value for basic_salesforce.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 basic_salesforce.company_id |
|||
* |
|||
* @return the value of basic_salesforce.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 basic_salesforce.company_id |
|||
* |
|||
* @param companyId the value for basic_salesforce.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 basic_salesforce.salesforce_id |
|||
* |
|||
* @return the value of basic_salesforce.salesforce_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public String getSalesforceId() { |
|||
return salesforceId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column basic_salesforce.salesforce_id |
|||
* |
|||
* @param salesforceId the value for basic_salesforce.salesforce_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setSalesforceId(String salesforceId) { |
|||
this.salesforceId = salesforceId == null ? null : salesforceId.trim(); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column basic_salesforce.building_id |
|||
* |
|||
* @return the value of basic_salesforce.building_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Long getBuildingId() { |
|||
return buildingId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column basic_salesforce.building_id |
|||
* |
|||
* @param buildingId the value for basic_salesforce.building_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setBuildingId(Long buildingId) { |
|||
this.buildingId = buildingId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column basic_salesforce.remark |
|||
* |
|||
* @return the value of basic_salesforce.remark |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public String getRemark() { |
|||
return remark; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column basic_salesforce.remark |
|||
* |
|||
* @param remark the value for basic_salesforce.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 basic_salesforce.flag |
|||
* |
|||
* @return the value of basic_salesforce.flag |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Integer getFlag() { |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column basic_salesforce.flag |
|||
* |
|||
* @param flag the value for basic_salesforce.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 basic_salesforce.create_time |
|||
* |
|||
* @return the value of basic_salesforce.create_time |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Long getCreateTime() { |
|||
return createTime; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column basic_salesforce.create_time |
|||
* |
|||
* @param createTime the value for basic_salesforce.create_time |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setCreateTime(Long createTime) { |
|||
this.createTime = createTime; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column basic_salesforce.creator_id |
|||
* |
|||
* @return the value of basic_salesforce.creator_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Long getCreatorId() { |
|||
return creatorId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column basic_salesforce.creator_id |
|||
* |
|||
* @param creatorId the value for basic_salesforce.creator_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setCreatorId(Long creatorId) { |
|||
this.creatorId = creatorId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column basic_salesforce.modify_time |
|||
* |
|||
* @return the value of basic_salesforce.modify_time |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Long getModifyTime() { |
|||
return modifyTime; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column basic_salesforce.modify_time |
|||
* |
|||
* @param modifyTime the value for basic_salesforce.modify_time |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setModifyTime(Long modifyTime) { |
|||
this.modifyTime = modifyTime; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column basic_salesforce.modifier_id |
|||
* |
|||
* @return the value of basic_salesforce.modifier_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Long getModifierId() { |
|||
return modifierId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column basic_salesforce.modifier_id |
|||
* |
|||
* @param modifierId the value for basic_salesforce.modifier_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setModifierId(Long modifierId) { |
|||
this.modifierId = modifierId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @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(", salesforceId=").append(salesforceId); |
|||
sb.append(", buildingId=").append(buildingId); |
|||
sb.append(", remark=").append(remark); |
|||
sb.append(", flag=").append(flag); |
|||
sb.append(", createTime=").append(createTime); |
|||
sb.append(", creatorId=").append(creatorId); |
|||
sb.append(", modifyTime=").append(modifyTime); |
|||
sb.append(", modifierId=").append(modifierId); |
|||
sb.append(", serialVersionUID=").append(serialVersionUID); |
|||
sb.append("]"); |
|||
return sb.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,922 @@ |
|||
package com.techsor.datacenter.business.model; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
public class BasicSalesforceExample { |
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
protected String orderByClause; |
|||
|
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
protected boolean distinct; |
|||
|
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
protected List<Criteria> oredCriteria; |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public BasicSalesforceExample() { |
|||
oredCriteria = new ArrayList<Criteria>(); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setOrderByClause(String orderByClause) { |
|||
this.orderByClause = orderByClause; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public String getOrderByClause() { |
|||
return orderByClause; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setDistinct(boolean distinct) { |
|||
this.distinct = distinct; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public boolean isDistinct() { |
|||
return distinct; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public List<Criteria> getOredCriteria() { |
|||
return oredCriteria; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void or(Criteria criteria) { |
|||
oredCriteria.add(criteria); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table basic_salesforce |
|||
* |
|||
* @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 basic_salesforce |
|||
* |
|||
* @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 basic_salesforce |
|||
* |
|||
* @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 basic_salesforce |
|||
* |
|||
* @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 basic_salesforce |
|||
* |
|||
* @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 andSalesforceIdIsNull() { |
|||
addCriterion("salesforce_id is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdIsNotNull() { |
|||
addCriterion("salesforce_id is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdEqualTo(String value) { |
|||
addCriterion("salesforce_id =", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdNotEqualTo(String value) { |
|||
addCriterion("salesforce_id <>", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdGreaterThan(String value) { |
|||
addCriterion("salesforce_id >", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdGreaterThanOrEqualTo(String value) { |
|||
addCriterion("salesforce_id >=", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdLessThan(String value) { |
|||
addCriterion("salesforce_id <", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdLessThanOrEqualTo(String value) { |
|||
addCriterion("salesforce_id <=", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdLike(String value) { |
|||
addCriterion("salesforce_id like", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdNotLike(String value) { |
|||
addCriterion("salesforce_id not like", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdIn(List<String> values) { |
|||
addCriterion("salesforce_id in", values, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdNotIn(List<String> values) { |
|||
addCriterion("salesforce_id not in", values, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdBetween(String value1, String value2) { |
|||
addCriterion("salesforce_id between", value1, value2, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdNotBetween(String value1, String value2) { |
|||
addCriterion("salesforce_id not between", value1, value2, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdIsNull() { |
|||
addCriterion("building_id is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdIsNotNull() { |
|||
addCriterion("building_id is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdEqualTo(Long value) { |
|||
addCriterion("building_id =", value, "buildingId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdNotEqualTo(Long value) { |
|||
addCriterion("building_id <>", value, "buildingId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdGreaterThan(Long value) { |
|||
addCriterion("building_id >", value, "buildingId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdGreaterThanOrEqualTo(Long value) { |
|||
addCriterion("building_id >=", value, "buildingId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdLessThan(Long value) { |
|||
addCriterion("building_id <", value, "buildingId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdLessThanOrEqualTo(Long value) { |
|||
addCriterion("building_id <=", value, "buildingId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdIn(List<Long> values) { |
|||
addCriterion("building_id in", values, "buildingId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdNotIn(List<Long> values) { |
|||
addCriterion("building_id not in", values, "buildingId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdBetween(Long value1, Long value2) { |
|||
addCriterion("building_id between", value1, value2, "buildingId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andBuildingIdNotBetween(Long value1, Long value2) { |
|||
addCriterion("building_id not between", value1, value2, "buildingId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
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 andCreateTimeIsNull() { |
|||
addCriterion("create_time is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeIsNotNull() { |
|||
addCriterion("create_time is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeEqualTo(Long value) { |
|||
addCriterion("create_time =", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeNotEqualTo(Long value) { |
|||
addCriterion("create_time <>", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeGreaterThan(Long value) { |
|||
addCriterion("create_time >", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { |
|||
addCriterion("create_time >=", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeLessThan(Long value) { |
|||
addCriterion("create_time <", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeLessThanOrEqualTo(Long value) { |
|||
addCriterion("create_time <=", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeIn(List<Long> values) { |
|||
addCriterion("create_time in", values, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeNotIn(List<Long> values) { |
|||
addCriterion("create_time not in", values, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeBetween(Long value1, Long value2) { |
|||
addCriterion("create_time between", value1, value2, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeNotBetween(Long value1, Long value2) { |
|||
addCriterion("create_time not between", value1, value2, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdIsNull() { |
|||
addCriterion("creator_id is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdIsNotNull() { |
|||
addCriterion("creator_id is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdEqualTo(Long value) { |
|||
addCriterion("creator_id =", value, "creatorId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdNotEqualTo(Long value) { |
|||
addCriterion("creator_id <>", value, "creatorId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdGreaterThan(Long value) { |
|||
addCriterion("creator_id >", value, "creatorId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { |
|||
addCriterion("creator_id >=", value, "creatorId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdLessThan(Long value) { |
|||
addCriterion("creator_id <", value, "creatorId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdLessThanOrEqualTo(Long value) { |
|||
addCriterion("creator_id <=", value, "creatorId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdIn(List<Long> values) { |
|||
addCriterion("creator_id in", values, "creatorId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdNotIn(List<Long> values) { |
|||
addCriterion("creator_id not in", values, "creatorId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdBetween(Long value1, Long value2) { |
|||
addCriterion("creator_id between", value1, value2, "creatorId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatorIdNotBetween(Long value1, Long value2) { |
|||
addCriterion("creator_id not between", value1, value2, "creatorId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeIsNull() { |
|||
addCriterion("modify_time is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeIsNotNull() { |
|||
addCriterion("modify_time is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeEqualTo(Long value) { |
|||
addCriterion("modify_time =", value, "modifyTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeNotEqualTo(Long value) { |
|||
addCriterion("modify_time <>", value, "modifyTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeGreaterThan(Long value) { |
|||
addCriterion("modify_time >", value, "modifyTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeGreaterThanOrEqualTo(Long value) { |
|||
addCriterion("modify_time >=", value, "modifyTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeLessThan(Long value) { |
|||
addCriterion("modify_time <", value, "modifyTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeLessThanOrEqualTo(Long value) { |
|||
addCriterion("modify_time <=", value, "modifyTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeIn(List<Long> values) { |
|||
addCriterion("modify_time in", values, "modifyTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeNotIn(List<Long> values) { |
|||
addCriterion("modify_time not in", values, "modifyTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeBetween(Long value1, Long value2) { |
|||
addCriterion("modify_time between", value1, value2, "modifyTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifyTimeNotBetween(Long value1, Long value2) { |
|||
addCriterion("modify_time not between", value1, value2, "modifyTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdIsNull() { |
|||
addCriterion("modifier_id is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdIsNotNull() { |
|||
addCriterion("modifier_id is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdEqualTo(Long value) { |
|||
addCriterion("modifier_id =", value, "modifierId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdNotEqualTo(Long value) { |
|||
addCriterion("modifier_id <>", value, "modifierId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdGreaterThan(Long value) { |
|||
addCriterion("modifier_id >", value, "modifierId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdGreaterThanOrEqualTo(Long value) { |
|||
addCriterion("modifier_id >=", value, "modifierId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdLessThan(Long value) { |
|||
addCriterion("modifier_id <", value, "modifierId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdLessThanOrEqualTo(Long value) { |
|||
addCriterion("modifier_id <=", value, "modifierId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdIn(List<Long> values) { |
|||
addCriterion("modifier_id in", values, "modifierId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdNotIn(List<Long> values) { |
|||
addCriterion("modifier_id not in", values, "modifierId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdBetween(Long value1, Long value2) { |
|||
addCriterion("modifier_id between", value1, value2, "modifierId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andModifierIdNotBetween(Long value1, Long value2) { |
|||
addCriterion("modifier_id not between", value1, value2, "modifierId"); |
|||
return (Criteria) this; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* This class was generated by MyBatis Generator. |
|||
* This class corresponds to the database table basic_salesforce |
|||
* |
|||
* @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 basic_salesforce |
|||
* |
|||
* @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); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,132 @@ |
|||
package com.techsor.datacenter.business.model; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
public class SalesforceDeviceRelation implements Serializable { |
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_device_relation.salesforce_info_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Long salesforceInfoId; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_device_relation.device_info_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Long deviceInfoId; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_device_relation.create_time |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Long createTime; |
|||
|
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column salesforce_device_relation.salesforce_info_id |
|||
* |
|||
* @return the value of salesforce_device_relation.salesforce_info_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Long getSalesforceInfoId() { |
|||
return salesforceInfoId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_device_relation.salesforce_info_id |
|||
* |
|||
* @param salesforceInfoId the value for salesforce_device_relation.salesforce_info_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setSalesforceInfoId(Long salesforceInfoId) { |
|||
this.salesforceInfoId = salesforceInfoId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column salesforce_device_relation.device_info_id |
|||
* |
|||
* @return the value of salesforce_device_relation.device_info_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Long getDeviceInfoId() { |
|||
return deviceInfoId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_device_relation.device_info_id |
|||
* |
|||
* @param deviceInfoId the value for salesforce_device_relation.device_info_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setDeviceInfoId(Long deviceInfoId) { |
|||
this.deviceInfoId = deviceInfoId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column salesforce_device_relation.create_time |
|||
* |
|||
* @return the value of salesforce_device_relation.create_time |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Long getCreateTime() { |
|||
return createTime; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_device_relation.create_time |
|||
* |
|||
* @param createTime the value for salesforce_device_relation.create_time |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setCreateTime(Long createTime) { |
|||
this.createTime = createTime; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
@Override |
|||
public String toString() { |
|||
StringBuilder sb = new StringBuilder(); |
|||
sb.append(getClass().getSimpleName()); |
|||
sb.append(" ["); |
|||
sb.append("Hash = ").append(hashCode()); |
|||
sb.append(", salesforceInfoId=").append(salesforceInfoId); |
|||
sb.append(", deviceInfoId=").append(deviceInfoId); |
|||
sb.append(", createTime=").append(createTime); |
|||
sb.append(", serialVersionUID=").append(serialVersionUID); |
|||
sb.append("]"); |
|||
return sb.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,482 @@ |
|||
package com.techsor.datacenter.business.model; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
public class SalesforceDeviceRelationExample { |
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
protected String orderByClause; |
|||
|
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
protected boolean distinct; |
|||
|
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
protected List<Criteria> oredCriteria; |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public SalesforceDeviceRelationExample() { |
|||
oredCriteria = new ArrayList<Criteria>(); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setOrderByClause(String orderByClause) { |
|||
this.orderByClause = orderByClause; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public String getOrderByClause() { |
|||
return orderByClause; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setDistinct(boolean distinct) { |
|||
this.distinct = distinct; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public boolean isDistinct() { |
|||
return distinct; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public List<Criteria> getOredCriteria() { |
|||
return oredCriteria; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void or(Criteria criteria) { |
|||
oredCriteria.add(criteria); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @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 salesforce_device_relation |
|||
* |
|||
* @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 salesforce_device_relation |
|||
* |
|||
* @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 salesforce_device_relation |
|||
* |
|||
* @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 salesforce_device_relation |
|||
* |
|||
* @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 andSalesforceInfoIdIsNull() { |
|||
addCriterion("salesforce_info_id is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdIsNotNull() { |
|||
addCriterion("salesforce_info_id is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdEqualTo(Long value) { |
|||
addCriterion("salesforce_info_id =", value, "salesforceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdNotEqualTo(Long value) { |
|||
addCriterion("salesforce_info_id <>", value, "salesforceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdGreaterThan(Long value) { |
|||
addCriterion("salesforce_info_id >", value, "salesforceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdGreaterThanOrEqualTo(Long value) { |
|||
addCriterion("salesforce_info_id >=", value, "salesforceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdLessThan(Long value) { |
|||
addCriterion("salesforce_info_id <", value, "salesforceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdLessThanOrEqualTo(Long value) { |
|||
addCriterion("salesforce_info_id <=", value, "salesforceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdIn(List<Long> values) { |
|||
addCriterion("salesforce_info_id in", values, "salesforceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdNotIn(List<Long> values) { |
|||
addCriterion("salesforce_info_id not in", values, "salesforceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdBetween(Long value1, Long value2) { |
|||
addCriterion("salesforce_info_id between", value1, value2, "salesforceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceInfoIdNotBetween(Long value1, Long value2) { |
|||
addCriterion("salesforce_info_id not between", value1, value2, "salesforceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdIsNull() { |
|||
addCriterion("device_info_id is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdIsNotNull() { |
|||
addCriterion("device_info_id is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdEqualTo(Long value) { |
|||
addCriterion("device_info_id =", value, "deviceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdNotEqualTo(Long value) { |
|||
addCriterion("device_info_id <>", value, "deviceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdGreaterThan(Long value) { |
|||
addCriterion("device_info_id >", value, "deviceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdGreaterThanOrEqualTo(Long value) { |
|||
addCriterion("device_info_id >=", value, "deviceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdLessThan(Long value) { |
|||
addCriterion("device_info_id <", value, "deviceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdLessThanOrEqualTo(Long value) { |
|||
addCriterion("device_info_id <=", value, "deviceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdIn(List<Long> values) { |
|||
addCriterion("device_info_id in", values, "deviceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdNotIn(List<Long> values) { |
|||
addCriterion("device_info_id not in", values, "deviceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdBetween(Long value1, Long value2) { |
|||
addCriterion("device_info_id between", value1, value2, "deviceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDeviceInfoIdNotBetween(Long value1, Long value2) { |
|||
addCriterion("device_info_id not between", value1, value2, "deviceInfoId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeIsNull() { |
|||
addCriterion("create_time is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeIsNotNull() { |
|||
addCriterion("create_time is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeEqualTo(Long value) { |
|||
addCriterion("create_time =", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeNotEqualTo(Long value) { |
|||
addCriterion("create_time <>", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeGreaterThan(Long value) { |
|||
addCriterion("create_time >", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { |
|||
addCriterion("create_time >=", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeLessThan(Long value) { |
|||
addCriterion("create_time <", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeLessThanOrEqualTo(Long value) { |
|||
addCriterion("create_time <=", value, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeIn(List<Long> values) { |
|||
addCriterion("create_time in", values, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeNotIn(List<Long> values) { |
|||
addCriterion("create_time not in", values, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeBetween(Long value1, Long value2) { |
|||
addCriterion("create_time between", value1, value2, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreateTimeNotBetween(Long value1, Long value2) { |
|||
addCriterion("create_time not between", value1, value2, "createTime"); |
|||
return (Criteria) this; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* This class was generated by MyBatis Generator. |
|||
* This class corresponds to the database table salesforce_device_relation |
|||
* |
|||
* @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 salesforce_device_relation |
|||
* |
|||
* @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); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,303 @@ |
|||
package com.techsor.datacenter.business.model; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
public class SalesforceFacility implements Serializable { |
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_facility.salesforce_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private String salesforceId; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_facility.facility_id_c |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private String facilityIdC; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_facility.name |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_facility.owner_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private String ownerId; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_facility.is_deleted |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Boolean isDeleted; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_facility.created_at |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Date createdAt; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_facility.updated_at |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private Date updatedAt; |
|||
|
|||
/** |
|||
* |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database column salesforce_facility.extra_json |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private String extraJson; |
|||
|
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column salesforce_facility.salesforce_id |
|||
* |
|||
* @return the value of salesforce_facility.salesforce_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public String getSalesforceId() { |
|||
return salesforceId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_facility.salesforce_id |
|||
* |
|||
* @param salesforceId the value for salesforce_facility.salesforce_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setSalesforceId(String salesforceId) { |
|||
this.salesforceId = salesforceId == null ? null : salesforceId.trim(); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column salesforce_facility.facility_id_c |
|||
* |
|||
* @return the value of salesforce_facility.facility_id_c |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public String getFacilityIdC() { |
|||
return facilityIdC; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_facility.facility_id_c |
|||
* |
|||
* @param facilityIdC the value for salesforce_facility.facility_id_c |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setFacilityIdC(String facilityIdC) { |
|||
this.facilityIdC = facilityIdC == null ? null : facilityIdC.trim(); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column salesforce_facility.name |
|||
* |
|||
* @return the value of salesforce_facility.name |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_facility.name |
|||
* |
|||
* @param name the value for salesforce_facility.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 salesforce_facility.owner_id |
|||
* |
|||
* @return the value of salesforce_facility.owner_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public String getOwnerId() { |
|||
return ownerId; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_facility.owner_id |
|||
* |
|||
* @param ownerId the value for salesforce_facility.owner_id |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setOwnerId(String ownerId) { |
|||
this.ownerId = ownerId == null ? null : ownerId.trim(); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column salesforce_facility.is_deleted |
|||
* |
|||
* @return the value of salesforce_facility.is_deleted |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Boolean getIsDeleted() { |
|||
return isDeleted; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_facility.is_deleted |
|||
* |
|||
* @param isDeleted the value for salesforce_facility.is_deleted |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setIsDeleted(Boolean isDeleted) { |
|||
this.isDeleted = isDeleted; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column salesforce_facility.created_at |
|||
* |
|||
* @return the value of salesforce_facility.created_at |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Date getCreatedAt() { |
|||
return createdAt; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_facility.created_at |
|||
* |
|||
* @param createdAt the value for salesforce_facility.created_at |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setCreatedAt(Date createdAt) { |
|||
this.createdAt = createdAt; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column salesforce_facility.updated_at |
|||
* |
|||
* @return the value of salesforce_facility.updated_at |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public Date getUpdatedAt() { |
|||
return updatedAt; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_facility.updated_at |
|||
* |
|||
* @param updatedAt the value for salesforce_facility.updated_at |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setUpdatedAt(Date updatedAt) { |
|||
this.updatedAt = updatedAt; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method returns the value of the database column salesforce_facility.extra_json |
|||
* |
|||
* @return the value of salesforce_facility.extra_json |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public String getExtraJson() { |
|||
return extraJson; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method sets the value of the database column salesforce_facility.extra_json |
|||
* |
|||
* @param extraJson the value for salesforce_facility.extra_json |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setExtraJson(String extraJson) { |
|||
this.extraJson = extraJson == null ? null : extraJson.trim(); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
@Override |
|||
public String toString() { |
|||
StringBuilder sb = new StringBuilder(); |
|||
sb.append(getClass().getSimpleName()); |
|||
sb.append(" ["); |
|||
sb.append("Hash = ").append(hashCode()); |
|||
sb.append(", salesforceId=").append(salesforceId); |
|||
sb.append(", facilityIdC=").append(facilityIdC); |
|||
sb.append(", name=").append(name); |
|||
sb.append(", ownerId=").append(ownerId); |
|||
sb.append(", isDeleted=").append(isDeleted); |
|||
sb.append(", createdAt=").append(createdAt); |
|||
sb.append(", updatedAt=").append(updatedAt); |
|||
sb.append(", extraJson=").append(extraJson); |
|||
sb.append(", serialVersionUID=").append(serialVersionUID); |
|||
sb.append("]"); |
|||
return sb.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,763 @@ |
|||
package com.techsor.datacenter.business.model; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
public class SalesforceFacilityExample { |
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
protected String orderByClause; |
|||
|
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
protected boolean distinct; |
|||
|
|||
/** |
|||
* This field was generated by MyBatis Generator. |
|||
* This field corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
protected List<Criteria> oredCriteria; |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public SalesforceFacilityExample() { |
|||
oredCriteria = new ArrayList<Criteria>(); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setOrderByClause(String orderByClause) { |
|||
this.orderByClause = orderByClause; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public String getOrderByClause() { |
|||
return orderByClause; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void setDistinct(boolean distinct) { |
|||
this.distinct = distinct; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public boolean isDistinct() { |
|||
return distinct; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public List<Criteria> getOredCriteria() { |
|||
return oredCriteria; |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @mbg.generated |
|||
*/ |
|||
public void or(Criteria criteria) { |
|||
oredCriteria.add(criteria); |
|||
} |
|||
|
|||
/** |
|||
* This method was generated by MyBatis Generator. |
|||
* This method corresponds to the database table salesforce_facility |
|||
* |
|||
* @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 salesforce_facility |
|||
* |
|||
* @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 salesforce_facility |
|||
* |
|||
* @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 salesforce_facility |
|||
* |
|||
* @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 salesforce_facility |
|||
* |
|||
* @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 andSalesforceIdIsNull() { |
|||
addCriterion("salesforce_id is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdIsNotNull() { |
|||
addCriterion("salesforce_id is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdEqualTo(String value) { |
|||
addCriterion("salesforce_id =", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdNotEqualTo(String value) { |
|||
addCriterion("salesforce_id <>", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdGreaterThan(String value) { |
|||
addCriterion("salesforce_id >", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdGreaterThanOrEqualTo(String value) { |
|||
addCriterion("salesforce_id >=", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdLessThan(String value) { |
|||
addCriterion("salesforce_id <", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdLessThanOrEqualTo(String value) { |
|||
addCriterion("salesforce_id <=", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdLike(String value) { |
|||
addCriterion("salesforce_id like", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdNotLike(String value) { |
|||
addCriterion("salesforce_id not like", value, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdIn(List<String> values) { |
|||
addCriterion("salesforce_id in", values, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdNotIn(List<String> values) { |
|||
addCriterion("salesforce_id not in", values, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdBetween(String value1, String value2) { |
|||
addCriterion("salesforce_id between", value1, value2, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andSalesforceIdNotBetween(String value1, String value2) { |
|||
addCriterion("salesforce_id not between", value1, value2, "salesforceId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCIsNull() { |
|||
addCriterion("facility_id_c is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCIsNotNull() { |
|||
addCriterion("facility_id_c is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCEqualTo(String value) { |
|||
addCriterion("facility_id_c =", value, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCNotEqualTo(String value) { |
|||
addCriterion("facility_id_c <>", value, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCGreaterThan(String value) { |
|||
addCriterion("facility_id_c >", value, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCGreaterThanOrEqualTo(String value) { |
|||
addCriterion("facility_id_c >=", value, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCLessThan(String value) { |
|||
addCriterion("facility_id_c <", value, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCLessThanOrEqualTo(String value) { |
|||
addCriterion("facility_id_c <=", value, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCLike(String value) { |
|||
addCriterion("facility_id_c like", value, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCNotLike(String value) { |
|||
addCriterion("facility_id_c not like", value, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCIn(List<String> values) { |
|||
addCriterion("facility_id_c in", values, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCNotIn(List<String> values) { |
|||
addCriterion("facility_id_c not in", values, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCBetween(String value1, String value2) { |
|||
addCriterion("facility_id_c between", value1, value2, "facilityIdC"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andFacilityIdCNotBetween(String value1, String value2) { |
|||
addCriterion("facility_id_c not between", value1, value2, "facilityIdC"); |
|||
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 andOwnerIdIsNull() { |
|||
addCriterion("owner_id is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdIsNotNull() { |
|||
addCriterion("owner_id is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdEqualTo(String value) { |
|||
addCriterion("owner_id =", value, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdNotEqualTo(String value) { |
|||
addCriterion("owner_id <>", value, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdGreaterThan(String value) { |
|||
addCriterion("owner_id >", value, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdGreaterThanOrEqualTo(String value) { |
|||
addCriterion("owner_id >=", value, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdLessThan(String value) { |
|||
addCriterion("owner_id <", value, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdLessThanOrEqualTo(String value) { |
|||
addCriterion("owner_id <=", value, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdLike(String value) { |
|||
addCriterion("owner_id like", value, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdNotLike(String value) { |
|||
addCriterion("owner_id not like", value, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdIn(List<String> values) { |
|||
addCriterion("owner_id in", values, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdNotIn(List<String> values) { |
|||
addCriterion("owner_id not in", values, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdBetween(String value1, String value2) { |
|||
addCriterion("owner_id between", value1, value2, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andOwnerIdNotBetween(String value1, String value2) { |
|||
addCriterion("owner_id not between", value1, value2, "ownerId"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedIsNull() { |
|||
addCriterion("is_deleted is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedIsNotNull() { |
|||
addCriterion("is_deleted is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedEqualTo(Boolean value) { |
|||
addCriterion("is_deleted =", value, "isDeleted"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedNotEqualTo(Boolean value) { |
|||
addCriterion("is_deleted <>", value, "isDeleted"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedGreaterThan(Boolean value) { |
|||
addCriterion("is_deleted >", value, "isDeleted"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedGreaterThanOrEqualTo(Boolean value) { |
|||
addCriterion("is_deleted >=", value, "isDeleted"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedLessThan(Boolean value) { |
|||
addCriterion("is_deleted <", value, "isDeleted"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedLessThanOrEqualTo(Boolean value) { |
|||
addCriterion("is_deleted <=", value, "isDeleted"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedIn(List<Boolean> values) { |
|||
addCriterion("is_deleted in", values, "isDeleted"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedNotIn(List<Boolean> values) { |
|||
addCriterion("is_deleted not in", values, "isDeleted"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedBetween(Boolean value1, Boolean value2) { |
|||
addCriterion("is_deleted between", value1, value2, "isDeleted"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIsDeletedNotBetween(Boolean value1, Boolean value2) { |
|||
addCriterion("is_deleted not between", value1, value2, "isDeleted"); |
|||
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(Date value) { |
|||
addCriterion("created_at =", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtNotEqualTo(Date value) { |
|||
addCriterion("created_at <>", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtGreaterThan(Date value) { |
|||
addCriterion("created_at >", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { |
|||
addCriterion("created_at >=", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtLessThan(Date value) { |
|||
addCriterion("created_at <", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtLessThanOrEqualTo(Date value) { |
|||
addCriterion("created_at <=", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtIn(List<Date> values) { |
|||
addCriterion("created_at in", values, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtNotIn(List<Date> values) { |
|||
addCriterion("created_at not in", values, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtBetween(Date value1, Date value2) { |
|||
addCriterion("created_at between", value1, value2, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtNotBetween(Date value1, Date 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(Date value) { |
|||
addCriterion("updated_at =", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtNotEqualTo(Date value) { |
|||
addCriterion("updated_at <>", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtGreaterThan(Date value) { |
|||
addCriterion("updated_at >", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { |
|||
addCriterion("updated_at >=", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtLessThan(Date value) { |
|||
addCriterion("updated_at <", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { |
|||
addCriterion("updated_at <=", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtIn(List<Date> values) { |
|||
addCriterion("updated_at in", values, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtNotIn(List<Date> values) { |
|||
addCriterion("updated_at not in", values, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtBetween(Date value1, Date value2) { |
|||
addCriterion("updated_at between", value1, value2, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { |
|||
addCriterion("updated_at not between", value1, value2, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* This class was generated by MyBatis Generator. |
|||
* This class corresponds to the database table salesforce_facility |
|||
* |
|||
* @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 salesforce_facility |
|||
* |
|||
* @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); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
package com.techsor.datacenter.business.vo.device; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/****** |
|||
* create table device_info |
|||
* ( |
|||
* id int auto_increment |
|||
* primary key, |
|||
* device_id varchar(45) not null, |
|||
* device_sn varchar(99) null comment '用于记录SN,当SN与deviceId不同时使用', |
|||
* type_id int null, |
|||
* wsclient_id int null, |
|||
* space_id bigint null comment '空间ID', |
|||
* device_name varchar(200) null comment '设备名称', |
|||
* remark varchar(500) null comment '备注信息', |
|||
* building_id bigint null comment '楼宇ID', |
|||
* assset_id bigint null comment '资产ID', |
|||
* flag int null, |
|||
* company_id bigint null comment '公司ID', |
|||
* created_by bigint null, |
|||
* created_timestamp timestamp null, |
|||
* updated_by bigint null, |
|||
* updated_timestamp bigint null, |
|||
* project_id bigint null comment '项目ID', |
|||
* floor_id bigint null comment '楼宇ID', |
|||
* constraint device_id_UNIQUE |
|||
* unique (device_id) |
|||
* ) |
|||
* comment '需要解析的zeta设备'; |
|||
* |
|||
* **/ |
|||
@Data |
|||
public class DeviceShortVO { |
|||
|
|||
private Long id; |
|||
|
|||
private String deviceId; |
|||
|
|||
private String deviceSn; |
|||
|
|||
private String deviceName; |
|||
|
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
package com.techsor.datacenter.business.vo.salesforce; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author Mr.Jiang |
|||
* @time 2022年7月21日 下午8:50:31 |
|||
*/ |
|||
@Data |
|||
public class SalesforcePageVO { |
|||
|
|||
@Schema(description = "primary key ID", example = "2738967") |
|||
private Long id; |
|||
|
|||
@Schema(description = "Company ID", example = "2738967", hidden = true) |
|||
private Long companyId; |
|||
|
|||
@Schema(description = "Salesforce id", example = "testSalesforce1", required = true) |
|||
private String salesforceId; |
|||
|
|||
@Schema(description = "Building ID", example = "25") |
|||
private Long buildingId; |
|||
|
|||
@Schema(description = "楼宇名", example = "user1", required = true) |
|||
private String buildingName; |
|||
|
|||
@Schema(description = "楼宇自定义ID", example = "123AAA6", required = true) |
|||
private String udfBuildingId; |
|||
|
|||
@Schema(description = "支社名称", example = "user1", required = false) |
|||
private String branchName; |
|||
|
|||
@Schema(description = "支社编码", example = "user1", required = false) |
|||
private String branchCode; |
|||
|
|||
@Schema(description = "支店区域名称", example = "user1", required = false) |
|||
private String storeAreaName; |
|||
|
|||
@Schema(description = "支店区域编码", example = "user1", required = false) |
|||
private String storeAreaCode; |
|||
|
|||
@Schema(description = "site名称", example = "user1", required = false) |
|||
private String siteName; |
|||
|
|||
@Schema(description = "site编码", example = "user1", required = false) |
|||
private String siteCode; |
|||
|
|||
|
|||
@Schema(description = "备注", example = "user1", required = true, hidden = true) |
|||
private String remark; |
|||
|
|||
@Schema(description = "device primary key ID,separated by commas", example = "1,2,3") |
|||
private String deviceInfoIds; |
|||
|
|||
@Schema(description = "device id,separated by commas", example = "dd1,dd2,dd3") |
|||
private String deviceIds; |
|||
|
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
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.salesforce.DeleteSalesforceParams; |
|||
import com.techsor.datacenter.business.dto.salesforce.SalesforceBingDeviceSearchParams; |
|||
import com.techsor.datacenter.business.dto.salesforce.SalesforceSearchParams; |
|||
import com.techsor.datacenter.business.dto.salesforce.OptSalesforceParams; |
|||
import com.techsor.datacenter.business.vo.device.DeviceShortVO; |
|||
import com.techsor.datacenter.business.vo.salesforce.SalesforcePageVO; |
|||
|
|||
/** |
|||
* |
|||
* @author jwy-style |
|||
* |
|||
*/ |
|||
public interface SalesforceService { |
|||
|
|||
SimpleDataResponse add(OptSalesforceParams optSalesforceParams, Long userId, Long companyId, Integer languageType); |
|||
|
|||
SimpleDataResponse edit(OptSalesforceParams optSalesforceParams, Long userId, Long companyId, Integer languageType); |
|||
|
|||
SimpleDataResponse batchDelete(DeleteSalesforceParams deleteSalesforceParams, Long userId, Long companyId, Integer languageType); |
|||
|
|||
PageInfo<SalesforcePageVO> getListPage(SalesforceSearchParams pageSearchParam, Long companyId, Long userId, |
|||
Integer languageType, Integer uTCOffset); |
|||
|
|||
PageInfo<DeviceShortVO> getDevicePageForBinding(SalesforceBingDeviceSearchParams pageSearchParam, Long companyId, Long userId, Integer languageType, Integer utcOffset); |
|||
} |
|||
@ -0,0 +1,371 @@ |
|||
package com.techsor.datacenter.business.service.impl; |
|||
|
|||
import com.github.pagehelper.PageHelper; |
|||
import com.google.gson.Gson; |
|||
import com.techsor.datacenter.business.common.Constants; |
|||
import com.techsor.datacenter.business.common.exception.MsgCodeException; |
|||
import com.techsor.datacenter.business.common.language.msg.MsgLanguageChange; |
|||
import com.techsor.datacenter.business.common.response.PageInfo; |
|||
import com.techsor.datacenter.business.common.response.ResponseCode; |
|||
import com.techsor.datacenter.business.common.response.SimpleDataResponse; |
|||
import com.techsor.datacenter.business.dao.ex.BasicSalesforceMapperExt; |
|||
import com.techsor.datacenter.business.dao.ex.SalesforceDeviceRelationMapperExt; |
|||
import com.techsor.datacenter.business.dto.level.LevelRelationEntity; |
|||
import com.techsor.datacenter.business.dto.salesforce.DeleteSalesforceParams; |
|||
import com.techsor.datacenter.business.dto.salesforce.SalesforceBingDeviceSearchParams; |
|||
import com.techsor.datacenter.business.dto.salesforce.SalesforceSearchParams; |
|||
import com.techsor.datacenter.business.dto.salesforce.OptSalesforceParams; |
|||
import com.techsor.datacenter.business.model.BasicSalesforce; |
|||
import com.techsor.datacenter.business.model.BasicSalesforceExample; |
|||
import com.techsor.datacenter.business.model.SalesforceDeviceRelation; |
|||
import com.techsor.datacenter.business.model.SalesforceDeviceRelationExample; |
|||
import com.techsor.datacenter.business.service.SalesforceService; |
|||
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.device.DeviceShortVO; |
|||
import com.techsor.datacenter.business.vo.device.DeviceVO; |
|||
import com.techsor.datacenter.business.vo.salesforce.SalesforcePageVO; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
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.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* |
|||
* @author jwy-style |
|||
* |
|||
*/ |
|||
@Service |
|||
public class SalesforceServiceImpl implements SalesforceService { |
|||
|
|||
private static Logger logger = LoggerFactory.getLogger(SalesforceServiceImpl.class); |
|||
|
|||
|
|||
@Autowired |
|||
private CommonOpt commonOpt; |
|||
@Autowired |
|||
private MsgLanguageChange msgLanguageChange; |
|||
@Autowired |
|||
private UserOperationLogsService userOperationLogsService; |
|||
@Autowired |
|||
private BasicSalesforceMapperExt basicSalesforceMapperExt; |
|||
@Autowired |
|||
private SalesforceDeviceRelationMapperExt salesforceDeviceRelationMapperExt; |
|||
|
|||
|
|||
/** |
|||
* Adds a new salesforce based on the provided parameters. |
|||
* |
|||
* @param optSalesforceParams The parameters containing salesforce details to be added. |
|||
* @param userId User ID performing the operation. |
|||
* @param companyId Company ID associated with the operation. |
|||
* @param languageType Language type for localization (not used in this method). |
|||
* @return SimpleDataResponse indicating success or failure of the operation. |
|||
*/ |
|||
@Override |
|||
@Transactional |
|||
public SimpleDataResponse add(OptSalesforceParams optSalesforceParams, Long userId, Long companyId, |
|||
Integer languageType) { |
|||
try { |
|||
optSalesforceParams.setId(null); // Ensure salesforceId is null for new salesforce creation
|
|||
|
|||
try { |
|||
List<Long> selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); |
|||
|
|||
// Check company ownership to prevent unauthorized operations
|
|||
if (ObjectUtils.isEmpty(optSalesforceParams.getCompanyId())) { |
|||
optSalesforceParams.setCompanyId(companyId); // Set companyId if not provided
|
|||
} else { |
|||
checkCompany(optSalesforceParams, languageType, selfAndSubCompanyList); |
|||
} |
|||
|
|||
// Perform common verification operations
|
|||
commonVerifyOpt(optSalesforceParams, selfAndSubCompanyList, languageType); |
|||
|
|||
} catch (MsgCodeException e) { |
|||
return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); |
|||
} |
|||
|
|||
long currentUnix = System.currentTimeMillis(); |
|||
BasicSalesforce basicSalesforce = new BasicSalesforce(); |
|||
BeanUtils.copyProperties(optSalesforceParams, basicSalesforce); |
|||
basicSalesforce.setId(null); // Ensure salesforceId is null for new salesforce creation
|
|||
basicSalesforce.setCreateTime(currentUnix); |
|||
basicSalesforce.setCreatorId(userId); |
|||
basicSalesforceMapperExt.insertSelective(basicSalesforce); |
|||
|
|||
//设备关联
|
|||
insertDeviceRelation(optSalesforceParams, basicSalesforce, 1); |
|||
|
|||
//Record log
|
|||
userOperationLogsService.recordLog(companyId,userId,"添加Salesforce:"+basicSalesforce.getSalesforceId(), |
|||
"Add Salesforce:"+basicSalesforce.getSalesforceId(), |
|||
"Salesforce追加:"+basicSalesforce.getSalesforceId(), |
|||
"Success", Constants.USER_OPERATION_LOG_TYPE_IOTCORE_LOG, |
|||
new Gson().toJson(basicSalesforce)); |
|||
|
|||
return SimpleDataResponse.success(); |
|||
} catch (Exception e) { |
|||
logger.error("Error occurred while adding salesforce", e); |
|||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); // Rollback transaction on error
|
|||
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "Server error"); |
|||
} |
|||
} |
|||
|
|||
private void insertDeviceRelation(OptSalesforceParams optSalesforceParams, BasicSalesforce basicSalesforce, int optType) { |
|||
if (2 == optType){ |
|||
SalesforceDeviceRelationExample delRelationExample = new SalesforceDeviceRelationExample(); |
|||
delRelationExample.createCriteria().andSalesforceInfoIdEqualTo(basicSalesforce.getId()); |
|||
salesforceDeviceRelationMapperExt.deleteByExample(delRelationExample); |
|||
} |
|||
if (CollectionUtils.isNotEmpty(optSalesforceParams.getDeviceInfoIdList())) { |
|||
long currentUnix = System.currentTimeMillis(); |
|||
for (Long deviceInfoId : optSalesforceParams.getDeviceInfoIdList()){ |
|||
SalesforceDeviceRelation salesforceDeviceRelation = new SalesforceDeviceRelation(); |
|||
salesforceDeviceRelation.setSalesforceInfoId(basicSalesforce.getId()); |
|||
salesforceDeviceRelation.setDeviceInfoId(deviceInfoId); |
|||
salesforceDeviceRelation.setCreateTime(currentUnix); |
|||
salesforceDeviceRelationMapperExt.insertSelective(salesforceDeviceRelation); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Performs common verification operations on OptSalesforceParams. |
|||
* |
|||
* @param optSalesforceParams The parameters containing salesforce details to be verified. |
|||
* @param selfAndSubCompanyList List of company IDs including self and subsidiaries. |
|||
* @param languageType Language type for localization (not used in this method). |
|||
*/ |
|||
private void commonVerifyOpt(OptSalesforceParams optSalesforceParams, List<Long> selfAndSubCompanyList, |
|||
Integer languageType) { |
|||
// Validate parameters
|
|||
checkParam(optSalesforceParams, languageType); |
|||
// Check for duplicate salesforces
|
|||
checkExist(optSalesforceParams, languageType); |
|||
} |
|||
|
|||
/** |
|||
* Checks if the company specified in optSalesforceParams is authorized. |
|||
* |
|||
* @param optSalesforceParams The parameters containing salesforce details. |
|||
* @param languageType Language type for localization (not used in this method). |
|||
* @param selfAndSubCompanyList List of company IDs including self and subsidiaries. |
|||
* @throws MsgCodeException If the selected company is not authorized. |
|||
*/ |
|||
private void checkCompany(OptSalesforceParams optSalesforceParams, Integer languageType, List<Long> selfAndSubCompanyList) { |
|||
if (!selfAndSubCompanyList.contains(optSalesforceParams.getCompanyId())) { |
|||
logger.info("Selected company is not in the authorized companies"); |
|||
throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Checks if a salesforce with the same name already exists. |
|||
* |
|||
* @param optSalesforceParams The parameters containing salesforce details. |
|||
* @param languageType Language type for localization (not used in this method). |
|||
* @throws MsgCodeException If a salesforce with the same name already exists. |
|||
*/ |
|||
private void checkExist(OptSalesforceParams optSalesforceParams, Integer languageType) { |
|||
if (basicSalesforceMapperExt.checkExist(optSalesforceParams) > 0) { |
|||
throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "salesforceHasExisted")); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Checks the validity of parameters in optSalesforceParams. |
|||
* |
|||
* @param optSalesforceParams The parameters to be validated. |
|||
* @param languageType Language type for localization (not used in this method). |
|||
* @throws MsgCodeException If salesforceName is blank or exceeds 100 characters, or if buildingId is null. |
|||
*/ |
|||
private void checkParam(OptSalesforceParams optSalesforceParams, Integer languageType) { |
|||
if (StringUtils.isBlank(optSalesforceParams.getSalesforceId()) || optSalesforceParams.getSalesforceId().length() > 255) { |
|||
throw new MsgCodeException("Parameter error [salesforceId]"); |
|||
} |
|||
if (StringUtils.isNotBlank(optSalesforceParams.getRemark()) && optSalesforceParams.getRemark().length() > 1000) { |
|||
throw new MsgCodeException("Parameter error [remark]"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Batch deletes salesforces based on the provided salesforce IDs. |
|||
* |
|||
* @param deleteSalesforceParams The parameters containing salesforce IDs to be deleted. |
|||
* @param userId User ID of the user performing the operation. |
|||
* @param companyId Company ID of the company associated with the operation. |
|||
* @param languageType Language type for localization (not used in this method). |
|||
* @return SimpleDataResponse indicating success or failure of the operation. |
|||
*/ |
|||
@Transactional |
|||
@Override |
|||
public SimpleDataResponse batchDelete(DeleteSalesforceParams deleteSalesforceParams, Long userId, Long companyId, Integer languageType) { |
|||
if (StringUtils.isBlank(deleteSalesforceParams.getIds())) { |
|||
return SimpleDataResponse.success(); |
|||
} |
|||
try { |
|||
// Convert salesforceIds string to list of Long IDs
|
|||
List<Long> ids = Arrays.asList(StringUtils.split(deleteSalesforceParams.getIds(), ",")).stream() |
|||
.map(id -> CommonUtil.String2Long(id.trim())).collect(Collectors.toList()); |
|||
|
|||
// Execute deletion operation
|
|||
BasicSalesforceExample basicSalesforceExample = new BasicSalesforceExample(); |
|||
BasicSalesforceExample.Criteria criteria = basicSalesforceExample.createCriteria(); |
|||
criteria.andIdIn(ids).andCompanyIdIn(commonOpt.getSelfAndSubCompanyId(companyId)); |
|||
|
|||
BasicSalesforce basicSalesforce = new BasicSalesforce(); |
|||
basicSalesforce.setFlag(1); // Set flag to mark as deleted
|
|||
|
|||
basicSalesforceMapperExt.updateByExampleSelective(basicSalesforce, basicSalesforceExample); |
|||
|
|||
//Record log
|
|||
List<BasicSalesforce> deletedList = basicSalesforceMapperExt.selectByExample(basicSalesforceExample); |
|||
StringBuilder deletedStr= new StringBuilder(); |
|||
for (BasicSalesforce item : deletedList) { |
|||
deletedStr.append(item.getSalesforceId()).append(" "); |
|||
} |
|||
userOperationLogsService.recordLog(companyId,userId,"删除Salesforce:"+deletedStr, |
|||
"Delete Salesforce:"+deletedStr, |
|||
"Salesforce削除:"+deletedStr, |
|||
"Success", |
|||
Constants.USER_OPERATION_LOG_TYPE_IOTCORE_LOG, ""); |
|||
|
|||
return SimpleDataResponse.success(); |
|||
} catch (Exception e) { |
|||
logger.error("Error deleting salesforces", e); |
|||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
|||
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "server error"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Edits an existing salesforce based on the provided parameters. |
|||
* |
|||
* @param optSalesforceParams The parameters containing updated salesforce details. |
|||
* @param userId User ID of the user performing the operation. |
|||
* @param companyId Company ID of the company associated with the operation. |
|||
* @param languageType Language type for localization (not used in this method). |
|||
* @return SimpleDataResponse indicating success or failure of the operation. |
|||
*/ |
|||
@Transactional |
|||
@Override |
|||
public SimpleDataResponse edit(OptSalesforceParams optSalesforceParams, Long userId, Long companyId, Integer languageType) { |
|||
try { |
|||
BasicSalesforce oldBF = basicSalesforceMapperExt.selectByPrimaryKey(optSalesforceParams.getId()); |
|||
// If the salesforce does not exist (unlikely scenario), return an error response with an English message
|
|||
if (ObjectUtils.isEmpty(oldBF) || 1 == oldBF.getFlag()) { |
|||
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "Not found"); |
|||
} |
|||
|
|||
// Perform validation operations
|
|||
try { |
|||
List<Long> selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); |
|||
|
|||
// If the salesforce does not belong to the authorized companies
|
|||
if (!selfAndSubCompanyList.contains(oldBF.getCompanyId())) { |
|||
throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); |
|||
} |
|||
|
|||
// If optSalesforceParams does not specify companyId, set it to the original salesforce's companyId
|
|||
if (ObjectUtils.isEmpty(optSalesforceParams.getCompanyId())) { |
|||
optSalesforceParams.setCompanyId(oldBF.getCompanyId()); |
|||
} |
|||
// If the specified companyId is not within the authorized companies
|
|||
else if (!selfAndSubCompanyList.contains(optSalesforceParams.getCompanyId())) { |
|||
throw new MsgCodeException(msgLanguageChange.getParameterMapByCode(languageType, "noOperationAuth")); |
|||
} |
|||
|
|||
commonVerifyOpt(optSalesforceParams, selfAndSubCompanyList, languageType); |
|||
|
|||
} catch (MsgCodeException e) { |
|||
return new SimpleDataResponse(ResponseCode.MSG_ERROR, e.getMessage()); |
|||
} |
|||
|
|||
// Update salesforce details
|
|||
BasicSalesforce basicSalesforce = new BasicSalesforce(); |
|||
BeanUtils.copyProperties(optSalesforceParams, basicSalesforce); |
|||
basicSalesforce.setModifierId(userId); |
|||
basicSalesforce.setModifyTime(System.currentTimeMillis()); |
|||
|
|||
BasicSalesforceExample example = new BasicSalesforceExample(); |
|||
BasicSalesforceExample.Criteria criteria = example.createCriteria(); |
|||
criteria.andIdEqualTo(optSalesforceParams.getId()); |
|||
|
|||
basicSalesforceMapperExt.updateByExampleSelective(basicSalesforce, example); |
|||
|
|||
//设备关联
|
|||
insertDeviceRelation(optSalesforceParams, basicSalesforce, 2); |
|||
|
|||
//Record log
|
|||
userOperationLogsService.recordLog(companyId,userId,"编辑Salesforce:"+basicSalesforce.getSalesforceId(), |
|||
"edit Salesforce:"+basicSalesforce.getSalesforceId(), |
|||
"Salesforce編集:"+basicSalesforce.getSalesforceId(), |
|||
"Success", Constants.USER_OPERATION_LOG_TYPE_IOTCORE_LOG, |
|||
new Gson().toJson(basicSalesforce)); |
|||
|
|||
return SimpleDataResponse.success(); |
|||
} catch (Exception e) { |
|||
logger.error("Error editing salesforce", e); |
|||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
|||
return new SimpleDataResponse(ResponseCode.SERVER_ERROR, "server error"); |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Retrieves a paginated list of salesforces based on search parameters. |
|||
* |
|||
* @param pageSearchParam The parameters for filtering and pagination. |
|||
* @param companyId ID of the company associated with the operation. |
|||
* @param userId User ID of the user performing the operation (not used in this method). |
|||
* @param languageType Language type for localization (not used in this method). |
|||
* @param uTCOffset UTC offset (not used in this method). |
|||
* @return PageInfo containing the list of SalesforcePageVO objects matching the search criteria. |
|||
*/ |
|||
@Override |
|||
public PageInfo<SalesforcePageVO> getListPage(SalesforceSearchParams 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.getIds())) { |
|||
pageSearchParam.setIdList(CommonUtil.commaStr2LongList(pageSearchParam.getIds())); |
|||
} |
|||
PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); |
|||
List<SalesforcePageVO> resultList = basicSalesforceMapperExt.getListPage(pageSearchParam); |
|||
|
|||
return new PageInfo<>(resultList); |
|||
} |
|||
|
|||
@Override |
|||
public PageInfo<DeviceShortVO> getDevicePageForBinding(SalesforceBingDeviceSearchParams 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())); |
|||
} |
|||
PageHelper.startPage(pageSearchParam.getPageNum() == null ? 1 : pageSearchParam.getPageNum(), pageSearchParam.getPageSize() == null ? 20 : pageSearchParam.getPageSize()); |
|||
List<DeviceShortVO> resultList = basicSalesforceMapperExt.getDevicePageForBinding(pageSearchParam); |
|||
|
|||
return new PageInfo<>(resultList); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,193 @@ |
|||
package com.techsor.datacenter.business.service.schedule; |
|||
|
|||
|
|||
import com.fasterxml.jackson.databind.JsonNode; |
|||
import com.fasterxml.jackson.databind.ObjectMapper; |
|||
import com.fasterxml.jackson.databind.node.ObjectNode; |
|||
import com.techsor.datacenter.business.common.config.DataSourceContextHolder; |
|||
import com.techsor.datacenter.business.common.config.DataSourceInterceptor; |
|||
import com.techsor.datacenter.business.dao.ex.BasicSalesforceMapperExt; |
|||
import com.techsor.datacenter.business.dao.ex.SalesforceFacilityMapperExt; |
|||
import com.techsor.datacenter.business.model.BasicSalesforce; |
|||
import com.techsor.datacenter.business.model.BasicSalesforceExample; |
|||
import com.techsor.datacenter.business.model.SalesforceFacility; |
|||
import jakarta.annotation.Resource; |
|||
import org.apache.commons.collections.CollectionUtils; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.http.HttpEntity; |
|||
import org.springframework.http.HttpHeaders; |
|||
import org.springframework.http.HttpMethod; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.scheduling.annotation.Scheduled; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.util.LinkedMultiValueMap; |
|||
import org.springframework.util.MultiValueMap; |
|||
import org.springframework.web.client.RestTemplate; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Component |
|||
public class ScheduleSyncSalesforceInfo { |
|||
|
|||
private static final Logger logger= LoggerFactory.getLogger(ScheduleSyncSalesforceInfo.class); |
|||
|
|||
|
|||
@Value("${salesforce.host}") |
|||
private String host; |
|||
@Value("${salesforce.client_id}") |
|||
private String clientId; |
|||
@Value("${salesforce.client_secret}") |
|||
private String clientSecret; |
|||
|
|||
|
|||
// token缓存
|
|||
private String cachedToken; |
|||
// token过期时间(毫秒)
|
|||
private long tokenExpireTime = 0; |
|||
|
|||
|
|||
|
|||
@Autowired |
|||
private SalesforceFacilityMapperExt salesforceFacilityMapperExt; |
|||
@Autowired |
|||
private BasicSalesforceMapperExt basicSalesforceMapperExt; |
|||
|
|||
@Resource |
|||
DataSourceInterceptor dataSourceInterceptor; |
|||
|
|||
|
|||
@Scheduled(cron = "0 0 3 ? * SAT") |
|||
// @Scheduled(cron = "0 * * * * ?")
|
|||
public void start() { |
|||
List<Long> topCompanyIdList = dataSourceInterceptor.getTopCompanyIdList(); |
|||
for (Long tempTopCompanyId:topCompanyIdList) { |
|||
logger.debug("Using dataSourceForCompany_" + tempTopCompanyId); |
|||
DataSourceContextHolder.setCurrentDataSourceKey("dataSourceForCompany_" + tempTopCompanyId); |
|||
process(tempTopCompanyId); |
|||
DataSourceContextHolder.clearCurrentDataSourceKey(); |
|||
} |
|||
|
|||
} |
|||
|
|||
private void process(Long tempTopCompanyId) { |
|||
BasicSalesforceExample example = new BasicSalesforceExample(); |
|||
BasicSalesforceExample.Criteria criteria = example.createCriteria(); |
|||
criteria.andFlagEqualTo(0); |
|||
List<BasicSalesforce> list = basicSalesforceMapperExt.selectByExample(example); |
|||
|
|||
if (CollectionUtils.isNotEmpty(list)){ |
|||
List<String> salesforceIds = list |
|||
.stream() |
|||
.map(BasicSalesforce::getSalesforceId) |
|||
.toList(); |
|||
|
|||
for (String salesforceId : salesforceIds) { |
|||
try { |
|||
String token = getToken(); |
|||
|
|||
String json = getFacility(token, salesforceId); |
|||
|
|||
SalesforceFacility entity = convert(json); |
|||
|
|||
salesforceFacilityMapperExt.upsert(entity); |
|||
|
|||
} catch (Exception e) { |
|||
logger.error("同步失败 salesforceId={}", salesforceId, e); |
|||
} |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
public SalesforceFacility convert(String json) throws Exception { |
|||
|
|||
ObjectMapper mapper = new ObjectMapper(); |
|||
JsonNode root = mapper.readTree(json); |
|||
|
|||
SalesforceFacility entity = new SalesforceFacility(); |
|||
|
|||
entity.setSalesforceId(root.get("Id").asText()); |
|||
entity.setName(root.get("Name").asText()); |
|||
entity.setOwnerId(root.get("OwnerId").asText()); |
|||
entity.setIsDeleted(root.get("IsDeleted").asBoolean()); |
|||
entity.setFacilityIdC(root.get("FacilityId__c").asText()); |
|||
|
|||
// 删除指定字段
|
|||
((ObjectNode) root).remove(Arrays.asList( |
|||
"Id", |
|||
"OwnerId", |
|||
"IsDeleted", |
|||
"Name", |
|||
"FacilityId__c" |
|||
)); |
|||
|
|||
entity.setExtraJson(root.toString()); |
|||
|
|||
return entity; |
|||
} |
|||
|
|||
public String getFacility(String token, String salesforceId) { |
|||
String url = host + "/services/data/v59.0/sobjects/Facility__c/" + salesforceId; |
|||
|
|||
HttpHeaders headers = new HttpHeaders(); |
|||
headers.setBearerAuth(token); |
|||
headers.setContentType(MediaType.APPLICATION_JSON); |
|||
|
|||
HttpEntity<?> entity = new HttpEntity<>(headers); |
|||
|
|||
RestTemplate restTemplate = new RestTemplate(); |
|||
return restTemplate.exchange(url, HttpMethod.GET, entity, String.class).getBody(); |
|||
} |
|||
|
|||
public String getToken() { |
|||
|
|||
long now = System.currentTimeMillis(); |
|||
|
|||
// 如果token没过期,直接返回
|
|||
if (cachedToken != null && now < tokenExpireTime) { |
|||
return cachedToken; |
|||
} |
|||
|
|||
synchronized (this) { |
|||
// double check(防并发)
|
|||
if (cachedToken != null && now < tokenExpireTime) { |
|||
return cachedToken; |
|||
} |
|||
|
|||
String url = host + "/services/oauth2/token"; |
|||
|
|||
MultiValueMap<String, String> body = new LinkedMultiValueMap<>(); |
|||
body.add("grant_type", "client_credentials"); |
|||
body.add("client_id", clientId); |
|||
body.add("client_secret", clientSecret); |
|||
|
|||
HttpHeaders headers = new HttpHeaders(); |
|||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
|||
|
|||
HttpEntity<?> entity = new HttpEntity<>(body, headers); |
|||
|
|||
RestTemplate restTemplate = new RestTemplate(); |
|||
Map result = restTemplate.postForObject(url, entity, Map.class); |
|||
|
|||
String token = (String) result.get("access_token"); |
|||
|
|||
if (token == null) { |
|||
throw new RuntimeException("获取Salesforce token失败: " + result); |
|||
} |
|||
|
|||
// 设置缓存(5分钟,提前30秒过期更安全)
|
|||
cachedToken = token; |
|||
tokenExpireTime = System.currentTimeMillis() + (5 * 60 - 30) * 1000; |
|||
|
|||
logger.info("获取新的Salesforce token"); |
|||
|
|||
return token; |
|||
} |
|||
} |
|||
|
|||
} |
|||
Loading…
Reference in new issue