| 
					
				 | 
			
			
				@@ -51,12 +51,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="visitTime"    column="visit_time"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="trafficSource"   column="traffic_source"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="importType"    column="import_type"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="volume"    column="volume"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="thirdAccount"    column="third_account"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="clueId"    column="clue_id"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="customerLevel"    column="customer_level"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="isTop"    column="is_top"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </resultMap> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectCrmCustomerList" parameterType="CrmCustomer" resultMap="CrmCustomerResult"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -92,6 +95,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="importType != null "> and import_type = #{importType}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="thirdAccount != null "> and third_account = #{thirdAccount}</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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         order by customer_id desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -156,6 +161,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="importType != null">import_type,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="thirdAccount != null">third_account,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="clueId != null">clue_id,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="customerLevel != null">customer_level,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="isTop != null">is_top,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				          </trim> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <trim prefix="values (" suffix=")" suffixOverrides=","> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="customerCode != null">#{customerCode},</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -205,6 +212,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="importType != null">#{importType},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="thirdAccount != null">#{thirdAccount},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="clueId != null">#{clueId},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="customerLevel != null">#{customerLevel},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="isTop != null">#{isTop},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				          </trim> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </insert> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -258,6 +267,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="importType != null">import_type = #{importType},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="thirdAccount != null">third_account = #{thirdAccount},</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> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         where customer_id = #{customerId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </update> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -292,13 +303,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <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, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                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 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             inner join crm_customer c on c.customer_user_id=cu.customer_user_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         where cu.is_pool=0  and c.is_del = 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <if test="maps.companyId != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and cu.company_id =#{maps.companyId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="maps.customerLevel != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and c.customer_level =#{maps.customerLevel} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <if test="maps.companyUserId != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and cu.company_user_id =#{maps.companyUserId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -358,7 +372,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <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, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         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 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         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 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -369,6 +383,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <if test="maps.companyUserId != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and ca.company_user_id =#{maps.companyUserId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="maps.customerLevel != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            and c.customer_level =#{maps.customerLevel} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <if test="maps.address != null and  maps.address != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and c.address like CONCAT('%',#{maps.address},'%') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 |