9 changed files with 1702 additions and 1 deletions
@ -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,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,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,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,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,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