Browse Source

客户新增

wanghui 8 years ago
parent
commit
2e518fc5fd

+ 1 - 1
generatorConfig.xml

@@ -8,6 +8,6 @@
     <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="AFT" />
     <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="AFT" />
     <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="AFT" type="XMLMAPPER" />
-    <table schema="aft" tableName="user"/>
+    <table schema="aft" tableName="organization_contact_book"/>
   </context>
 </generatorConfiguration>

+ 8 - 0
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -76,4 +76,12 @@ public class AFTConstants {
 	public static final String CUSTOMER_FOLLOW						= "跟进客户";
 	
 	public static final String CUSTOMER_VIEW_ALL					= "customer_view_all";
+	
+	public static final String USER_TYPE_PERSONAL					= "0";
+	
+	public static final String USER_TYPE_ORGANIZATION				= "1";
+	
+	public static final String SHARE_TYPE_PRIVATE					= "0";
+	
+	public static final String SHARE_TYPE_PUBLIC					= "1";
 }

+ 13 - 11
src/main/java/com/goafanti/common/dao/OrganizationContactBookMapper.java

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.OrganizationContactBookExample;
+import com.goafanti.customer.bo.CustomerSimpleBo;
+
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
@@ -9,69 +11,69 @@ public interface OrganizationContactBookMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	long countByExample(OrganizationContactBookExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	int deleteByExample(OrganizationContactBookExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	int deleteByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	int insert(OrganizationContactBook record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	int insertSelective(OrganizationContactBook record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	List<OrganizationContactBook> selectByExample(OrganizationContactBookExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	OrganizationContactBook selectByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	int updateByExampleSelective(@Param("record") OrganizationContactBook record,
 			@Param("example") OrganizationContactBookExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	int updateByExample(@Param("record") OrganizationContactBook record,
 			@Param("example") OrganizationContactBookExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	int updateByPrimaryKeySelective(OrganizationContactBook record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	int updateByPrimaryKey(OrganizationContactBook record);
 }

+ 5 - 2
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -11,8 +11,7 @@ import com.goafanti.user.bo.UserDownLoadBo;
 import com.goafanti.user.bo.UserPageHomeBo;
 import com.goafanti.user.bo.UserPartnerDetailBo;
 import com.goafanti.common.model.UserExample;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.customer.bo.CustomerListOut;
+import com.goafanti.customer.bo.CustomerSimpleBo;
 
 public interface UserMapper {
 	/**
@@ -100,4 +99,8 @@ public interface UserMapper {
 	List<UserPartnerDetailBo> findUserPartner();
 	
 	User selectByMobieAndType(String mobile, Integer type);
+	
+	List<CustomerSimpleBo> findCustomerByName(@Param("name")String name);
+
+	int judgeCustomerByName(String name);
 }

+ 29 - 31
src/main/java/com/goafanti/common/mapper/OrganizationContactBookMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="cid" jdbcType="VARCHAR" property="cid" />
@@ -18,14 +18,14 @@
     <result column="depatrment" jdbcType="VARCHAR" property="depatrment" />
     <result column="customer_position" jdbcType="VARCHAR" property="customerPosition" />
     <result column="tel_num" jdbcType="VARCHAR" property="telNum" />
-    <result column="primary_flg" jdbcType="INTEGER" property="primaryFlg" />
+    <result column="major" jdbcType="INTEGER" property="major" />
     <result column="aid" jdbcType="VARCHAR" property="aid" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -59,7 +59,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -93,16 +93,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     id, cid, name, sex, mobile, email, qq, wechat, depatrment, customer_position, tel_num, 
-    primary_flg, aid
+    major, aid
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.OrganizationContactBookExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     select
     <if test="distinct">
@@ -121,7 +121,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -132,7 +132,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     delete from organization_contact_book
     where id = #{id,jdbcType=VARCHAR}
@@ -141,7 +141,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     delete from organization_contact_book
     <if test="_parameter != null">
@@ -152,24 +152,22 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     insert into organization_contact_book (id, cid, name, 
       sex, mobile, email, qq, 
       wechat, depatrment, customer_position, 
-      tel_num, primary_flg, aid
-      )
+      tel_num, major, aid)
     values (#{id,jdbcType=VARCHAR}, #{cid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
       #{sex,jdbcType=CHAR}, #{mobile,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR}, 
       #{wechat,jdbcType=VARCHAR}, #{depatrment,jdbcType=VARCHAR}, #{customerPosition,jdbcType=VARCHAR}, 
-      #{telNum,jdbcType=VARCHAR}, #{primaryFlg,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}
-      )
+      #{telNum,jdbcType=VARCHAR}, #{major,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.OrganizationContactBook">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     insert into organization_contact_book
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -206,8 +204,8 @@
       <if test="telNum != null">
         tel_num,
       </if>
-      <if test="primaryFlg != null">
-        primary_flg,
+      <if test="major != null">
+        major,
       </if>
       <if test="aid != null">
         aid,
@@ -247,8 +245,8 @@
       <if test="telNum != null">
         #{telNum,jdbcType=VARCHAR},
       </if>
-      <if test="primaryFlg != null">
-        #{primaryFlg,jdbcType=INTEGER},
+      <if test="major != null">
+        #{major,jdbcType=INTEGER},
       </if>
       <if test="aid != null">
         #{aid,jdbcType=VARCHAR},
@@ -259,7 +257,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     select count(*) from organization_contact_book
     <if test="_parameter != null">
@@ -270,7 +268,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     update organization_contact_book
     <set>
@@ -307,8 +305,8 @@
       <if test="record.telNum != null">
         tel_num = #{record.telNum,jdbcType=VARCHAR},
       </if>
-      <if test="record.primaryFlg != null">
-        primary_flg = #{record.primaryFlg,jdbcType=INTEGER},
+      <if test="record.major != null">
+        major = #{record.major,jdbcType=INTEGER},
       </if>
       <if test="record.aid != null">
         aid = #{record.aid,jdbcType=VARCHAR},
@@ -322,7 +320,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     update organization_contact_book
     set id = #{record.id,jdbcType=VARCHAR},
@@ -336,7 +334,7 @@
       depatrment = #{record.depatrment,jdbcType=VARCHAR},
       customer_position = #{record.customerPosition,jdbcType=VARCHAR},
       tel_num = #{record.telNum,jdbcType=VARCHAR},
-      primary_flg = #{record.primaryFlg,jdbcType=INTEGER},
+      major = #{record.major,jdbcType=INTEGER},
       aid = #{record.aid,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -346,7 +344,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     update organization_contact_book
     <set>
@@ -380,8 +378,8 @@
       <if test="telNum != null">
         tel_num = #{telNum,jdbcType=VARCHAR},
       </if>
-      <if test="primaryFlg != null">
-        primary_flg = #{primaryFlg,jdbcType=INTEGER},
+      <if test="major != null">
+        major = #{major,jdbcType=INTEGER},
       </if>
       <if test="aid != null">
         aid = #{aid,jdbcType=VARCHAR},
@@ -393,7 +391,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Nov 10 19:10:10 CST 2017.
+      This element was generated on Mon Nov 13 11:47:55 CST 2017.
     -->
     update organization_contact_book
     set cid = #{cid,jdbcType=VARCHAR},
@@ -406,7 +404,7 @@
       depatrment = #{depatrment,jdbcType=VARCHAR},
       customer_position = #{customerPosition,jdbcType=VARCHAR},
       tel_num = #{telNum,jdbcType=VARCHAR},
-      primary_flg = #{primaryFlg,jdbcType=INTEGER},
+      major = #{major,jdbcType=INTEGER},
       aid = #{aid,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>

+ 250 - 440
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -1,447 +1,257 @@
 <?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.goafanti.common.dao.UserMapper">
-	<select id="selectCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
-		<choose>
-			<when test="type == 0">
-				select  
-					a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,a.service_certification as serviceCertification,
-					a.user_certification as userCertification,a.current_member_status as currentMemberStatus,a.identify_name as name,a.lvl,
-					b.contacts,b.contact_mobile as contactMobile,b.international,b.expert,b.celebrity,
-					dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
-				from 
-				(select 
-					id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
-				from user
-					where type = 0
-					<if test="aid != null and aid !=''">
-						and aid = #{aid,jdbcType=VARCHAR}
-					</if>
-					<if test="shareType != null">
-						and share_type = #{shareType,jdbcType=VARCHAR}
-					</if>				
-					<if test="status != null">
-						and status = #{status,jdbcType=INTEGER}
-					</if>
-					<if test="serviceCertification != null">
-						and service_certification = #{serviceCertification,jdbcType=INTEGER}
-					</if>
-					<if test="userCertification != null">
-						and user_certification = #{userCertification,jdbcType=INTEGER}
-					</if>
-					<if test="currentMemberStatus != null">
-						and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
-					</if>
-					<if test="startDate != null and startDate != ''">
-				   	 	and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
-				   	</if>
-				   	<if test="endDate != null and endDate != ''">
-				   	 	and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
-				   	</if>
-				)as a inner join user_identity b on a.id = b.uid 
-				left join district_glossory dg1 on b.province = dg1.id 
-				left join district_glossory dg2 on b.city = dg2.id 
-				left join district_glossory dg3 on b.area = dg3.id
-				left join industry_category c on b.industry = c.id 
-				where 1=1 
-				<if test="name != null and name !=''">
-					and b.username = #{name,jdbcType=VARCHAR}
-				</if>
-				<if test="province != null">
-					and b.province = #{province,jdbcType=INTEGER}
-				</if>
-				<if test="city != null">
-					and b.city = #{province,city=INTEGER}
-				</if>
-				<if test="province != null">
-					and b.area = #{area,jdbcType=INTEGER}
-				</if>
-				<if test="industry != null">
-					and b.industry = #{industry,jdbcType=INTEGER}
-				</if>
-			</when>
-			<when test="type == 1">
-				select  
-					a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,a.service_certification as serviceCertification,
-					a.user_certification as userCertification,a.current_member_status as currentMemberStatus,a.identify_name as name,a.lvl,
-					b.contacts,b.contact_mobile as contactMobile,b.international,0 as expert,0 as celebrity,
-					dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
-				from 
-				(select 
-					id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
-				from user
-					where type = 1
-					<if test="aid != null and aid !=''">
-						and aid = #{aid,jdbcType=VARCHAR}
-					</if>
-					<if test="shareType != null">
-						and share_type = #{shareType,jdbcType=VARCHAR}
-					</if>				
-					<if test="status != null">
-						and status = #{status,jdbcType=INTEGER}
-					</if>
-					<if test="serviceCertification != null">
-						and service_certification = #{serviceCertification,jdbcType=INTEGER}
-					</if>
-					<if test="userCertification != null">
-						and user_certification = #{userCertification,jdbcType=INTEGER}
-					</if>
-					<if test="currentMemberStatus != null">
-						and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
-					</if>
-					<if test="startDate != null and startDate != ''">
-				   	 	and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
-				   	</if>
-				   	<if test="endDate != null and endDate != ''">
-				   	 	and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
-				   	</if>
-				)as a inner join organization_identity b on a.id = b.uid 
-				left join district_glossory dg1 on b.licence_province = dg1.id 
-				left join district_glossory dg2 on b.licence_city = dg2.id 
-				left join district_glossory dg3 on b.licence_area = dg3.id
-				left join industry_category c on b.industry = c.id 
-				where 1=1
-				<if test="name != null and name != ''">
-					and b.unit_name = #{name,jdbcType=VARCHAR}
-				</if>
-				<if test="province != null">
-					and b.licence_province = #{province,jdbcType=INTEGER}
-				</if>
-				<if test="city != null">
-					and b.licence_city = #{province,city=INTEGER}
-				</if>
-				<if test="province != null">
-					and b.licence_area = #{area,jdbcType=INTEGER}
-				</if>
-				<if test="industry != null">
-					and b.industry = #{industry,jdbcType=INTEGER}
-				</if>
-			</when>
-			<otherwise>
-			select * from (
-				select  
-					a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,a.service_certification as serviceCertification,
-					a.user_certification as userCertification,a.current_member_status as currentMemberStatus,a.identify_name as name,a.lvl,
-					b.contacts,b.contact_mobile as contactMobile,b.international,b.expert,b.celebrity,
-					dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
-				from 
-				(select 
-					id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
-				from user
-					where type = 0
-					<if test="aid != null and aid !=''">
-						and aid = #{aid,jdbcType=VARCHAR}
-					</if>
-					<if test="shareType != null">
-						and share_type = #{shareType,jdbcType=VARCHAR}
-					</if>					
-					<if test="status != null">
-						and status = #{status,jdbcType=INTEGER}
-					</if>
-					<if test="serviceCertification != null">
-						and service_certification = #{serviceCertification,jdbcType=INTEGER}
-					</if>
-					<if test="userCertification != null">
-						and user_certification = #{userCertification,jdbcType=INTEGER}
-					</if>
-					<if test="currentMemberStatus != null">
-						and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
-					</if>
-					<if test="startDate != null and startDate != ''">
-				   	 	and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
-				   	</if>
-				   	<if test="endDate != null and endDate != ''">
-				   	 	and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
-				   	</if>
-				)as a inner join user_identity b on a.id = b.uid 
-				left join district_glossory dg1 on b.province = dg1.id 
-				left join district_glossory dg2 on b.city = dg2.id 
-				left join district_glossory dg3 on b.area = dg3.id
-				left join industry_category c on b.industry = c.id 
-				where 1=1 
-				<if test="name != null and name != ''">
-					and b.username = #{name,jdbcType=VARCHAR}
-				</if>
-				<if test="province != null">
-					and b.province = #{province,jdbcType=INTEGER}
-				</if>
-				<if test="city != null">
-					and b.city = #{province,city=INTEGER}
-				</if>
-				<if test="province != null">
-					and b.area = #{area,jdbcType=INTEGER}
-				</if>
-				<if test="industry != null">
-					and b.industry = #{industry,jdbcType=INTEGER}
-				</if>
-				union
-				select  
-					a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,a.service_certification as serviceCertification,
-					a.user_certification as userCertification,a.current_member_status as currentMemberStatus,a.identify_name as name,a.lvl,
-					b.contacts,b.contact_mobile as contactMobile,b.international,0 as expert,0 as celebrity,
-					dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
-				from 
-				(select 
-					id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
-				from user
-					where type = 1
-					<if test="aid != null and aid !=''">
-						and aid = #{aid,jdbcType=VARCHAR}
-					</if>		
-					<if test="shareType != null">
-						and share_type = #{shareType,jdbcType=VARCHAR}
-					</if>			
-					<if test="status != null">
-						and status = #{status,jdbcType=INTEGER}
-					</if>
-					<if test="serviceCertification != null">
-						and service_certification = #{serviceCertification,jdbcType=INTEGER}
-					</if>
-					<if test="userCertification != null">
-						and user_certification = #{userCertification,jdbcType=INTEGER}
-					</if>
-					<if test="currentMemberStatus != null">
-						and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
-					</if>
-					<if test="startDate != null and startDate != ''">
-				   	 	and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
-				   	</if>
-				   	<if test="endDate != null and endDate != ''">
-				   	 	and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
-				   	</if>
-				)as a inner join organization_identity b on a.id = b.uid 
-				left join district_glossory dg1 on b.licence_province = dg1.id 
-				left join district_glossory dg2 on b.licence_city = dg2.id 
-				left join district_glossory dg3 on b.licence_area = dg3.id
-				left join industry_category c on b.industry = c.id 
-				where 1=1
-				<if test="name != null and name != ''">
-					and b.unit_name = #{name,jdbcType=VARCHAR}
-				</if>
-				<if test="province != null">
-					and b.licence_province = #{province,jdbcType=INTEGER}
-				</if>
-				<if test="city != null">
-					and b.licence_city = #{province,city=INTEGER}
-				</if>
-				<if test="province != null">
-					and b.licence_area = #{area,jdbcType=INTEGER}
-				</if>
-				<if test="industry != null">
-					and b.industry = #{industry,jdbcType=INTEGER}
-				</if>	
-			)y	
-			</otherwise>
-		</choose>
-		order by createTime desc
-		<if test="page_sql!=null">
-			${page_sql}
+	<select id="selectPersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
+		select
+		a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
+		a.service_certification as serviceCertification,
+		a.user_certification as userCertification,a.current_member_status as
+		currentMemberStatus,a.identify_name as name,a.lvl,
+		b.contacts,b.contact_mobile as
+		contactMobile,b.international,b.expert,b.celebrity,
+		dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
+		from
+		(select
+		id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
+		from user
+		where type = 0
+		<if test="aid != null and aid !=''">
+			and aid = #{aid,jdbcType=VARCHAR}
 		</if>
+		<if test="shareType != null">
+			and share_type = #{shareType,jdbcType=VARCHAR}
+		</if>
+		<if test="status != null">
+			and status = #{status,jdbcType=INTEGER}
+		</if>
+		<if test="serviceCertification != null">
+			and service_certification = #{serviceCertification,jdbcType=INTEGER}
+		</if>
+		<if test="userCertification != null">
+			and user_certification = #{userCertification,jdbcType=INTEGER}
+		</if>
+		<if test="currentMemberStatus != null">
+			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+		</if>
+		<if test="startDate != null and startDate != ''">
+			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="endDate != null and endDate != ''">
+			and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		)as a inner join user_identity b on a.id = b.uid
+		left join district_glossory dg1 on b.province = dg1.id
+		left join district_glossory dg2 on b.city = dg2.id
+		left join district_glossory dg3 on b.area = dg3.id
+		left join industry_category c on b.industry = c.id
+		where 1=1
+		<if test="name != null and name !=''">
+			and b.username = #{name,jdbcType=VARCHAR}
+		</if>
+		<if test="province != null">
+			and b.province = #{province,jdbcType=INTEGER}
+		</if>
+		<if test="city != null">
+			and b.city = #{province,city=INTEGER}
+		</if>
+		<if test="province != null">
+			and b.area = #{area,jdbcType=INTEGER}
+		</if>
+		<if test="industry != null">
+			and b.industry = #{industry,jdbcType=INTEGER}
+		</if>
+		<if test="expert != null">
+			and b.expert = #{expert,jdbcType=INTEGER}
+		</if>
+		<if test="celebrity != null">
+			and b.celebrity = #{celebrity,jdbcType=INTEGER}
+		</if>
+	</select>
+	<select id="selectPersonalCustomerCount" resultType="java.lang.Integer">
+		select
+		count(0)
+		from
+		(select
+		id
+		from user
+		where type = 0
+		<if test="aid != null and aid !=''">
+			and aid = #{aid,jdbcType=VARCHAR}
+		</if>
+		<if test="shareType != null">
+			and share_type = #{shareType,jdbcType=VARCHAR}
+		</if>
+		<if test="status != null">
+			and status = #{status,jdbcType=INTEGER}
+		</if>
+		<if test="serviceCertification != null">
+			and service_certification = #{serviceCertification,jdbcType=INTEGER}
+		</if>
+		<if test="userCertification != null">
+			and user_certification = #{userCertification,jdbcType=INTEGER}
+		</if>
+		<if test="currentMemberStatus != null">
+			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+		</if>
+		<if test="startDate != null and startDate != ''">
+			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="endDate != null and endDate != ''">
+			and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		)as a inner join organization_identity b on a.id = b.uid
+		where 1=1
+		<if test="name != null and name !=''">
+			and b.unit_name = #{name,jdbcType=VARCHAR}
+		</if>
+		<if test="province != null">
+			and b.location_province = #{province,jdbcType=INTEGER}
+		</if>
+		<if test="city != null">
+			and b.location_city = #{province,city=INTEGER}
+		</if>
+		<if test="province != null">
+			and b.location_area = #{area,jdbcType=INTEGER}
+		</if>
+		<if test="industry != null">
+			and b.industry = #{industry,jdbcType=INTEGER}
+		</if>
+		<if test="expert != null">
+			and b.expert = #{expert,jdbcType=INTEGER}
+		</if>
+		<if test="celebrity != null">
+			and b.celebrity = #{celebrity,jdbcType=INTEGER}
+		</if>
+	</select>
+	<select id="selectOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
+		select
+		a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d
+		%H:%i:%s') as createTime,a.service_certification as
+		serviceCertification,
+		a.user_certification as userCertification,a.current_member_status as
+		currentMemberStatus,a.identify_name as name,a.lvl,
+		b.contacts,b.contact_mobile as contactMobile,b.international,b.listed,b.high_tech_zone as highTechZone,
+		dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
+		from
+		(select
+		id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
+		from user
+		where type = 1
+		<if test="aid != null and aid !=''">
+			and aid = #{aid,jdbcType=VARCHAR}
+		</if>
+		<if test="shareType != null">
+			and share_type = #{shareType,jdbcType=VARCHAR}
+		</if>
+		<if test="status != null">
+			and status = #{status,jdbcType=INTEGER}
+		</if>
+		<if test="serviceCertification != null">
+			and service_certification = #{serviceCertification,jdbcType=INTEGER}
+		</if>
+		<if test="userCertification != null">
+			and user_certification = #{userCertification,jdbcType=INTEGER}
+		</if>
+		<if test="currentMemberStatus != null">
+			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+		</if>
+		<if test="startDate != null and startDate != ''">
+			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="endDate != null and endDate != ''">
+			and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		)as a inner join organization_identity b on a.id = b.uid
+		left join district_glossory dg1 on b.location_province = dg1.id
+		left join district_glossory dg2 on b.location_city = dg2.id
+		left join district_glossory dg3 on b.location_area = dg3.id
+		left join industry_category c on b.industry = c.id
+		where 1=1
+		<if test="name != null and name != ''">
+			and b.unit_name = #{name,jdbcType=VARCHAR}
+		</if>
+		<if test="province != null">
+			and b.location_province = #{province,jdbcType=INTEGER}
+		</if>
+		<if test="city != null">
+			and b.location_city = #{province,city=INTEGER}
+		</if>
+		<if test="province != null">
+			and b.location_area = #{area,jdbcType=INTEGER}
+		</if>
+		<if test="industry != null">
+			and b.industry = #{industry,jdbcType=INTEGER}
+		</if>
+		<if test="listed != null">
+			and b.listed = #{listed,jdbcType=INTEGER}
+		</if>
+		<if test="highTechZone != null">
+			and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
+		</if>
+	</select>
+	<select id="selectOrganizationCustomerCount" resultType="java.lang.Integer">
+		select
+		count(0)
+		from
+		(select
+		id
+		from user
+		where type = 1
+		<if test="aid != null and aid !=''">
+			and aid = #{aid,jdbcType=VARCHAR}
+		</if>
+		<if test="shareType != null">
+			and share_type = #{shareType,jdbcType=VARCHAR}
+		</if>
+		<if test="status != null">
+			and status = #{status,jdbcType=INTEGER}
+		</if>
+		<if test="serviceCertification != null">
+			and service_certification = #{serviceCertification,jdbcType=INTEGER}
+		</if>
+		<if test="userCertification != null">
+			and user_certification = #{userCertification,jdbcType=INTEGER}
+		</if>
+		<if test="currentMemberStatus != null">
+			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+		</if>
+		<if test="startDate != null and startDate != ''">
+			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		<if test="endDate != null and endDate != ''">
+			and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+		</if>
+		)as a inner join organization_identity b on a.id = b.uid
+		where 1=1
+		<if test="name != null and name !=''">
+			and b.unit_name = #{name,jdbcType=VARCHAR}
+		</if>
+		<if test="province != null">
+			and b.location_province = #{province,jdbcType=INTEGER}
+		</if>
+		<if test="city != null">
+			and b.location_city = #{province,city=INTEGER}
+		</if>
+		<if test="province != null">
+			and b.location_area = #{area,jdbcType=INTEGER}
+		</if>
+		<if test="industry != null">
+			and b.industry = #{industry,jdbcType=INTEGER}
+		</if>
+		<if test="listed != null">
+			and b.listed = #{listed,jdbcType=INTEGER}
+		</if>
+		<if test="highTechZone != null">
+			and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
+		</if>
+	</select>
+	
+	<select id="findCustomerByName" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
+		select id,name from user where name like
+		concat('%',#{identify_name},'%')
 	</select>
-	<select id="selectCustomerCount" resultType="java.lang.Integer">
-		<choose>
-			<when test="type == 0">
-				select  
-					count(0)
-				from 
-					(select 
-						id
-					from user
-						where type = 0 
-						<if test="aid != null and aid !=''">
-							and aid = #{aid,jdbcType=VARCHAR}
-						</if>	
-						<if test="shareType != null">
-							and share_type = #{shareType,jdbcType=VARCHAR}
-						</if>				
-						<if test="status != null">
-							and status = #{status,jdbcType=INTEGER}
-						</if>
-						<if test="serviceCertification != null">
-							and service_certification = #{serviceCertification,jdbcType=INTEGER}
-						</if>
-						<if test="userCertification != null">
-							and user_certification = #{userCertification,jdbcType=INTEGER}
-						</if>
-						<if test="currentMemberStatus != null">
-							and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
-						</if>
-						<if test="startDate != null and startDate != ''">
-					   	 	and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
-					   	</if>
-					   	<if test="endDate != null and endDate != ''">
-					   	 	and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
-					   	</if>
-					)as a inner join user_identity b on a.id = b.uid 	
-				where 1=1
-				<if test="name != null and name !=''">
-					and b.username = #{name,jdbcType=VARCHAR}
-				</if>
-				<if test="province != null">
-					and b.province = #{province,jdbcType=INTEGER}
-				</if>
-				<if test="city != null">
-					and b.city = #{province,city=INTEGER}
-				</if>
-				<if test="province != null">
-					and b.area = #{area,jdbcType=INTEGER}
-				</if>
-				<if test="industry != null">
-					and b.industry = #{industry,jdbcType=INTEGER}
-				</if>
-			</when>
-			<when test="type == 1">
-				select  
-					count(0)
-				from 
-					(select 
-						id
-					from user
-						where type = 1
-						<if test="aid != null and aid !=''">
-							and aid = #{aid,jdbcType=VARCHAR}
-						</if>		
-						<if test="shareType != null">
-							and share_type = #{shareType,jdbcType=VARCHAR}
-						</if>		
-						<if test="status != null">
-							and status = #{status,jdbcType=INTEGER}
-						</if>
-						<if test="serviceCertification != null">
-							and service_certification = #{serviceCertification,jdbcType=INTEGER}
-						</if>
-						<if test="userCertification != null">
-							and user_certification = #{userCertification,jdbcType=INTEGER}
-						</if>
-						<if test="currentMemberStatus != null">
-							and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
-						</if>
-						<if test="startDate != null and startDate != ''">
-					   	 	and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
-					   	</if>
-					   	<if test="endDate != null and endDate != ''">
-					   	 	and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
-					   	</if>
-					)as a inner join organization_identity b on a.id = b.uid
-				where 1=1
-				<if test="name != null and name !=''">
-					and b.unit_name = #{name,jdbcType=VARCHAR}
-				</if>
-				<if test="province != null">
-					and b.licence_province = #{province,jdbcType=INTEGER}
-				</if>
-				<if test="city != null">
-					and b.licence_city = #{province,city=INTEGER}
-				</if>
-				<if test="province != null">
-					and b.licence_area = #{area,jdbcType=INTEGER}
-				</if>
-				<if test="industry != null">
-					and b.industry = #{industry,jdbcType=INTEGER}
-				</if>
-			</when>
-			<otherwise>
-				select count(0)
-				from(
-					select  
-						a.id
-					from 
-						(select 
-							id
-						from user
-							where type = 0 
-							<if test="aid != null and aid !=''">
-								and aid = #{aid,jdbcType=VARCHAR}
-							</if>	
-							<if test="shareType != null">
-								and share_type = #{shareType,jdbcType=VARCHAR}
-							</if>				
-							<if test="status != null">
-								and status = #{status,jdbcType=INTEGER}
-							</if>
-							<if test="serviceCertification != null">
-								and service_certification = #{serviceCertification,jdbcType=INTEGER}
-							</if>
-							<if test="userCertification != null">
-								and user_certification = #{userCertification,jdbcType=INTEGER}
-							</if>
-							<if test="currentMemberStatus != null">
-								and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
-							</if>
-							<if test="startDate != null and startDate != ''">
-						   	 	and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
-						   	</if>
-						   	<if test="endDate != null and endDate != ''">
-						   	 	and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
-						   	</if>
-						)as a inner join user_identity b on a.id = b.uid 	
-					where 1=1
-					<if test="name != null and name !=''">
-						and b.username = #{name,jdbcType=VARCHAR}
-					</if>
-					<if test="province != null">
-						and b.province = #{province,jdbcType=INTEGER}
-					</if>
-					<if test="city != null">
-						and b.city = #{province,city=INTEGER}
-					</if>
-					<if test="province != null">
-						and b.area = #{area,jdbcType=INTEGER}
-					</if>
-					<if test="industry != null">
-						and b.industry = #{industry,jdbcType=INTEGER}
-					</if>
-					union
-					select  
-						a.id
-					from 
-						(select 
-							id
-						from user
-							where type = 1
-							<if test="aid != null and aid !=''">
-								and aid = #{aid,jdbcType=VARCHAR}
-							</if>	
-							<if test="shareType != null">
-								and share_type = #{shareType,jdbcType=VARCHAR}
-							</if>				
-							<if test="status != null">
-								and status = #{status,jdbcType=INTEGER}
-							</if>
-							<if test="serviceCertification != null">
-								and service_certification = #{serviceCertification,jdbcType=INTEGER}
-							</if>
-							<if test="userCertification != null">
-								and user_certification = #{userCertification,jdbcType=INTEGER}
-							</if>
-							<if test="currentMemberStatus != null">
-								and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
-							</if>
-							<if test="startDate != null and startDate != ''">
-						   	 	and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
-						   	</if>
-						   	<if test="endDate != null and endDate != ''">
-						   	 	and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
-						   	</if>
-						)as a inner join organization_identity b on a.id = b.uid
-					where 1=1
-					<if test="name != null and name !=''">
-						and b.unit_name = #{name,jdbcType=VARCHAR}
-					</if>
-					<if test="province != null">
-						and b.licence_province = #{province,jdbcType=INTEGER}
-					</if>
-					<if test="city != null">
-						and b.licence_city = #{province,city=INTEGER}
-					</if>
-					<if test="province != null">
-						and b.licence_area = #{area,jdbcType=INTEGER}
-					</if>
-					<if test="industry != null">
-						and b.industry = #{industry,jdbcType=INTEGER}
-					</if>
-				) x
-			</otherwise>
-		</choose>
+	
+	<select id="judgeCustomerByName" parameterType="java.lang.String" resultType="java.lang.Integer">
+		select count(0) from user where identify_name = #{name,jdbcType=VARCHAR}
 	</select>
 </mapper>

+ 49 - 49
src/main/java/com/goafanti/common/model/OrganizationContactBook.java

@@ -4,74 +4,74 @@ public class OrganizationContactBook {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.id
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.cid
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String cid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.name
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String name;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.sex
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String sex;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.mobile
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String mobile;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.email
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String email;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.qq
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String qq;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.wechat
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String wechat;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.depatrment
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String depatrment;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.customer_position
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String customerPosition;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.tel_num
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String telNum;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.primary_flg
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.major
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
-	private Integer primaryFlg;
+	private Integer major;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.aid
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	private String aid;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.id
 	 * @return  the value of organization_contact_book.id
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getId() {
 		return id;
@@ -80,7 +80,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.id
 	 * @param id  the value for organization_contact_book.id
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setId(String id) {
 		this.id = id;
@@ -89,7 +89,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.cid
 	 * @return  the value of organization_contact_book.cid
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getCid() {
 		return cid;
@@ -98,7 +98,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.cid
 	 * @param cid  the value for organization_contact_book.cid
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setCid(String cid) {
 		this.cid = cid;
@@ -107,7 +107,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.name
 	 * @return  the value of organization_contact_book.name
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getName() {
 		return name;
@@ -116,7 +116,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.name
 	 * @param name  the value for organization_contact_book.name
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setName(String name) {
 		this.name = name;
@@ -125,7 +125,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.sex
 	 * @return  the value of organization_contact_book.sex
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getSex() {
 		return sex;
@@ -134,7 +134,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.sex
 	 * @param sex  the value for organization_contact_book.sex
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setSex(String sex) {
 		this.sex = sex;
@@ -143,7 +143,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.mobile
 	 * @return  the value of organization_contact_book.mobile
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getMobile() {
 		return mobile;
@@ -152,7 +152,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.mobile
 	 * @param mobile  the value for organization_contact_book.mobile
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setMobile(String mobile) {
 		this.mobile = mobile;
@@ -161,7 +161,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.email
 	 * @return  the value of organization_contact_book.email
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getEmail() {
 		return email;
@@ -170,7 +170,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.email
 	 * @param email  the value for organization_contact_book.email
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setEmail(String email) {
 		this.email = email;
@@ -179,7 +179,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.qq
 	 * @return  the value of organization_contact_book.qq
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getQq() {
 		return qq;
@@ -188,7 +188,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.qq
 	 * @param qq  the value for organization_contact_book.qq
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setQq(String qq) {
 		this.qq = qq;
@@ -197,7 +197,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.wechat
 	 * @return  the value of organization_contact_book.wechat
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getWechat() {
 		return wechat;
@@ -206,7 +206,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.wechat
 	 * @param wechat  the value for organization_contact_book.wechat
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setWechat(String wechat) {
 		this.wechat = wechat;
@@ -215,7 +215,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.depatrment
 	 * @return  the value of organization_contact_book.depatrment
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getDepatrment() {
 		return depatrment;
@@ -224,7 +224,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.depatrment
 	 * @param depatrment  the value for organization_contact_book.depatrment
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setDepatrment(String depatrment) {
 		this.depatrment = depatrment;
@@ -233,7 +233,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.customer_position
 	 * @return  the value of organization_contact_book.customer_position
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getCustomerPosition() {
 		return customerPosition;
@@ -242,7 +242,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.customer_position
 	 * @param customerPosition  the value for organization_contact_book.customer_position
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setCustomerPosition(String customerPosition) {
 		this.customerPosition = customerPosition;
@@ -251,7 +251,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.tel_num
 	 * @return  the value of organization_contact_book.tel_num
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getTelNum() {
 		return telNum;
@@ -260,34 +260,34 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.tel_num
 	 * @param telNum  the value for organization_contact_book.tel_num
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setTelNum(String telNum) {
 		this.telNum = telNum;
 	}
 
 	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.primary_flg
-	 * @return  the value of organization_contact_book.primary_flg
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.major
+	 * @return  the value of organization_contact_book.major
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
-	public Integer getPrimaryFlg() {
-		return primaryFlg;
+	public Integer getMajor() {
+		return major;
 	}
 
 	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.primary_flg
-	 * @param primaryFlg  the value for organization_contact_book.primary_flg
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.major
+	 * @param major  the value for organization_contact_book.major
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
-	public void setPrimaryFlg(Integer primaryFlg) {
-		this.primaryFlg = primaryFlg;
+	public void setMajor(Integer major) {
+		this.major = major;
 	}
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.aid
 	 * @return  the value of organization_contact_book.aid
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getAid() {
 		return aid;
@@ -296,7 +296,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.aid
 	 * @param aid  the value for organization_contact_book.aid
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setAid(String aid) {
 		this.aid = aid;

+ 40 - 40
src/main/java/com/goafanti/common/model/OrganizationContactBookExample.java

@@ -6,23 +6,23 @@ import java.util.List;
 public class OrganizationContactBookExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public OrganizationContactBookExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -30,7 +30,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -38,7 +38,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -46,7 +46,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -54,7 +54,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -62,7 +62,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -70,7 +70,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -78,7 +78,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -88,7 +88,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -100,7 +100,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -109,7 +109,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -119,7 +119,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -932,63 +932,63 @@ public class OrganizationContactBookExample {
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgIsNull() {
-			addCriterion("primary_flg is null");
+		public Criteria andMajorIsNull() {
+			addCriterion("major is null");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgIsNotNull() {
-			addCriterion("primary_flg is not null");
+		public Criteria andMajorIsNotNull() {
+			addCriterion("major is not null");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgEqualTo(Integer value) {
-			addCriterion("primary_flg =", value, "primaryFlg");
+		public Criteria andMajorEqualTo(Integer value) {
+			addCriterion("major =", value, "major");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgNotEqualTo(Integer value) {
-			addCriterion("primary_flg <>", value, "primaryFlg");
+		public Criteria andMajorNotEqualTo(Integer value) {
+			addCriterion("major <>", value, "major");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgGreaterThan(Integer value) {
-			addCriterion("primary_flg >", value, "primaryFlg");
+		public Criteria andMajorGreaterThan(Integer value) {
+			addCriterion("major >", value, "major");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgGreaterThanOrEqualTo(Integer value) {
-			addCriterion("primary_flg >=", value, "primaryFlg");
+		public Criteria andMajorGreaterThanOrEqualTo(Integer value) {
+			addCriterion("major >=", value, "major");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgLessThan(Integer value) {
-			addCriterion("primary_flg <", value, "primaryFlg");
+		public Criteria andMajorLessThan(Integer value) {
+			addCriterion("major <", value, "major");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgLessThanOrEqualTo(Integer value) {
-			addCriterion("primary_flg <=", value, "primaryFlg");
+		public Criteria andMajorLessThanOrEqualTo(Integer value) {
+			addCriterion("major <=", value, "major");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgIn(List<Integer> values) {
-			addCriterion("primary_flg in", values, "primaryFlg");
+		public Criteria andMajorIn(List<Integer> values) {
+			addCriterion("major in", values, "major");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgNotIn(List<Integer> values) {
-			addCriterion("primary_flg not in", values, "primaryFlg");
+		public Criteria andMajorNotIn(List<Integer> values) {
+			addCriterion("major not in", values, "major");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgBetween(Integer value1, Integer value2) {
-			addCriterion("primary_flg between", value1, value2, "primaryFlg");
+		public Criteria andMajorBetween(Integer value1, Integer value2) {
+			addCriterion("major between", value1, value2, "major");
 			return (Criteria) this;
 		}
 
-		public Criteria andPrimaryFlgNotBetween(Integer value1, Integer value2) {
-			addCriterion("primary_flg not between", value1, value2, "primaryFlg");
+		public Criteria andMajorNotBetween(Integer value1, Integer value2) {
+			addCriterion("major not between", value1, value2, "major");
 			return (Criteria) this;
 		}
 
@@ -1065,7 +1065,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table organization_contact_book
-	 * @mbg.generated  Fri Nov 10 19:10:10 CST 2017
+	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
 	 */
 	public static class Criterion {
 		private String condition;

+ 22 - 0
src/main/java/com/goafanti/customer/bo/CustomerListIn.java

@@ -62,6 +62,12 @@ public class CustomerListIn {
 	/** 营销员 ID **/
 	private String aid;
 	
+	/** 是否上市 **/
+	private String listed;
+	
+	/** 是否属于高新 **/
+	private String highTechZone;
+	
 	public String getType() {
 		return type;
 	}
@@ -222,4 +228,20 @@ public class CustomerListIn {
 		this.aid = aid;
 	}
 
+	public String getListed() {
+		return listed;
+	}
+
+	public void setListed(String listed) {
+		this.listed = listed;
+	}
+
+	public String getHighTechZone() {
+		return highTechZone;
+	}
+
+	public void setHighTechZone(String highTechZone) {
+		this.highTechZone = highTechZone;
+	}
+
 }

+ 3 - 155
src/main/java/com/goafanti/customer/bo/CustomerListOut.java

@@ -1,60 +1,18 @@
 package com.goafanti.customer.bo;
 
-public class CustomerListOut {
+public class CustomerListOut extends CustomerListIn{
 	/** 客户ID **/
 	private String uid;
 	
-	/** 客户类型  0-个人 1-单位**/
-	private String type;
-	
-	/** 客户名称 **/
-	private String name;
-	
-	/** 客户状态  0-正常 1-注销 2-锁定**/
-	private String status;
-	
-	/** 省份 **/
-	private String province;
-	
-	/** 城市 **/
-	private String city;
-	
-	/** 区域 **/
-	private String area;
-	
 	/** 联系人 **/
 	private String contacts;
 	
 	/** 联系电话 **/
 	private String contactMobile;
 	
-	/** 行业 **/
-	private String industry;
-	
 	/** 创建时间 **/
 	private String createTime;
-	
-	/** 业务认证 0-未认证 1-已认证  **/
-	private String serviceCertification; 
-	
-	/** 实名认证 0-未认证  1-已认证 **/
-	private String userCertification;
-	
-	/** 当前会员状态 0-普通用户 1-会员 2-会员过期 **/
-	private String currentMemberStatus;
-	
-	/** 是否国际化 0-否 1-是 **/
-	private String international;
-	
-	/** 是否是专家 0-否 1-是 **/
-	private String expert;
-	
-	/** 是否是明星 0-否 1-是 **/
-	private String celebrity;
 
-	/** 会员等级 **/
-	private String lvl;
-	
 	public String getUid() {
 		return uid;
 	}
@@ -63,54 +21,6 @@ public class CustomerListOut {
 		this.uid = uid;
 	}
 
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getStatus() {
-		return status;
-	}
-
-	public void setStatus(String status) {
-		this.status = status;
-	}
-
-	public String getProvince() {
-		return province;
-	}
-
-	public void setProvince(String province) {
-		this.province = province;
-	}
-
-	public String getCity() {
-		return city;
-	}
-
-	public void setCity(String city) {
-		this.city = city;
-	}
-
-	public String getArea() {
-		return area;
-	}
-
-	public void setArea(String area) {
-		this.area = area;
-	}
-
 	public String getContacts() {
 		return contacts;
 	}
@@ -127,14 +37,6 @@ public class CustomerListOut {
 		this.contactMobile = contactMobile;
 	}
 
-	public String getIndustry() {
-		return industry;
-	}
-
-	public void setIndustry(String industry) {
-		this.industry = industry;
-	}
-
 	public String getCreateTime() {
 		return createTime;
 	}
@@ -142,60 +44,6 @@ public class CustomerListOut {
 	public void setCreateTime(String createTime) {
 		this.createTime = createTime;
 	}
-
-	public String getServiceCertification() {
-		return serviceCertification;
-	}
-
-	public void setServiceCertification(String serviceCertification) {
-		this.serviceCertification = serviceCertification;
-	}
-
-	public String getUserCertification() {
-		return userCertification;
-	}
-
-	public void setUserCertification(String userCertification) {
-		this.userCertification = userCertification;
-	}
-
-	public String getCurrentMemberStatus() {
-		return currentMemberStatus;
-	}
-
-	public void setCurrentMemberStatus(String currentMemberStatus) {
-		this.currentMemberStatus = currentMemberStatus;
-	}
-
-	public String getInternational() {
-		return international;
-	}
-
-	public void setInternational(String international) {
-		this.international = international;
-	}
-
-	public String getExpert() {
-		return expert;
-	}
-
-	public void setExpert(String expert) {
-		this.expert = expert;
-	}
-
-	public String getCelebrity() {
-		return celebrity;
-	}
-
-	public void setCelebrity(String celebrity) {
-		this.celebrity = celebrity;
-	}
-
-	public String getLvl() {
-		return lvl;
-	}
-
-	public void setLvl(String lvl) {
-		this.lvl = lvl;
-	}
+	
+	
 }

+ 18 - 0
src/main/java/com/goafanti/customer/bo/CustomerSimpleBo.java

@@ -0,0 +1,18 @@
+package com.goafanti.customer.bo;
+
+public class CustomerSimpleBo {
+	private String id;
+	private String name;
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+}

+ 53 - 12
src/main/java/com/goafanti/customer/controller/CustomerController.java

@@ -17,27 +17,68 @@ public class CustomerController extends BaseController{
 	@Resource
 	private CustomerService customerService;
 	
-	/** 个人客户列表 **/
-	@RequestMapping(value = "/listPrivateCustomer" , method = RequestMethod.POST)
-	public Result listPrivateCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
+	/** 私有个人客户列表 **/
+	@RequestMapping(value = "/listPrivatePersonalCustomer" , method = RequestMethod.POST)
+	public Result listPrivatePersonalCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
 		Result res = new Result();
-		res.setData(customerService.listPrivateCustomer(cli, pageNo, pageSize));
+		res.setData(customerService.listPrivatePersonalCustomer(cli, pageNo, pageSize));
 		return res;
 	}
 	
-	/** 公共客户列表 **/
-	@RequestMapping(value = "/listPublicCustomer" , method = RequestMethod.POST)
-	public Result listPublicCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
+	/** 公共个人客户列表 **/
+	@RequestMapping(value = "/listPublicPersonalCustomer" , method = RequestMethod.POST)
+	public Result listPublicPersonalCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
 		Result res = new Result();
-		res.setData(customerService.listPrivateCustomer(cli, pageNo, pageSize));
+		res.setData(customerService.listPublicPersonalCustomer(cli, pageNo, pageSize));
+		return res;
+	}
+
+	/** 个人客户查询 **/
+	@RequestMapping(value = "/listAllPersonalCustomer" , method = RequestMethod.POST)
+	public Result listAllPersonalCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(customerService.listAllPersonalCustomer(cli, pageNo, pageSize));
+		return res;
+	}
+	
+	/** 私有单位客户列表 **/
+	@RequestMapping(value = "/listPrivateOrganizationCustomer" , method = RequestMethod.POST)
+	public Result listPrivateOrganizationCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(customerService.listPrivateOrganizationCustomer(cli, pageNo, pageSize));
+		return res;
+	}
+	
+	/** 公共单位客户列表 **/
+	@RequestMapping(value = "/listPublicOrganizationCustomer" , method = RequestMethod.POST)
+	public Result listPublicOrganizationCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(customerService.listPublicOrganizationCustomer(cli, pageNo, pageSize));
+		return res;
+	}
+
+	/** 单位客户查询 **/
+	@RequestMapping(value = "/listAllOrganizationCustomer" , method = RequestMethod.POST)
+	public Result listAllOrganizationCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(customerService.listAllOrganizationCustomer(cli, pageNo, pageSize));
+		return res;
+	}
+	
+	
+	/** 客户即时检索 **/
+	@RequestMapping(value = "/findCustomerByName",method = RequestMethod.GET)
+	public Result findCustomerByName(String name){
+		Result res = new Result();
+		res.setData(customerService.findCustomerByName(name));
 		return res;
 	}
 	
-	/** 客户查询 **/
-	@RequestMapping(value = "/listAllCustomer" , method = RequestMethod.POST)
-	public Result listAllCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
+	/** 添加客户基本信息  **/
+	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
+	public Result addCustomer(String name,String contacts,String contactMobile,String type){
 		Result res = new Result();
-		res.setData(customerService.listPrivateCustomer(cli, pageNo, pageSize));
+		customerService.addCustomer(name, contacts, contactMobile, Integer.parseInt(type));
 		return res;
 	}
 }

+ 64 - 6
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -1,35 +1,93 @@
 package com.goafanti.customer.service;
 
+import java.util.List;
+
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.CustomerListIn;
 import com.goafanti.customer.bo.CustomerListOut;
+import com.goafanti.customer.bo.CustomerSimpleBo;
 
 public interface CustomerService {
 	/**
-	 * 个人客户列表查询
+	 * 私有个人客户列表查询
+	 * @param cin
+	 * @param pageSize
+	 * @param pageNumber
+	 * @return
+	 */
+	
+	public Pagination<CustomerListOut> listPrivatePersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
+	/**
+	 * 公共个人客户列表查询
+	 * @param cin
+	 * @param pageSize
+	 * @param pageNumber
+	 * @return
+	 */
+	public Pagination<CustomerListOut> listPublicPersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
+	
+	
+	/**
+	 * 所有个人客户列表查询
+	 * @param cin
+	 * @param pageSize
+	 * @param pageNumber
+	 * @return
+	 */
+	public Pagination<CustomerListOut> listAllPersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
+	
+	/**
+	 * 私有单位客户列表查询
 	 * @param cin
 	 * @param pageSize
 	 * @param pageNumber
 	 * @return
 	 */
-	public Pagination<CustomerListOut> listPrivateCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
+	public Pagination<CustomerListOut> listPrivateOrganizationCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
 	
 	/**
-	 * 公共客户列表查询
+	 * 公共单位客户列表查询
 	 * @param cin
 	 * @param pageSize
 	 * @param pageNumber
 	 * @return
 	 */
-	public Pagination<CustomerListOut> listPublicCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
+	public Pagination<CustomerListOut> listPublicOrganizationCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
 	
 	
 	/**
-	 * 所有客户列表查询
+	 * 所有单位客户列表查询
 	 * @param cin
 	 * @param pageSize
 	 * @param pageNumber
 	 * @return
 	 */
-	public Pagination<CustomerListOut> listAllCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
+	public Pagination<CustomerListOut> listAllOrganizationCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
+	
+	
+	
+	/**
+	 * 使用客户名检索客户
+	 * @param name 客户名称
+	 * @return
+	 */
+	public List<CustomerSimpleBo> findCustomerByName(String name);
+	
+	/**
+	 * 判断是否存在某个单位客户
+	 * @param name
+	 * @return
+	 */
+	public int judgeCustomerByName(String name);
+	
+	/**
+	 * 
+	 * @param name 客户名
+	 * @param contacts 联系人
+	 * @param contactMobile 联系电话
+	 * @param type 客户类型
+	 * @return
+	 */
+	public int addCustomer(String name,String contacts,String contactMobile,Integer type);
+
 }

+ 145 - 11
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -1,45 +1,103 @@
 package com.goafanti.customer.service.impl;
 
+import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.OrganizationContactBookMapper;
+import com.goafanti.common.dao.OrganizationIdentityMapper;
+import com.goafanti.common.dao.UserIdentityMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.OrganizationContactBook;
+import com.goafanti.common.model.OrganizationIdentity;
+import com.goafanti.common.model.User;
+import com.goafanti.common.model.UserIdentity;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.CustomerListIn;
 import com.goafanti.customer.bo.CustomerListOut;
+import com.goafanti.customer.bo.CustomerSimpleBo;
 import com.goafanti.customer.service.CustomerService;
 
 @Service
 public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements CustomerService {
+	@Autowired
+	private UserMapper userMapper;
+	@Autowired
+	private UserIdentityMapper userIdentityMapper;
+	@Autowired
+	private OrganizationIdentityMapper organizationIdentityMapper;
+	@Autowired
+	private OrganizationContactBookMapper organizationContactBookMapper;
+	@Override
+	public Pagination<CustomerListOut> listPrivatePersonalCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
+		cli.setType(AFTConstants.USER_TYPE_PERSONAL);
+		cli.setAid(TokenManager.getAdminId());
+		cli.setShareType(AFTConstants.SHARE_TYPE_PRIVATE);
+		Map<String,Object> params = disposeParams(cli);
+		@SuppressWarnings("unchecked")
+		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPersonalCustomerList","selectPersonalCustomerCount",params,pageNo,pageSize);
+		return list;
+	}
+
+	@Override
+	public Pagination<CustomerListOut> listPublicPersonalCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
+		cli.setType(AFTConstants.USER_TYPE_PERSONAL);
+		cli.setAid(TokenManager.getAdminId());
+		cli.setShareType(AFTConstants.SHARE_TYPE_PUBLIC);
+		Map<String,Object> params = disposeParams(cli);
+		@SuppressWarnings("unchecked")
+		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPersonalCustomerList","selectPersonalCustomerCount",params,pageNo,pageSize);
+		return list;
+	}
 
 	@Override
-	public Pagination<CustomerListOut> listPrivateCustomer(CustomerListIn cin, Integer pageNo, Integer pageSize) {
-		cin.setAid(TokenManager.getAdminId());
-		Map<String,Object> params = disposeParams(cin);
+	public Pagination<CustomerListOut> listAllPersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize) {
+		cli.setType(AFTConstants.USER_TYPE_PERSONAL);
+		Map<String,Object> params = disposeParams(cli);
 		@SuppressWarnings("unchecked")
-		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectCustomerList","selectCustomerCount",params,pageNo,pageSize);
+		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPersonalCustomerList","selectPersonalCustomerCount",params,pageNo,pageSize);
 		return list;
 	}
 
 	@Override
-	public Pagination<CustomerListOut> listPublicCustomer(CustomerListIn cin, Integer pageNo, Integer pageSize) {
-		cin.setShareType("1");
-		Map<String,Object> params = disposeParams(cin);
+	public Pagination<CustomerListOut> listPrivateOrganizationCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
+		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
+		cli.setAid(TokenManager.getAdminId());
+		cli.setShareType(AFTConstants.SHARE_TYPE_PRIVATE);
+		Map<String,Object> params = disposeParams(cli);
 		@SuppressWarnings("unchecked")
-		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectCustomerList","selectCustomerCount",params,pageNo,pageSize);
+		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectOrganizationCustomerList","selectOrganizationCustomerCount",params,pageNo,pageSize);
 		return list;
 	}
 
 	@Override
-	public Pagination<CustomerListOut> listAllCustomer(CustomerListIn cin, Integer pageNo, Integer pageSize) {
-		Map<String,Object> params = disposeParams(cin);
+	public Pagination<CustomerListOut> listPublicOrganizationCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
+		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
+		cli.setAid(TokenManager.getAdminId());
+		cli.setShareType(AFTConstants.SHARE_TYPE_PUBLIC);
+		Map<String,Object> params = disposeParams(cli);
 		@SuppressWarnings("unchecked")
-		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectCustomerList","selectCustomerCount",params,pageNo,pageSize);
+		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectOrganizationCustomerList","selectOrganizationCustomerCount",params,pageNo,pageSize);
+		return list;
+	}
+
+	@Override
+	public Pagination<CustomerListOut> listAllOrganizationCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
+		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
+		Map<String,Object> params = disposeParams(cli);
+		@SuppressWarnings("unchecked")
+		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectOrganizationCustomerList","selectOrganizationCustomerCount",params,pageNo,pageSize);
 		return list;
 	}
 
@@ -62,9 +120,85 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		if(StringUtils.isNotBlank(cli.getUserCertification())) params.put("userCertification", Integer.parseInt(cli.getUserCertification()));
 		if(StringUtils.isNotBlank(cli.getCurrentMemberStatus())) params.put("currentMemberStatus", Integer.parseInt(cli.getUserCertification()));
 		if(StringUtils.isNotBlank(cli.getLvl())) params.put("lvl", Integer.parseInt(cli.getLvl()));
+		if(StringUtils.isNotBlank(cli.getListed())) params.put("listed", Integer.parseInt(cli.getListed()));
+		if(StringUtils.isNotBlank(cli.getHighTechZone())) params.put("highTechZone", Integer.parseInt(cli.getHighTechZone()));
 		if(StringUtils.isNotBlank(cli.getAid())) params.put("aid", cli.getAid());
 		if(StringUtils.isNotBlank(cli.getStartDate())) params.put("startDate", cli.getStartDate()+" 00:00:00");
 		if(StringUtils.isNotBlank(cli.getEndDate())) params.put("endDate", cli.getEndDate()+" 23:59:59");
 		return params;
 	}
+
+	@Override
+	public List<CustomerSimpleBo> findCustomerByName(String name) {		
+		return userMapper.findCustomerByName(name);
+	}
+
+	@Override
+	public int judgeCustomerByName(String name) {
+		return userMapper.judgeCustomerByName(name);
+	}
+
+	@Override
+	@Transactional
+	public int addCustomer(String name, String contacts, String contactMobile, Integer type){
+		User user = new User();
+		Date now = new Date();
+		String uid = UUID.randomUUID().toString();
+		String identifyId = UUID.randomUUID().toString();
+		user.setId(uid);
+		user.setIdentifyName(name);
+		user.setSource(1);
+		user.setNickname(name);
+		user.setStatus(0);
+		user.setShareType(0);
+		user.setServiceCertification(0);
+		user.setUserCertification(0);
+		user.setAid(TokenManager.getAdminId());
+		user.setType(type);
+		user.setCurrentMemberStatus(0);
+		user.setLvl(0);
+		user.setCreateTime(now);
+		user.setUpdateTime(now);
+		user.setMobile(contactMobile);
+		user.setPassword(AFTConstants.INITIALPASSWORD);
+		if(type == 0){
+			UserIdentity ui = new UserIdentity();
+			ui.setId(identifyId);
+			ui.setUid(uid);
+			ui.setContacts(contacts);
+			ui.setContactMobile(contactMobile);
+			ui.setUsername(name);
+			ui.setExpert(0);
+			ui.setCelebrity(0);
+			ui.setInternational(0);
+			ui.setAuditStatus(0);
+			userIdentityMapper.insert(ui);
+		}else if(type == 1){
+			if(userMapper.judgeCustomerByName(name)>1) throw new BusinessException("该客户已存在");
+			// 创建企业认证信息
+			OrganizationIdentity oi = new OrganizationIdentity();
+			oi.setUnitName(name);
+			oi.setId(identifyId);
+			oi.setUid(uid);
+			oi.setContacts(contacts);
+			oi.setContactMobile(contactMobile);
+			oi.setHighTechZone(0);
+			oi.setInternational(0);
+			oi.setListed(0);
+			oi.setAuditStatus(0);
+			organizationIdentityMapper.insert(oi);
+			//新增企业联系人
+			OrganizationContactBook cob = new OrganizationContactBook();
+			cob.setAid(TokenManager.getAdminId());
+			cob.setId(UUID.randomUUID().toString());
+			cob.setCid(identifyId);
+			cob.setName(contacts);
+			cob.setMobile(contactMobile);
+			organizationContactBookMapper.insert(cob);
+		}
+		userMapper.insert(user);
+		
+		return 0;
+	}
+	
 }

+ 0 - 1
src/main/java/com/goafanti/user/service/OrganizationIdentityService.java

@@ -7,7 +7,6 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.model.OrgHumanResource;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.portal.bo.InternationalListBo;
 import com.goafanti.portal.bo.OrgSubscriberListBo;
 import com.goafanti.user.bo.AuditorOrgIdentityDetailBo;
 import com.goafanti.user.bo.OrgBasicInfoBo;