wanghui 8 years ago
parent
commit
4e7dda201a

+ 18 - 172
src/main/java/com/goafanti/common/mapper/CustomerMapper.xml

@@ -4,7 +4,7 @@
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.Customer">
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="aid" jdbcType="VARCHAR" property="aid" />
-    <result column="company_nmae" jdbcType="VARCHAR" property="companyName" />
+    <result column="company_name" jdbcType="VARCHAR" property="companyName" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="company_industry" jdbcType="VARCHAR" property="companyIndustry" />
     <result column="company_intention" jdbcType="VARCHAR" property="companyIntention" />
@@ -83,42 +83,28 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, aid, company_nmae, create_time, company_industry, company_intention, adress, 
+    id, aid, company_name, create_time, company_industry, company_intention, adress, 
     customer_name, customer_position, mobile, email, department, qq, wechat, remark, 
     province, fllow_situation, sex, customer_statue
   </sql>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.CustomerExample" resultMap="BaseResultMap">
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from customer
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
+  
+  <!-- 查询单个客户信息 -->
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />
     from customer
     where id = #{id,jdbcType=VARCHAR}
   </select>
+  
+   <!-- 删除用户 -->
   <update id="deleteByPrimaryKey" parameterType="java.lang.String">
     update  customer set delete_flg= 1
     where id = #{id,jdbcType=VARCHAR}
   </update>
-  <delete id="deleteByExample" parameterType="java.lang.String">
-    delete from customer
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
+  
+   <!-- 新增客户 -->
   <insert id="insertCustomer" parameterType="com.goafanti.common.model.Customer">
-    insert into customer (id, aid, company_nmae, 
+    insert into customer (id, aid, company_name, 
       create_time, company_industry, company_intention, 
       adress, customer_name, customer_position, 
       mobile, email, department, 
@@ -133,6 +119,7 @@
       #{province,jdbcType=VARCHAR}, #{fllowSituation,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER}, 
       #{customerStatue,jdbcType=VARCHAR}, #{customerTyp,jdbcType=INTEGER}, #{telNum,jdbcType=VARCHAR},0,0)
   </insert>
+  
   <insert id="insertSelective" parameterType="com.goafanti.common.model.Customer">
     insert into customer
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -143,7 +130,7 @@
         aid,
       </if>
       <if test="companyName != null">
-        company_nmae,
+        company_name,
       </if>
       <if test="createTime != null">
         create_time,
@@ -254,130 +241,17 @@
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.CustomerExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 10 10:30:05 CST 2017.
-    -->
-    select count(*) from customer
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 10 10:30:05 CST 2017.
-    -->
-    update customer
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=VARCHAR},
-      </if>
-      <if test="record.aid != null">
-        aid = #{record.aid,jdbcType=VARCHAR},
-      </if>
-      <if test="record.companyName != null">
-        company_nmae = #{record.companyName,jdbcType=VARCHAR},
-      </if>
-      <if test="record.createTime != null">
-        create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.companyIndustry != null">
-        company_industry = #{record.companyIndustry,jdbcType=VARCHAR},
-      </if>
-      <if test="record.companyIntention != null">
-        company_intention = #{record.companyIntention,jdbcType=VARCHAR},
-      </if>
-      <if test="record.adress != null">
-        adress = #{record.adress,jdbcType=VARCHAR},
-      </if>
-      <if test="record.customerName != null">
-        customer_name = #{record.customerName,jdbcType=VARCHAR},
-      </if>
-      <if test="record.customerPosition != null">
-        customer_position = #{record.customerPosition,jdbcType=VARCHAR},
-      </if>
-      <if test="record.mobile != null">
-        mobile = #{record.mobile,jdbcType=VARCHAR},
-      </if>
-      <if test="record.email != null">
-        email = #{record.email,jdbcType=VARCHAR},
-      </if>
-      <if test="record.department != null">
-        department = #{record.department,jdbcType=VARCHAR},
-      </if>
-      <if test="record.qq != null">
-        qq = #{record.qq,jdbcType=VARCHAR},
-      </if>
-      <if test="record.wechat != null">
-        wechat = #{record.wechat,jdbcType=VARCHAR},
-      </if>
-      <if test="record.remark != null">
-        remark = #{record.remark,jdbcType=VARCHAR},
-      </if>
-      <if test="record.province != null">
-        province = #{record.province,jdbcType=VARCHAR},
-      </if>
-      <if test="record.fllowSituation != null">
-        fllow_situation = #{record.fllowSituation,jdbcType=VARCHAR},
-      </if>
-      <if test="record.sex != null">
-        sex = #{record.sex,jdbcType=INTEGER},
-      </if>
-      <if test="record.customerStatue != null">
-        customer_statue = #{record.customerStatue,jdbcType=VARCHAR},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 10 10:30:05 CST 2017.
-    -->
-    update customer
-    set id = #{record.id,jdbcType=VARCHAR},
-      aid = #{record.aid,jdbcType=VARCHAR},
-      company_nmae = #{record.companyName,jdbcType=VARCHAR},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      company_industry = #{record.companyIndustry,jdbcType=VARCHAR},
-      company_intention = #{record.companyIntention,jdbcType=VARCHAR},
-      adress = #{record.adress,jdbcType=VARCHAR},
-      customer_name = #{record.customerName,jdbcType=VARCHAR},
-      customer_position = #{record.customerPosition,jdbcType=VARCHAR},
-      mobile = #{record.mobile,jdbcType=VARCHAR},
-      email = #{record.email,jdbcType=VARCHAR},
-      department = #{record.department,jdbcType=VARCHAR},
-      qq = #{record.qq,jdbcType=VARCHAR},
-      wechat = #{record.wechat,jdbcType=VARCHAR},
-      remark = #{record.remark,jdbcType=VARCHAR},
-      province = #{record.province,jdbcType=VARCHAR},
-      fllow_situation = #{record.fllowSituation,jdbcType=VARCHAR},
-      sex = #{record.sex,jdbcType=INTEGER},
-      customer_statue = #{record.customerStatue,jdbcType=VARCHAR}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Customer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 10 10:30:05 CST 2017.
-    -->
+  
+  
+  <!-- 修改客户信息 -->
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Customer">
     update customer
     <set>
       <if test="aid != null">
         aid = #{aid,jdbcType=VARCHAR},
       </if>
       <if test="companyName != null">
-        company_nmae = #{companyName,jdbcType=VARCHAR},
+        company_name = #{companyName,jdbcType=VARCHAR},
       </if>
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -430,38 +304,9 @@
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Customer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 10 10:30:05 CST 2017.
-    -->
-    update customer
-    set aid = #{aid,jdbcType=VARCHAR},
-      company_nmae = #{companyName,jdbcType=VARCHAR},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      company_industry = #{companyIndustry,jdbcType=VARCHAR},
-      company_intention = #{companyIntention,jdbcType=VARCHAR},
-      adress = #{adress,jdbcType=VARCHAR},
-      customer_name = #{customerName,jdbcType=VARCHAR},
-      customer_position = #{customerPosition,jdbcType=VARCHAR},
-      mobile = #{mobile,jdbcType=VARCHAR},
-      email = #{email,jdbcType=VARCHAR},
-      department = #{department,jdbcType=VARCHAR},
-      qq = #{qq,jdbcType=VARCHAR},
-      wechat = #{wechat,jdbcType=VARCHAR},
-      remark = #{remark,jdbcType=VARCHAR},
-      province = #{province,jdbcType=VARCHAR},
-      fllow_situation = #{fllowSituation,jdbcType=VARCHAR},
-      sex = #{sex,jdbcType=INTEGER},
-      customer_statue = #{customerStatue,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-  
-  
-  
   
   
+  <!-- 分页查询客户 -->
   <select id="findSearchCustomerListByPage"  resultType="com.goafanti.common.model.Customer">
   	select 
   		a.id,
@@ -506,6 +351,7 @@
 	
   </select>
   
+  <!-- 分页查询客户 -->
   <select id="findSearchCustomerCount" parameterType="String" resultType="java.lang.Integer">
   	select 
   		count(1)

+ 14 - 3
src/main/java/com/goafanti/common/model/Customer.java

@@ -8,6 +8,10 @@ public class Customer {
 	 */
 	private String id;
 	/**
+	 * 跟单人
+	 */
+	private String adminName;
+	/**
 	 * 获取时间
 	 */
 	private Date createTime;
@@ -22,7 +26,7 @@ public class Customer {
 	/**
 	 * 客户类型
 	 */
-	private int customerTyp;
+	private Integer customerTyp;
 	
 	/**
 	 * 行业
@@ -96,6 +100,13 @@ public class Customer {
 	public void setId(String id) {
 		this.id = id;
 	}
+	
+	public String getAdminName() {
+		return adminName;
+	}
+	public void setAdminName(String adminName) {
+		this.adminName = adminName;
+	}
 	public Date getCreateTime() {
 		return createTime;
 	}
@@ -212,10 +223,10 @@ public class Customer {
 		this.telNum = telNum;
 	}
 	
-	public int getCustomerTyp() {
+	public Integer getCustomerTyp() {
 		return customerTyp;
 	}
-	public void setCustomerTyp(int customerTyp) {
+	public void setCustomerTyp(Integer customerTyp) {
 		this.customerTyp = customerTyp;
 	}
 	@Override