|
|
@@ -2,134 +2,215 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.storlead.trade.mapper.CustomerEntityMapper">
|
|
|
|
|
|
- <!-- CustomerVO 自动映射:继承 CustomerEntity 全部字段 + customerCompany + liaison -->
|
|
|
+ <!--
|
|
|
+ MyBatis association 嵌套映射:
|
|
|
+ customerCompany → prefix "cc_"
|
|
|
+ liaison → prefix "l_"
|
|
|
+ MyBatis 会自动处理 snake_case → camelCase 映射 + association 嵌套。
|
|
|
+ 无需 Java 层手动转换。
|
|
|
+ -->
|
|
|
|
|
|
- <!-- 联表分页查询:客户 + 企业信息 + 首要联系人 -->
|
|
|
- <select id="selectPageWithRelation" resultType="com.storlead.trade.vo.CustomerVO">
|
|
|
+ <!-- ====== 结果映射:客户 + 嵌套企业信息 + 嵌套联系人 ====== -->
|
|
|
+ <resultMap id="CustomerVOResultMap" type="com.storlead.trade.vo.CustomerVO" autoMapping="true">
|
|
|
+ <!-- 客户主表字段由 MyBatis autoMapping 自动映射(snake→camel) -->
|
|
|
+ <!-- 嵌套:企业信息 -->
|
|
|
+ <association property="customerCompany" javaType="com.storlead.trade.entity.CustomerCompanyEntity" autoMapping="true">
|
|
|
+ <id column="cc_id" property="id"/>
|
|
|
+ <result column="cc_customer_id" property="customerId"/>
|
|
|
+ <result column="cc_name" property="name"/>
|
|
|
+ <result column="cc_address" property="address"/>
|
|
|
+ <result column="cc_scale_dict_value" property="scaleDictValue"/>
|
|
|
+ <result column="cc_website" property="website"/>
|
|
|
+ <result column="cc_website1" property="website1"/>
|
|
|
+ <result column="cc_website2" property="website2"/>
|
|
|
+ <result column="cc_website3" property="website3"/>
|
|
|
+ <result column="cc_industry" property="industry"/>
|
|
|
+ <result column="cc_communication_address" property="communicationAddress"/>
|
|
|
+ <result column="cc_postcode" property="postcode"/>
|
|
|
+ <result column="cc_fax_number" property="faxNumber"/>
|
|
|
+ <result column="cc_email" property="email"/>
|
|
|
+ <result column="cc_email1" property="email1"/>
|
|
|
+ <result column="cc_email2" property="email2"/>
|
|
|
+ <result column="cc_email3" property="email3"/>
|
|
|
+ <result column="cc_telephone" property="telephone"/>
|
|
|
+ <result column="cc_create_time" property="createTime"/>
|
|
|
+ <result column="cc_update_time" property="updateTime"/>
|
|
|
+ <result column="cc_is_delete" property="isDelete"/>
|
|
|
+ <result column="cc_enabled" property="enabled"/>
|
|
|
+ <result column="cc_create_by" property="createBy"/>
|
|
|
+ <result column="cc_owner_by" property="ownerBy"/>
|
|
|
+ <result column="cc_update_by" property="updateBy"/>
|
|
|
+ <result column="cc_sort" property="sort"/>
|
|
|
+ </association>
|
|
|
+ <!-- 嵌套:首要联系人 -->
|
|
|
+ <association property="liaison" javaType="com.storlead.trade.entity.LiaisonEntity" autoMapping="true">
|
|
|
+ <id column="l_id" property="id"/>
|
|
|
+ <result column="l_customer_id" property="customerId"/>
|
|
|
+ <result column="l_has_primary_lialison" property="hasPrimaryLialison"/>
|
|
|
+ <result column="l_name" property="name"/>
|
|
|
+ <result column="l_call" property="call"/>
|
|
|
+ <result column="l_resource_type" property="resourceType"/>
|
|
|
+ <result column="l_resource_type_id" property="resourceTypeId"/>
|
|
|
+ <result column="l_liaison_role_dict_value" property="liaisonRoleDictValue"/>
|
|
|
+ <result column="l_birthday" property="birthday"/>
|
|
|
+ <result column="l_department_position" property="departmentPosition"/>
|
|
|
+ <result column="l_telephone" property="telephone"/>
|
|
|
+ <result column="l_email" property="email"/>
|
|
|
+ <result column="l_email1" property="email1"/>
|
|
|
+ <result column="l_email2" property="email2"/>
|
|
|
+ <result column="l_email3" property="email3"/>
|
|
|
+ <result column="l_fax_number" property="faxNumber"/>
|
|
|
+ <result column="l_postcode" property="postcode"/>
|
|
|
+ <result column="l_contact_information" property="contactInformation"/>
|
|
|
+ <result column="l_remark" property="remark"/>
|
|
|
+ <result column="l_qq" property="qq"/>
|
|
|
+ <result column="l_skype" property="skype"/>
|
|
|
+ <result column="l_wangwang" property="wangwang"/>
|
|
|
+ <result column="l_wechat" property="wechat"/>
|
|
|
+ <result column="l_twitter" property="twitter"/>
|
|
|
+ <result column="l_linkedin" property="linkedin"/>
|
|
|
+ <result column="l_facebook" property="facebook"/>
|
|
|
+ <result column="l_whatsapp" property="whatsapp"/>
|
|
|
+ <result column="l_fixed_line_telephone" property="fixedLineTelephone"/>
|
|
|
+ <result column="l_home_electricity" property="homeElectricity"/>
|
|
|
+ <result column="l_address" property="address"/>
|
|
|
+ <result column="l_international_area" property="internationalArea"/>
|
|
|
+ <result column="l_last_follow_up_time" property="lastFollowUpTime"/>
|
|
|
+ <result column="l_create_time" property="createTime"/>
|
|
|
+ <result column="l_update_time" property="updateTime"/>
|
|
|
+ <result column="l_is_delete" property="isDelete"/>
|
|
|
+ <result column="l_enabled" property="enabled"/>
|
|
|
+ <result column="l_create_by" property="createBy"/>
|
|
|
+ <result column="l_owner_by" property="ownerBy"/>
|
|
|
+ <result column="l_former_owner_by" property="formerOwnerBy"/>
|
|
|
+ <result column="l_update_by" property="updateBy"/>
|
|
|
+ <result column="l_sort" property="sort"/>
|
|
|
+ </association>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 联表分页查询 -->
|
|
|
+ <select id="selectPageWithRelation" resultMap="CustomerVOResultMap">
|
|
|
SELECT
|
|
|
- c.id AS id,
|
|
|
- c.data_code AS dataCode,
|
|
|
- c.customer_form AS customerForm,
|
|
|
- c.has_from_clue AS hasFromClue,
|
|
|
- c.has_public_customer AS hasPublicCustomer,
|
|
|
- c.has_garbage_customer AS hasGarbageCustomer,
|
|
|
- c.has_follow_customer AS hasFollowCustomer,
|
|
|
- c.customer_code AS customerCode,
|
|
|
- c.continent AS continent,
|
|
|
- c.country AS country,
|
|
|
- c.customer_name AS customerName,
|
|
|
- c.collaborator AS collaborator,
|
|
|
- c.intended_products_ids AS intendedProductsIds,
|
|
|
- c.intended_products_names AS intendedProductsNames,
|
|
|
- c.clue_status_dict_value AS clueStatusDictValue,
|
|
|
- c.customer_status_dict_value AS customerStatusDictValue,
|
|
|
- c.customer_source_dict_value AS customerSourceDictValue,
|
|
|
- c.customer_type_dict_value AS customerTypeDictValue,
|
|
|
- c.cooperative_customer_id AS cooperativeCustomerId,
|
|
|
- c.customer_level_dict_value AS customerLevelDictValue,
|
|
|
- c.customer_credit_level_dict_value AS customerCreditLevelDictValue,
|
|
|
- c.customer_economic_nature_dict_value AS customerEconomicNatureDictValue,
|
|
|
- c.mnemonic_name AS mnemonicName,
|
|
|
- c.remark AS remark,
|
|
|
- c.opening_bank AS openingBank,
|
|
|
- c.tax_number AS taxNumber,
|
|
|
- c.bank_account AS bankAccount,
|
|
|
- c.reason_public_customer_dict_value AS reasonPublicCustomerDictValue,
|
|
|
- c.has_order_form AS hasOrderForm,
|
|
|
- c.last_follow_up_time AS lastFollowUpTime,
|
|
|
- c.no_follow_up_date AS noFollowUpDate,
|
|
|
- c.public_date AS publicDate,
|
|
|
- c.public_remind_date AS publicRemindDate,
|
|
|
- c.garbage_date AS garbageDate,
|
|
|
- c.garbage_remind_date AS garbageRemindDate,
|
|
|
- c.delete_date AS deleteDate,
|
|
|
- c.delete_remind_date AS deleteRemindDate,
|
|
|
- c.owner_time AS ownerTime,
|
|
|
- c.give_up_time AS giveUpTime,
|
|
|
- c.create_time AS createTime,
|
|
|
- c.update_time AS updateTime,
|
|
|
- c.is_delete AS isDelete,
|
|
|
- c.enabled AS enabled,
|
|
|
- c.create_by AS createBy,
|
|
|
- c.owner_by AS ownerBy,
|
|
|
- c.former_owner_by AS formerOwnerBy,
|
|
|
- c.next_analysis_date AS nextAnalysisDate,
|
|
|
- c.update_by AS updateBy,
|
|
|
- c.sort AS sort,
|
|
|
- <!-- 企业信息 -->
|
|
|
- cc.id AS customerCompany.id,
|
|
|
- cc.customer_id AS customerCompany.customerId,
|
|
|
- cc.name AS customerCompany.name,
|
|
|
- cc.address AS customerCompany.address,
|
|
|
- cc.scale_dict_value AS customerCompany.scaleDictValue,
|
|
|
- cc.website AS customerCompany.website,
|
|
|
- cc.website1 AS customerCompany.website1,
|
|
|
- cc.website2 AS customerCompany.website2,
|
|
|
- cc.website3 AS customerCompany.website3,
|
|
|
- cc.industry AS customerCompany.industry,
|
|
|
- cc.communication_address AS customerCompany.communicationAddress,
|
|
|
- cc.postcode AS customerCompany.postcode,
|
|
|
- cc.fax_number AS customerCompany.faxNumber,
|
|
|
- cc.email AS customerCompany.email,
|
|
|
- cc.email1 AS customerCompany.email1,
|
|
|
- cc.email2 AS customerCompany.email2,
|
|
|
- cc.email3 AS customerCompany.email3,
|
|
|
- cc.telephone AS customerCompany.telephone,
|
|
|
- cc.create_time AS customerCompany.createTime,
|
|
|
- cc.update_time AS customerCompany.updateTime,
|
|
|
- cc.is_delete AS customerCompany.isDelete,
|
|
|
- cc.enabled AS customerCompany.enabled,
|
|
|
- cc.create_by AS customerCompany.createBy,
|
|
|
- cc.owner_by AS customerCompany.ownerBy,
|
|
|
- cc.update_by AS customerCompany.updateBy,
|
|
|
- cc.sort AS customerCompany.sort,
|
|
|
- <!-- 首要联系人 -->
|
|
|
- l.id AS liaison.id,
|
|
|
- l.customer_id AS liaison.customerId,
|
|
|
- l.has_primary_lialison AS liaison.hasPrimaryLialison,
|
|
|
- l.name AS liaison.name,
|
|
|
- l.call AS liaison.call,
|
|
|
- l.resource_type AS liaison.resourceType,
|
|
|
- l.resource_type_id AS liaison.resourceTypeId,
|
|
|
- l.liaison_role_dict_value AS liaison.liaisonRoleDictValue,
|
|
|
- l.birthday AS liaison.birthday,
|
|
|
- l.department_position AS liaison.departmentPosition,
|
|
|
- l.telephone AS liaison.telephone,
|
|
|
- l.email AS liaison.email,
|
|
|
- l.email1 AS liaison.email1,
|
|
|
- l.email2 AS liaison.email2,
|
|
|
- l.email3 AS liaison.email3,
|
|
|
- l.fax_number AS liaison.faxNumber,
|
|
|
- l.postcode AS liaison.postcode,
|
|
|
- l.contact_information AS liaison.contactInformation,
|
|
|
- l.remark AS liaison.remark,
|
|
|
- l.qq AS liaison.qq,
|
|
|
- l.skype AS liaison.skype,
|
|
|
- l.wangwang AS liaison.wangwang,
|
|
|
- l.wechat AS liaison.wechat,
|
|
|
- l.twitter AS liaison.twitter,
|
|
|
- l.linkedin AS liaison.linkedin,
|
|
|
- l.facebook AS liaison.facebook,
|
|
|
- l.whatsapp AS liaison.whatsapp,
|
|
|
- l.fixed_line_telephone AS liaison.fixedLineTelephone,
|
|
|
- l.home_electricity AS liaison.homeElectricity,
|
|
|
- l.address AS liaison.address,
|
|
|
- l.international_area AS liaison.internationalArea,
|
|
|
- l.last_follow_up_time AS liaison.lastFollowUpTime,
|
|
|
- l.create_time AS liaison.createTime,
|
|
|
- l.update_time AS liaison.updateTime,
|
|
|
- l.is_delete AS liaison.isDelete,
|
|
|
- l.enabled AS liaison.enabled,
|
|
|
- l.create_by AS liaison.createBy,
|
|
|
- l.owner_by AS liaison.ownerBy,
|
|
|
- l.former_owner_by AS liaison.formerOwnerBy,
|
|
|
- l.update_by AS liaison.updateBy,
|
|
|
- l.sort AS liaison.sort
|
|
|
+ c.id,
|
|
|
+ c.data_code,
|
|
|
+ c.customer_form,
|
|
|
+ c.has_from_clue,
|
|
|
+ c.has_public_customer,
|
|
|
+ c.has_garbage_customer,
|
|
|
+ c.has_follow_customer,
|
|
|
+ c.customer_code,
|
|
|
+ c.continent,
|
|
|
+ c.country,
|
|
|
+ c.customer_name,
|
|
|
+ c.collaborator,
|
|
|
+ c.intended_products_ids,
|
|
|
+ c.intended_products_names,
|
|
|
+ c.clue_status_dict_value,
|
|
|
+ c.customer_status_dict_value,
|
|
|
+ c.customer_source_dict_value,
|
|
|
+ c.customer_type_dict_value,
|
|
|
+ c.cooperative_customer_id,
|
|
|
+ c.customer_level_dict_value,
|
|
|
+ c.customer_credit_level_dict_value,
|
|
|
+ c.customer_economic_nature_dict_value,
|
|
|
+ c.mnemonic_name,
|
|
|
+ c.remark,
|
|
|
+ c.opening_bank,
|
|
|
+ c.tax_number,
|
|
|
+ c.bank_account,
|
|
|
+ c.reason_public_customer_dict_value,
|
|
|
+ c.has_order_form,
|
|
|
+ c.last_follow_up_time,
|
|
|
+ c.no_follow_up_date,
|
|
|
+ c.public_date,
|
|
|
+ c.public_remind_date,
|
|
|
+ c.garbage_date,
|
|
|
+ c.garbage_remind_date,
|
|
|
+ c.delete_date,
|
|
|
+ c.delete_remind_date,
|
|
|
+ c.owner_time,
|
|
|
+ c.give_up_time,
|
|
|
+ c.create_time,
|
|
|
+ c.update_time,
|
|
|
+ c.is_delete,
|
|
|
+ c.enabled,
|
|
|
+ c.create_by,
|
|
|
+ c.owner_by,
|
|
|
+ c.former_owner_by,
|
|
|
+ c.next_analysis_date,
|
|
|
+ c.update_by,
|
|
|
+ c.sort,
|
|
|
+ cc.id AS cc_id,
|
|
|
+ cc.customer_id AS cc_customer_id,
|
|
|
+ cc.name AS cc_name,
|
|
|
+ cc.address AS cc_address,
|
|
|
+ cc.scale_dict_value AS cc_scale_dict_value,
|
|
|
+ cc.website AS cc_website,
|
|
|
+ cc.website1 AS cc_website1,
|
|
|
+ cc.website2 AS cc_website2,
|
|
|
+ cc.website3 AS cc_website3,
|
|
|
+ cc.industry AS cc_industry,
|
|
|
+ cc.communication_address AS cc_communication_address,
|
|
|
+ cc.postcode AS cc_postcode,
|
|
|
+ cc.fax_number AS cc_fax_number,
|
|
|
+ cc.email AS cc_email,
|
|
|
+ cc.email1 AS cc_email1,
|
|
|
+ cc.email2 AS cc_email2,
|
|
|
+ cc.email3 AS cc_email3,
|
|
|
+ cc.telephone AS cc_telephone,
|
|
|
+ cc.create_time AS cc_create_time,
|
|
|
+ cc.update_time AS cc_update_time,
|
|
|
+ cc.is_delete AS cc_is_delete,
|
|
|
+ cc.enabled AS cc_enabled,
|
|
|
+ cc.create_by AS cc_create_by,
|
|
|
+ cc.owner_by AS cc_owner_by,
|
|
|
+ cc.update_by AS cc_update_by,
|
|
|
+ cc.sort AS cc_sort,
|
|
|
+ l.id AS l_id,
|
|
|
+ l.customer_id AS l_customer_id,
|
|
|
+ l.has_primary_lialison AS l_has_primary_lialison,
|
|
|
+ l.name AS l_name,
|
|
|
+ l.call AS l_call,
|
|
|
+ l.resource_type AS l_resource_type,
|
|
|
+ l.resource_type_id AS l_resource_type_id,
|
|
|
+ l.liaison_role_dict_value AS l_liaison_role_dict_value,
|
|
|
+ l.birthday AS l_birthday,
|
|
|
+ l.department_position AS l_department_position,
|
|
|
+ l.telephone AS l_telephone,
|
|
|
+ l.email AS l_email,
|
|
|
+ l.email1 AS l_email1,
|
|
|
+ l.email2 AS l_email2,
|
|
|
+ l.email3 AS l_email3,
|
|
|
+ l.fax_number AS l_fax_number,
|
|
|
+ l.postcode AS l_postcode,
|
|
|
+ l.contact_information AS l_contact_information,
|
|
|
+ l.remark AS l_remark,
|
|
|
+ l.qq AS l_qq,
|
|
|
+ l.skype AS l_skype,
|
|
|
+ l.wangwang AS l_wangwang,
|
|
|
+ l.wechat AS l_wechat,
|
|
|
+ l.twitter AS l_twitter,
|
|
|
+ l.linkedin AS l_linkedin,
|
|
|
+ l.facebook AS l_facebook,
|
|
|
+ l.whatsapp AS l_whatsapp,
|
|
|
+ l.fixed_line_telephone AS l_fixed_line_telephone,
|
|
|
+ l.home_electricity AS l_home_electricity,
|
|
|
+ l.address AS l_address,
|
|
|
+ l.international_area AS l_international_area,
|
|
|
+ l.last_follow_up_time AS l_last_follow_up_time,
|
|
|
+ l.create_time AS l_create_time,
|
|
|
+ l.update_time AS l_update_time,
|
|
|
+ l.is_delete AS l_is_delete,
|
|
|
+ l.enabled AS l_enabled,
|
|
|
+ l.create_by AS l_create_by,
|
|
|
+ l.owner_by AS l_owner_by,
|
|
|
+ l.former_owner_by AS l_former_owner_by,
|
|
|
+ l.update_by AS l_update_by,
|
|
|
+ l.sort AS l_sort
|
|
|
FROM customer c
|
|
|
LEFT JOIN customer_company cc ON cc.customer_id = c.id AND cc.is_delete = 0
|
|
|
LEFT JOIN liaison l ON l.customer_id = c.id AND l.is_delete = 0 AND l.has_primary_lialison = 1
|
|
|
WHERE c.is_delete = 0
|
|
|
- <!-- customer 表筛选 -->
|
|
|
<if test="dto.id != null">
|
|
|
AND c.id = #{dto.id}
|
|
|
</if>
|
|
|
@@ -178,11 +259,9 @@
|
|
|
<if test="dto.hasOrderForm != null">
|
|
|
AND c.has_order_form = #{dto.hasOrderForm}
|
|
|
</if>
|
|
|
- <!-- 联表筛选:customer_company -->
|
|
|
<if test="dto.companyName != null and dto.companyName != ''">
|
|
|
AND cc.name LIKE CONCAT('%', #{dto.companyName}, '%')
|
|
|
</if>
|
|
|
- <!-- 联表筛选:liaison -->
|
|
|
<if test="dto.liaisonName != null and dto.liaisonName != ''">
|
|
|
AND l.name LIKE CONCAT('%', #{dto.liaisonName}, '%')
|
|
|
</if>
|
|
|
@@ -195,125 +274,125 @@
|
|
|
ORDER BY c.create_time DESC
|
|
|
</select>
|
|
|
|
|
|
- <!-- 根据客户ID查询详情(含企业信息+首要联系人) -->
|
|
|
- <select id="selectDetailByCustomerId" resultType="com.storlead.trade.vo.CustomerVO">
|
|
|
+ <!-- 详情查询 -->
|
|
|
+ <select id="selectDetailByCustomerId" resultMap="CustomerVOResultMap">
|
|
|
SELECT
|
|
|
- c.id AS id,
|
|
|
- c.data_code AS dataCode,
|
|
|
- c.customer_form AS customerForm,
|
|
|
- c.has_from_clue AS hasFromClue,
|
|
|
- c.has_public_customer AS hasPublicCustomer,
|
|
|
- c.has_garbage_customer AS hasGarbageCustomer,
|
|
|
- c.has_follow_customer AS hasFollowCustomer,
|
|
|
- c.customer_code AS customerCode,
|
|
|
- c.continent AS continent,
|
|
|
- c.country AS country,
|
|
|
- c.customer_name AS customerName,
|
|
|
- c.collaborator AS collaborator,
|
|
|
- c.intended_products_ids AS intendedProductsIds,
|
|
|
- c.intended_products_names AS intendedProductsNames,
|
|
|
- c.clue_status_dict_value AS clueStatusDictValue,
|
|
|
- c.customer_status_dict_value AS customerStatusDictValue,
|
|
|
- c.customer_source_dict_value AS customerSourceDictValue,
|
|
|
- c.customer_type_dict_value AS customerTypeDictValue,
|
|
|
- c.cooperative_customer_id AS cooperativeCustomerId,
|
|
|
- c.customer_level_dict_value AS customerLevelDictValue,
|
|
|
- c.customer_credit_level_dict_value AS customerCreditLevelDictValue,
|
|
|
- c.customer_economic_nature_dict_value AS customerEconomicNatureDictValue,
|
|
|
- c.mnemonic_name AS mnemonicName,
|
|
|
- c.remark AS remark,
|
|
|
- c.opening_bank AS openingBank,
|
|
|
- c.tax_number AS taxNumber,
|
|
|
- c.bank_account AS bankAccount,
|
|
|
- c.reason_public_customer_dict_value AS reasonPublicCustomerDictValue,
|
|
|
- c.has_order_form AS hasOrderForm,
|
|
|
- c.last_follow_up_time AS lastFollowUpTime,
|
|
|
- c.no_follow_up_date AS noFollowUpDate,
|
|
|
- c.public_date AS publicDate,
|
|
|
- c.public_remind_date AS publicRemindDate,
|
|
|
- c.garbage_date AS garbageDate,
|
|
|
- c.garbage_remind_date AS garbageRemindDate,
|
|
|
- c.delete_date AS deleteDate,
|
|
|
- c.delete_remind_date AS deleteRemindDate,
|
|
|
- c.owner_time AS ownerTime,
|
|
|
- c.give_up_time AS giveUpTime,
|
|
|
- c.create_time AS createTime,
|
|
|
- c.update_time AS updateTime,
|
|
|
- c.is_delete AS isDelete,
|
|
|
- c.enabled AS enabled,
|
|
|
- c.create_by AS createBy,
|
|
|
- c.owner_by AS ownerBy,
|
|
|
- c.former_owner_by AS formerOwnerBy,
|
|
|
- c.next_analysis_date AS nextAnalysisDate,
|
|
|
- c.update_by AS updateBy,
|
|
|
- c.sort AS sort,
|
|
|
- cc.id AS customerCompany.id,
|
|
|
- cc.customer_id AS customerCompany.customerId,
|
|
|
- cc.name AS customerCompany.name,
|
|
|
- cc.address AS customerCompany.address,
|
|
|
- cc.scale_dict_value AS customerCompany.scaleDictValue,
|
|
|
- cc.website AS customerCompany.website,
|
|
|
- cc.website1 AS customerCompany.website1,
|
|
|
- cc.website2 AS customerCompany.website2,
|
|
|
- cc.website3 AS customerCompany.website3,
|
|
|
- cc.industry AS customerCompany.industry,
|
|
|
- cc.communication_address AS customerCompany.communicationAddress,
|
|
|
- cc.postcode AS customerCompany.postcode,
|
|
|
- cc.fax_number AS customerCompany.faxNumber,
|
|
|
- cc.email AS customerCompany.email,
|
|
|
- cc.email1 AS customerCompany.email1,
|
|
|
- cc.email2 AS customerCompany.email2,
|
|
|
- cc.email3 AS customerCompany.email3,
|
|
|
- cc.telephone AS customerCompany.telephone,
|
|
|
- cc.create_time AS customerCompany.createTime,
|
|
|
- cc.update_time AS customerCompany.updateTime,
|
|
|
- cc.is_delete AS customerCompany.isDelete,
|
|
|
- cc.enabled AS customerCompany.enabled,
|
|
|
- cc.create_by AS customerCompany.createBy,
|
|
|
- cc.owner_by AS customerCompany.ownerBy,
|
|
|
- cc.update_by AS customerCompany.updateBy,
|
|
|
- cc.sort AS customerCompany.sort,
|
|
|
- l.id AS liaison.id,
|
|
|
- l.customer_id AS liaison.customerId,
|
|
|
- l.has_primary_lialison AS liaison.hasPrimaryLialison,
|
|
|
- l.name AS liaison.name,
|
|
|
- l.call AS liaison.call,
|
|
|
- l.resource_type AS liaison.resourceType,
|
|
|
- l.resource_type_id AS liaison.resourceTypeId,
|
|
|
- l.liaison_role_dict_value AS liaison.liaisonRoleDictValue,
|
|
|
- l.birthday AS liaison.birthday,
|
|
|
- l.department_position AS liaison.departmentPosition,
|
|
|
- l.telephone AS liaison.telephone,
|
|
|
- l.email AS liaison.email,
|
|
|
- l.email1 AS liaison.email1,
|
|
|
- l.email2 AS liaison.email2,
|
|
|
- l.email3 AS liaison.email3,
|
|
|
- l.fax_number AS liaison.faxNumber,
|
|
|
- l.postcode AS liaison.postcode,
|
|
|
- l.contact_information AS liaison.contactInformation,
|
|
|
- l.remark AS liaison.remark,
|
|
|
- l.qq AS liaison.qq,
|
|
|
- l.skype AS liaison.skype,
|
|
|
- l.wangwang AS liaison.wangwang,
|
|
|
- l.wechat AS liaison.wechat,
|
|
|
- l.twitter AS liaison.twitter,
|
|
|
- l.linkedin AS liaison.linkedin,
|
|
|
- l.facebook AS liaison.facebook,
|
|
|
- l.whatsapp AS liaison.whatsapp,
|
|
|
- l.fixed_line_telephone AS liaison.fixedLineTelephone,
|
|
|
- l.home_electricity AS liaison.homeElectricity,
|
|
|
- l.address AS liaison.address,
|
|
|
- l.international_area AS liaison.internationalArea,
|
|
|
- l.last_follow_up_time AS liaison.lastFollowUpTime,
|
|
|
- l.create_time AS liaison.createTime,
|
|
|
- l.update_time AS liaison.updateTime,
|
|
|
- l.is_delete AS liaison.isDelete,
|
|
|
- l.enabled AS liaison.enabled,
|
|
|
- l.create_by AS liaison.createBy,
|
|
|
- l.owner_by AS liaison.ownerBy,
|
|
|
- l.former_owner_by AS liaison.formerOwnerBy,
|
|
|
- l.update_by AS liaison.updateBy,
|
|
|
- l.sort AS liaison.sort
|
|
|
+ c.id,
|
|
|
+ c.data_code,
|
|
|
+ c.customer_form,
|
|
|
+ c.has_from_clue,
|
|
|
+ c.has_public_customer,
|
|
|
+ c.has_garbage_customer,
|
|
|
+ c.has_follow_customer,
|
|
|
+ c.customer_code,
|
|
|
+ c.continent,
|
|
|
+ c.country,
|
|
|
+ c.customer_name,
|
|
|
+ c.collaborator,
|
|
|
+ c.intended_products_ids,
|
|
|
+ c.intended_products_names,
|
|
|
+ c.clue_status_dict_value,
|
|
|
+ c.customer_status_dict_value,
|
|
|
+ c.customer_source_dict_value,
|
|
|
+ c.customer_type_dict_value,
|
|
|
+ c.cooperative_customer_id,
|
|
|
+ c.customer_level_dict_value,
|
|
|
+ c.customer_credit_level_dict_value,
|
|
|
+ c.customer_economic_nature_dict_value,
|
|
|
+ c.mnemonic_name,
|
|
|
+ c.remark,
|
|
|
+ c.opening_bank,
|
|
|
+ c.tax_number,
|
|
|
+ c.bank_account,
|
|
|
+ c.reason_public_customer_dict_value,
|
|
|
+ c.has_order_form,
|
|
|
+ c.last_follow_up_time,
|
|
|
+ c.no_follow_up_date,
|
|
|
+ c.public_date,
|
|
|
+ c.public_remind_date,
|
|
|
+ c.garbage_date,
|
|
|
+ c.garbage_remind_date,
|
|
|
+ c.delete_date,
|
|
|
+ c.delete_remind_date,
|
|
|
+ c.owner_time,
|
|
|
+ c.give_up_time,
|
|
|
+ c.create_time,
|
|
|
+ c.update_time,
|
|
|
+ c.is_delete,
|
|
|
+ c.enabled,
|
|
|
+ c.create_by,
|
|
|
+ c.owner_by,
|
|
|
+ c.former_owner_by,
|
|
|
+ c.next_analysis_date,
|
|
|
+ c.update_by,
|
|
|
+ c.sort,
|
|
|
+ cc.id AS cc_id,
|
|
|
+ cc.customer_id AS cc_customer_id,
|
|
|
+ cc.name AS cc_name,
|
|
|
+ cc.address AS cc_address,
|
|
|
+ cc.scale_dict_value AS cc_scale_dict_value,
|
|
|
+ cc.website AS cc_website,
|
|
|
+ cc.website1 AS cc_website1,
|
|
|
+ cc.website2 AS cc_website2,
|
|
|
+ cc.website3 AS cc_website3,
|
|
|
+ cc.industry AS cc_industry,
|
|
|
+ cc.communication_address AS cc_communication_address,
|
|
|
+ cc.postcode AS cc_postcode,
|
|
|
+ cc.fax_number AS cc_fax_number,
|
|
|
+ cc.email AS cc_email,
|
|
|
+ cc.email1 AS cc_email1,
|
|
|
+ cc.email2 AS cc_email2,
|
|
|
+ cc.email3 AS cc_email3,
|
|
|
+ cc.telephone AS cc_telephone,
|
|
|
+ cc.create_time AS cc_create_time,
|
|
|
+ cc.update_time AS cc_update_time,
|
|
|
+ cc.is_delete AS cc_is_delete,
|
|
|
+ cc.enabled AS cc_enabled,
|
|
|
+ cc.create_by AS cc_create_by,
|
|
|
+ cc.owner_by AS cc_owner_by,
|
|
|
+ cc.update_by AS cc_update_by,
|
|
|
+ cc.sort AS cc_sort,
|
|
|
+ l.id AS l_id,
|
|
|
+ l.customer_id AS l_customer_id,
|
|
|
+ l.has_primary_lialison AS l_has_primary_lialison,
|
|
|
+ l.name AS l_name,
|
|
|
+ l.call AS l_call,
|
|
|
+ l.resource_type AS l_resource_type,
|
|
|
+ l.resource_type_id AS l_resource_type_id,
|
|
|
+ l.liaison_role_dict_value AS l_liaison_role_dict_value,
|
|
|
+ l.birthday AS l_birthday,
|
|
|
+ l.department_position AS l_department_position,
|
|
|
+ l.telephone AS l_telephone,
|
|
|
+ l.email AS l_email,
|
|
|
+ l.email1 AS l_email1,
|
|
|
+ l.email2 AS l_email2,
|
|
|
+ l.email3 AS l_email3,
|
|
|
+ l.fax_number AS l_fax_number,
|
|
|
+ l.postcode AS l_postcode,
|
|
|
+ l.contact_information AS l_contact_information,
|
|
|
+ l.remark AS l_remark,
|
|
|
+ l.qq AS l_qq,
|
|
|
+ l.skype AS l_skype,
|
|
|
+ l.wangwang AS l_wangwang,
|
|
|
+ l.wechat AS l_wechat,
|
|
|
+ l.twitter AS l_twitter,
|
|
|
+ l.linkedin AS l_linkedin,
|
|
|
+ l.facebook AS l_facebook,
|
|
|
+ l.whatsapp AS l_whatsapp,
|
|
|
+ l.fixed_line_telephone AS l_fixed_line_telephone,
|
|
|
+ l.home_electricity AS l_home_electricity,
|
|
|
+ l.address AS l_address,
|
|
|
+ l.international_area AS l_international_area,
|
|
|
+ l.last_follow_up_time AS l_last_follow_up_time,
|
|
|
+ l.create_time AS l_create_time,
|
|
|
+ l.update_time AS l_update_time,
|
|
|
+ l.is_delete AS l_is_delete,
|
|
|
+ l.enabled AS l_enabled,
|
|
|
+ l.create_by AS l_create_by,
|
|
|
+ l.owner_by AS l_owner_by,
|
|
|
+ l.former_owner_by AS l_former_owner_by,
|
|
|
+ l.update_by AS l_update_by,
|
|
|
+ l.sort AS l_sort
|
|
|
FROM customer c
|
|
|
LEFT JOIN customer_company cc ON cc.customer_id = c.id AND cc.is_delete = 0
|
|
|
LEFT JOIN liaison l ON l.customer_id = c.id AND l.is_delete = 0 AND l.has_primary_lialison = 1
|