|
@@ -53,10 +53,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<result property="importType" column="import_type" />
|
|
<result property="importType" column="import_type" />
|
|
<result property="thirdAccount" column="third_account" />
|
|
<result property="thirdAccount" column="third_account" />
|
|
<result property="clueId" column="clue_id" />
|
|
<result property="clueId" column="clue_id" />
|
|
|
|
+ <result property="customerLevel" column="customer_level" />
|
|
|
|
+ <result property="isTop" column="is_top" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCrmCustomerVo">
|
|
<sql id="selectCrmCustomerVo">
|
|
- select customer_id, customer_code, customer_name, mobile, sex, weixin, remark, user_id, create_user_id, receive_user_id, customer_user_id, address,city_ids, location, detail_address, lng, lat, create_time, update_time, status, is_receive, dept_id, is_del, customer_type, receive_time, pool_time, company_id, is_line, source, tags,ext_json,visit_status,register_date,register_link_url,register_desc,register_submit_time,is_pool,register_type,pay_money,buy_count,source_code,push_time,push_code,visit_time,traffic_source,import_type,third_account,clue_id from crm_customer
|
|
|
|
|
|
+ select customer_id, customer_code, customer_name, mobile, sex, weixin, remark, user_id, create_user_id, receive_user_id, customer_user_id, address,city_ids, location, detail_address, lng, lat, create_time, update_time, status, is_receive, dept_id, is_del, customer_type, receive_time, pool_time, company_id, is_line, source, tags,ext_json,visit_status,register_date,register_link_url,register_desc,register_submit_time,is_pool,register_type,pay_money,buy_count,source_code,push_time,push_code,visit_time,traffic_source,import_type,third_account,clue_id,customer_level,is_top from crm_customer
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectCrmCustomerList" parameterType="CrmCustomer" resultMap="CrmCustomerResult">
|
|
<select id="selectCrmCustomerList" parameterType="CrmCustomer" resultMap="CrmCustomerResult">
|
|
@@ -92,6 +94,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="importType != null "> and import_type = #{importType}</if>
|
|
<if test="importType != null "> and import_type = #{importType}</if>
|
|
<if test="thirdAccount != null "> and third_account = #{thirdAccount}</if>
|
|
<if test="thirdAccount != null "> and third_account = #{thirdAccount}</if>
|
|
<if test="clueId != null "> and clue_id = #{clueId}</if>
|
|
<if test="clueId != null "> and clue_id = #{clueId}</if>
|
|
|
|
+ <if test="customerLevel != null "> and customer_level = #{customerLevel}</if>
|
|
|
|
+ <if test="isTop != null "> and is_top = #{isTop}</if>
|
|
</where>
|
|
</where>
|
|
order by customer_id desc
|
|
order by customer_id desc
|
|
</select>
|
|
</select>
|
|
@@ -156,6 +160,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="importType != null">import_type,</if>
|
|
<if test="importType != null">import_type,</if>
|
|
<if test="thirdAccount != null">third_account,</if>
|
|
<if test="thirdAccount != null">third_account,</if>
|
|
<if test="clueId != null">clue_id,</if>
|
|
<if test="clueId != null">clue_id,</if>
|
|
|
|
+ <if test="customerLevel != null">customer_level,</if>
|
|
|
|
+ <if test="isTop != null">is_top,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="customerCode != null">#{customerCode},</if>
|
|
<if test="customerCode != null">#{customerCode},</if>
|
|
@@ -205,6 +211,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="importType != null">#{importType},</if>
|
|
<if test="importType != null">#{importType},</if>
|
|
<if test="thirdAccount != null">#{thirdAccount},</if>
|
|
<if test="thirdAccount != null">#{thirdAccount},</if>
|
|
<if test="clueId != null">#{clueId},</if>
|
|
<if test="clueId != null">#{clueId},</if>
|
|
|
|
+ <if test="customerLevel != null">#{customerLevel},</if>
|
|
|
|
+ <if test="isTop != null">#{isTop},</if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
@@ -258,6 +266,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="importType != null">import_type = #{importType},</if>
|
|
<if test="importType != null">import_type = #{importType},</if>
|
|
<if test="thirdAccount != null">third_account = #{thirdAccount},</if>
|
|
<if test="thirdAccount != null">third_account = #{thirdAccount},</if>
|
|
<if test="clueId != null">clue_id = #{clueId},</if>
|
|
<if test="clueId != null">clue_id = #{clueId},</if>
|
|
|
|
+ <if test="customerLevel != null">customer_level = #{customerLevel},</if>
|
|
|
|
+ <if test="isTop != null">is_top = #{isTop},</if>
|
|
</trim>
|
|
</trim>
|
|
where customer_id = #{customerId}
|
|
where customer_id = #{customerId}
|
|
</update>
|
|
</update>
|
|
@@ -292,13 +302,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<select id="selectCrmMyCustomerListQuery" resultType="com.fs.crm.vo.CrmMyCustomerListQueryVO">
|
|
<select id="selectCrmMyCustomerListQuery" resultType="com.fs.crm.vo.CrmMyCustomerListQueryVO">
|
|
select cu.*,c.create_time as customer_create_time,c.visit_status,c.remark,c.register_desc,c.register_submit_time,
|
|
select cu.*,c.create_time as customer_create_time,c.visit_status,c.remark,c.register_desc,c.register_submit_time,
|
|
c.customer_code,c.customer_name,c.mobile,c.sex,c.weixin,c.address,c.is_receive,c.customer_type,c.source,
|
|
c.customer_code,c.customer_name,c.mobile,c.sex,c.weixin,c.address,c.is_receive,c.customer_type,c.source,
|
|
- c.tags,c.receive_time
|
|
|
|
|
|
+ c.tags,c.receive_time,c.customer_level
|
|
from crm_customer_user cu
|
|
from crm_customer_user cu
|
|
inner join crm_customer c on c.customer_user_id=cu.customer_user_id
|
|
inner join crm_customer c on c.customer_user_id=cu.customer_user_id
|
|
where cu.is_pool=0 and c.is_del = 0
|
|
where cu.is_pool=0 and c.is_del = 0
|
|
<if test="maps.companyId != null">
|
|
<if test="maps.companyId != null">
|
|
and cu.company_id =#{maps.companyId}
|
|
and cu.company_id =#{maps.companyId}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="maps.customerLevel != null">
|
|
|
|
+ and c.customer_level =#{maps.customerLevel}
|
|
|
|
+ </if>
|
|
<if test="maps.companyUserId != null">
|
|
<if test="maps.companyUserId != null">
|
|
and cu.company_user_id =#{maps.companyUserId}
|
|
and cu.company_user_id =#{maps.companyUserId}
|
|
</if>
|
|
</if>
|
|
@@ -358,7 +371,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<select id="selectCrmMyAssistListQuery" resultType="com.fs.crm.vo.CrmMyCustomerListQueryVO">
|
|
<select id="selectCrmMyAssistListQuery" resultType="com.fs.crm.vo.CrmMyCustomerListQueryVO">
|
|
select cu.*,c.create_time as customer_create_time,c.visit_status,c.remark,c.register_desc,c.register_submit_time,
|
|
select cu.*,c.create_time as customer_create_time,c.visit_status,c.remark,c.register_desc,c.register_submit_time,
|
|
c.customer_code,c.customer_name,c.mobile,c.sex,c.weixin,c.address,c.is_receive,c.customer_type,c.source,
|
|
c.customer_code,c.customer_name,c.mobile,c.sex,c.weixin,c.address,c.is_receive,c.customer_type,c.source,
|
|
- c.tags,c.receive_time
|
|
|
|
|
|
+ c.tags,c.receive_time, c.customer_level
|
|
from crm_customer_assist ca
|
|
from crm_customer_assist ca
|
|
LEFT JOIN crm_customer c on c.customer_id=ca.customer_id
|
|
LEFT JOIN crm_customer c on c.customer_id=ca.customer_id
|
|
LEFT JOIN crm_customer_user cu on c.customer_user_id=cu.customer_user_id
|
|
LEFT JOIN crm_customer_user cu on c.customer_user_id=cu.customer_user_id
|
|
@@ -369,6 +382,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="maps.companyUserId != null">
|
|
<if test="maps.companyUserId != null">
|
|
and ca.company_user_id =#{maps.companyUserId}
|
|
and ca.company_user_id =#{maps.companyUserId}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="maps.customerLevel != null">
|
|
|
|
+ and c.customer_level =#{maps.customerLevel}
|
|
|
|
+ </if>
|
|
<if test="maps.address != null and maps.address != ''">
|
|
<if test="maps.address != null and maps.address != ''">
|
|
and c.address like CONCAT('%',#{maps.address},'%')
|
|
and c.address like CONCAT('%',#{maps.address},'%')
|
|
</if>
|
|
</if>
|