Browse Source

客户管理--客户添加

zou_ht 8 years ago
parent
commit
e365e0cf1a

+ 83 - 0
src/main/java/com/goafanti/admin/controller/AdminCustomerApiController.java

@@ -0,0 +1,83 @@
+package com.goafanti.admin.controller;
+
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.goafanti.admin.service.CustomerService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.Customer;
+import com.goafanti.core.shiro.token.TokenManager;
+
+
+
+
+@RestController
+@RequestMapping(value = "/api/admin/customer")
+public class AdminCustomerApiController extends CertifyApiController{
+	
+	@Resource
+	private CustomerService		customerService;
+	/**
+	 * 新增客户
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
+	public Result addCustomer(HttpServletRequest req, String aid) {
+		Customer cus =new Customer();
+		Result res=new Result();
+		cus.setId(UUID.randomUUID().toString());
+		cus.setOwnerId((TokenManager.getUserId()));
+		cus.setCreateTime((Date) req.getAttribute("createTime"));
+		cus.setCompanyName((String) req.getAttribute("companyName"));
+		cus.setCompanyIndustry((String) req.getAttribute("companyIndustry"));
+		cus.setCompanyIntention((String) req.getAttribute("companyIntention"));
+		cus.setAdress((String) req.getAttribute("adress"));
+		cus.setCustomerName((String) req.getAttribute("customerName"));
+		cus.setMobile((String) req.getAttribute("mobile"));
+		cus.setEmail((String) req.getAttribute("email"));
+		cus.setQq((String) req.getAttribute("qq"));
+		cus.setWechat((String) req.getAttribute("wechat"));
+		cus.setCustomerPosition((String) req.getAttribute("customerPosition"));
+		cus.setRemark((String) req.getAttribute("remark"));
+		cus.setProvince((String) req.getAttribute("province"));
+		cus.setFllowSituation((String) req.getAttribute("fllowSituation"));
+		cus.setSex((int) req.getAttribute("sex"));
+		cus.setCustomerStatue((String) req.getAttribute("customerStatue"));
+		cus.setDepartment((String) req.getAttribute("department"));
+		customerService.addCustomer(cus);
+		return res;
+	}
+	
+	/**
+	 * 删除客户信息
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/deleteCustomer", method = RequestMethod.POST)
+	public int deleteCustomer(HttpServletRequest req, String id) {
+		int res = customerService.deleteCustomer(id);
+		return res;
+	}
+	
+	/**
+	 * 查询客户信息
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/SearchCustomerList", method = RequestMethod.POST)
+	public List<Customer> SearchCustomerList() {
+		return null;
+	}
+	
+	
+}

+ 11 - 0
src/main/java/com/goafanti/admin/service/CustomerService.java

@@ -0,0 +1,11 @@
+package com.goafanti.admin.service;
+
+import com.goafanti.common.model.Customer;
+
+public interface CustomerService {
+
+	int addCustomer(Customer cus);
+	
+	int deleteCustomer(String id);
+
+}

+ 24 - 0
src/main/java/com/goafanti/admin/service/impl/CustomerServiceImpl.java

@@ -0,0 +1,24 @@
+package com.goafanti.admin.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.admin.service.CustomerService;
+import com.goafanti.common.dao.CustomerMapper;
+import com.goafanti.common.model.Customer;
+@Service
+public class CustomerServiceImpl implements CustomerService {
+	@Autowired
+	private CustomerMapper customerMapper ;
+	@Override
+	public int addCustomer(Customer cus) {
+		int res = customerMapper.insertCustomer(cus);
+		return res;
+	}
+	@Override
+	public int deleteCustomer(String id) {
+		int res = customerMapper.deleteByPrimaryKey(id);
+		return res;
+	}
+	
+}

+ 75 - 0
src/main/java/com/goafanti/common/dao/CustomerMapper.java

@@ -0,0 +1,75 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.Customer;
+import com.goafanti.common.model.CustomerExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface CustomerMapper {
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	long countByExample(CustomerExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	int deleteByExample(CustomerExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	int deleteByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	int insertCustomer(Customer cus);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	int insertSelective(Customer record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	List<Customer> selectByExample(CustomerExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	Customer selectByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	int updateByExampleSelective(@Param("record") Customer record, @Param("example") CustomerExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	int updateByExample(@Param("record") Customer record, @Param("example") CustomerExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	int updateByPrimaryKeySelective(Customer record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
+	 */
+	int updateByPrimaryKey(Customer record);
+}

+ 599 - 0
src/main/java/com/goafanti/common/mapper/CustomerMapper.xml

@@ -0,0 +1,599 @@
+<?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.CustomerMapper">
+  <resultMap id="BaseResultMap" type="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.
+    -->
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="aid" jdbcType="VARCHAR" property="aid" />
+    <result column="company_nmae" jdbcType="VARCHAR" property="companyNmae" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="company_industry" jdbcType="VARCHAR" property="companyIndustry" />
+    <result column="company_intention" jdbcType="VARCHAR" property="companyIntention" />
+    <result column="adress" jdbcType="VARCHAR" property="adress" />
+    <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
+    <result column="customer_position" jdbcType="VARCHAR" property="customerPosition" />
+    <result column="mobile" jdbcType="VARCHAR" property="mobile" />
+    <result column="email" jdbcType="VARCHAR" property="email" />
+    <result column="department" jdbcType="VARCHAR" property="department" />
+    <result column="qq" jdbcType="VARCHAR" property="qq" />
+    <result column="wechat" jdbcType="VARCHAR" property="wechat" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="province" jdbcType="VARCHAR" property="province" />
+    <result column="fllow_situation" jdbcType="VARCHAR" property="fllowSituation" />
+    <result column="sex" jdbcType="INTEGER" property="sex" />
+    <result column="customer_statue" jdbcType="VARCHAR" property="customerStatue" />
+    <result column="customer_typ" jdbcType="INTEGER" property="customerTyp" />
+    <result column="tel_num" jdbcType="VARCHAR" property="telNum" />
+  </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 Tue Oct 10 10:30:05 CST 2017.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      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.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      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.
+    -->
+    id, aid, company_nmae, 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">
+    <!--
+      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
+    <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">
+    <!--
+      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 
+    <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= 0
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <delete id="deleteByExample" parameterType="java.lang.String">
+    <!--
+      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.
+    -->
+    delete from customer
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insertCustomer" 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.
+    -->
+    insert into customer (id, aid, company_nmae, 
+      create_time, company_industry, company_intention, 
+      adress, customer_name, customer_position, 
+      mobile, email, department, 
+      qq, wechat, remark, 
+      province, fllow_situation, sex, 
+      customer_statue,cutomer_typ,tel_num,typ)
+    values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{companyNmae,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{companyIndustry,jdbcType=VARCHAR}, #{companyIntention,jdbcType=VARCHAR}, 
+      #{adress,jdbcType=VARCHAR}, #{customerName,jdbcType=VARCHAR}, #{customerPosition,jdbcType=VARCHAR}, 
+      #{mobile,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR}, 
+      #{qq,jdbcType=VARCHAR}, #{wechat,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
+      #{province,jdbcType=VARCHAR}, #{fllowSituation,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER}, 
+      #{customerStatue,jdbcType=VARCHAR}, #{cutomerTyp,jdbcType=INTEGER}, #{telNum,jdbcType=VARCHAR},0)
+  </insert>
+  <insert id="insertSelective" 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.
+    -->
+    insert into customer
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="aid != null">
+        aid,
+      </if>
+      <if test="companyNmae != null">
+        company_nmae,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="companyIndustry != null">
+        company_industry,
+      </if>
+      <if test="companyIntention != null">
+        company_intention,
+      </if>
+      <if test="adress != null">
+        adress,
+      </if>
+      <if test="customerName != null">
+        customer_name,
+      </if>
+      <if test="customerPosition != null">
+        customer_position,
+      </if>
+      <if test="mobile != null">
+        mobile,
+      </if>
+      <if test="email != null">
+        email,
+      </if>
+      <if test="department != null">
+        department,
+      </if>
+      <if test="qq != null">
+        qq,
+      </if>
+      <if test="wechat != null">
+        wechat,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="province != null">
+        province,
+      </if>
+      <if test="fllowSituation != null">
+        fllow_situation,
+      </if>
+      <if test="sex != null">
+        sex,
+      </if>
+      <if test="customerStatue != null">
+        customer_statue,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="aid != null">
+        #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="companyNmae != null">
+        #{companyNmae,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyIndustry != null">
+        #{companyIndustry,jdbcType=VARCHAR},
+      </if>
+      <if test="companyIntention != null">
+        #{companyIntention,jdbcType=VARCHAR},
+      </if>
+      <if test="adress != null">
+        #{adress,jdbcType=VARCHAR},
+      </if>
+      <if test="customerName != null">
+        #{customerName,jdbcType=VARCHAR},
+      </if>
+      <if test="customerPosition != null">
+        #{customerPosition,jdbcType=VARCHAR},
+      </if>
+      <if test="mobile != null">
+        #{mobile,jdbcType=VARCHAR},
+      </if>
+      <if test="email != null">
+        #{email,jdbcType=VARCHAR},
+      </if>
+      <if test="department != null">
+        #{department,jdbcType=VARCHAR},
+      </if>
+      <if test="qq != null">
+        #{qq,jdbcType=VARCHAR},
+      </if>
+      <if test="wechat != null">
+        #{wechat,jdbcType=VARCHAR},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="province != null">
+        #{province,jdbcType=VARCHAR},
+      </if>
+      <if test="fllowSituation != null">
+        #{fllowSituation,jdbcType=VARCHAR},
+      </if>
+      <if test="sex != null">
+        #{sex,jdbcType=INTEGER},
+      </if>
+      <if test="customerStatue != null">
+        #{customerStatue,jdbcType=VARCHAR},
+      </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.companyNmae != null">
+        company_nmae = #{record.companyNmae,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.companyNmae,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 customer
+    <set>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="companyNmae != null">
+        company_nmae = #{companyNmae,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyIndustry != null">
+        company_industry = #{companyIndustry,jdbcType=VARCHAR},
+      </if>
+      <if test="companyIntention != null">
+        company_intention = #{companyIntention,jdbcType=VARCHAR},
+      </if>
+      <if test="adress != null">
+        adress = #{adress,jdbcType=VARCHAR},
+      </if>
+      <if test="customerName != null">
+        customer_name = #{customerName,jdbcType=VARCHAR},
+      </if>
+      <if test="customerPosition != null">
+        customer_position = #{customerPosition,jdbcType=VARCHAR},
+      </if>
+      <if test="mobile != null">
+        mobile = #{mobile,jdbcType=VARCHAR},
+      </if>
+      <if test="email != null">
+        email = #{email,jdbcType=VARCHAR},
+      </if>
+      <if test="department != null">
+        department = #{department,jdbcType=VARCHAR},
+      </if>
+      <if test="qq != null">
+        qq = #{qq,jdbcType=VARCHAR},
+      </if>
+      <if test="wechat != null">
+        wechat = #{wechat,jdbcType=VARCHAR},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="province != null">
+        province = #{province,jdbcType=VARCHAR},
+      </if>
+      <if test="fllowSituation != null">
+        fllow_situation = #{fllowSituation,jdbcType=VARCHAR},
+      </if>
+      <if test="sex != null">
+        sex = #{sex,jdbcType=INTEGER},
+      </if>
+      <if test="customerStatue != null">
+        customer_statue = #{customerStatue,jdbcType=VARCHAR},
+      </if>
+    </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 = #{companyNmae,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="findSearchAchievementListByPage" parameterType="String" resultType="com.goafanti.portal.bo.AchievementSearchListBo">
+  	select 
+  		a.id, a.name, a.keyword,a.introduction,a.category,
+  		a.serial_number as serialNumber, 
+  		a.data_category as dataCategory, 
+  	    a.owner_type as ownerType, 
+  		a.owner_name as ownerName,
+  		a.field_a as fieldA, 
+  		a.field_b as fieldB,
+  		a.transfer_price as transferPrice,
+  		a.maturity,
+  		a.introduction,
+  		a.transfer_mode as transferMode,
+  		a.technical_picture_url as technicalPictureUrl,
+  		b.name as fieldAs
+  	from achievement a 
+  	left join field_glossory b on a.field_a = b.id
+  	where a.deleted_sign = 0 
+  	<if test="dataCategory != null and dataCategory != ''">
+  		and a.data_category = #{dataCategory,jdbcType=INTEGER}
+  	</if>
+  	<if test="category != null and category != ''">
+  		and a.category = #{category,jdbcType=INTEGER}
+  	</if>
+  	<if test="fieldA != null and fieldA != ''">
+  		and a.field_a = #{fieldA,jdbcType=INTEGER}
+  	</if>
+  	<if test="keyword != null and keyword != ''">
+  		and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+  	</if>
+  	<if test="transferMode != null">
+  		and a.transfer_mode = #{transferMode,jdbcType=INTEGER}
+  	</if>
+  	<if test="upperPrice != null and upperPrice != ''">
+  		and a.transfer_price &lt; #{upperPrice,jdbcType=VARCHAR}
+  	</if>
+  	<if test="lowerPrice != null and lowerPrice != ''">
+  		and a.transfer_price &gt; #{lowerPrice,jdbcType=VARCHAR}
+  	</if> 	
+  	
+  	and a.release_status = 1
+  	and a.audit_status = 3 
+  	<if test="dateSort == 0">
+  		order by a.release_date asc
+  	</if>
+  	<if test="dateSort == 1">
+  		order by a.release_date desc
+  	</if>	
+  	<if test="page_sql != null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findSearchAchievementCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+  		count(1)
+  	from achievement a
+  	where a.deleted_sign = 0 
+  	<if test="dataCategory != null and dataCategory != ''">
+  		and a.data_category = #{dataCategory,jdbcType=INTEGER}
+  	</if>
+  	<if test="category != null and category != ''">
+  		and a.category = #{category,jdbcType=INTEGER}
+  	</if>
+  	<if test="fieldA != null and fieldA != ''">
+  		and a.field_a = #{fieldA,jdbcType=INTEGER}
+  	</if>
+  	<if test="keyword != null and keyword != ''">
+  		and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+  	</if>
+  	<if test="transferMode != null">
+  		and a.transfer_mode = #{transferMode,jdbcType=INTEGER}
+  	</if>
+  	<if test="upperPrice != null and upperPrice != ''">
+  		and a.transfer_price &lt; #{upperPrice,jdbcType=VARCHAR}
+  	</if>
+  	<if test="lowerPrice != null and lowerPrice != ''">
+  		and a.transfer_price &gt; #{lowerPrice,jdbcType=VARCHAR}
+  	</if> 	
+  	
+  	and a.release_status = 1
+  	and a.audit_status = 3 
+  	<if test="dateSort == 0">
+  		order by a.release_date asc
+  	</if>
+  	<if test="dateSort == 1">
+  		order by a.release_date desc
+  	</if>	
+  </select>
+</mapper>

+ 237 - 0
src/main/java/com/goafanti/common/model/Customer.java

@@ -0,0 +1,237 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class Customer {
+	/**
+	 * 获取id
+	 */
+	private String id;
+	/**
+	 * 获取时间
+	 */
+	private Date createTime;
+	/**
+	 * 拥有者
+	 */
+	private String ownerId;
+	/**
+	 * 公司名称
+	 */
+	private String companyName;
+	/**
+	 * 客户类型
+	 */
+	private String customerTyp;
+	
+	/**
+	 * 行业
+	 */
+	private String companyIndustry;
+	/**
+	 * 公司意向
+	 */
+	private String companyIntention;
+	/**
+	 * 公司地址
+	 */
+	private String adress;
+	/**
+	 * 客户名称
+	 */
+	private String customerName;
+	/**
+	 * 座机
+	 */
+	private String mobile;
+	/**
+	 * 手机电话
+	 */
+	private String telNum;
+	/**
+	 * 邮箱
+	 */
+	private String email;
+	/**
+	 * 部门
+	 */
+	private String department;
+	/**
+	 * qq
+	 */
+	private String qq;
+	/**
+	 * 微信号
+	 */
+	private String wechat;
+	/**
+	 * 职位
+	 */
+	private String customerPosition;
+	/**
+	 * 备注
+	 */
+	private String remark;
+	/**
+	 * 省份
+	 */
+	private String province;
+	/**
+	 * 跟进情况
+	 */
+	private String fllowSituation;
+	/**
+	 * 性别
+	 */
+	private int sex;
+	/**
+	 * 客户状态
+	 */
+	private String customerStatue;
+	
+	
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public Date getCreateTime() {
+		return createTime;
+	}
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+	
+	public String getOwnerId() {
+		return ownerId;
+	}
+	public void setOwnerId(String ownerId) {
+		this.ownerId = ownerId;
+	}
+	
+	public String getCompanyName() {
+		return companyName;
+	}
+	public void setCompanyName(String companyName) {
+		this.companyName = companyName;
+	}
+	public String getCompanyIndustry() {
+		return companyIndustry;
+	}
+	public void setCompanyIndustry(String companyIndustry) {
+		this.companyIndustry = companyIndustry;
+	}
+	public String getCompanyIntention() {
+		return companyIntention;
+	}
+	public void setCompanyIntention(String companyIntention) {
+		this.companyIntention = companyIntention;
+	}
+	public String getAdress() {
+		return adress;
+	}
+	public void setAdress(String adress) {
+		this.adress = adress;
+	}
+	public String getCustomerName() {
+		return customerName;
+	}
+	public void setCustomerName(String customerName) {
+		this.customerName = customerName;
+	}
+	public String getMobile() {
+		return mobile;
+	}
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+	public String getEmail() {
+		return email;
+	}
+	public void setEmail(String email) {
+		this.email = email;
+	}
+	public String getDepartment() {
+		return department;
+	}
+	public void setDepartment(String department) {
+		this.department = department;
+	}
+	public String getQq() {
+		return qq;
+	}
+	public void setQq(String qq) {
+		this.qq = qq;
+	}
+	public String getWechat() {
+		return wechat;
+	}
+	public void setWechat(String wechat) {
+		this.wechat = wechat;
+	}
+	public String getCustomerPosition() {
+		return customerPosition;
+	}
+	public void setCustomerPosition(String customerPosition) {
+		this.customerPosition = customerPosition;
+	}
+	public String getRemark() {
+		return remark;
+	}
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+	public String getProvince() {
+		return province;
+	}
+	public void setProvince(String province) {
+		this.province = province;
+	}
+	public String getFllowSituation() {
+		return fllowSituation;
+	}
+	public void setFllowSituation(String fllowSituation) {
+		this.fllowSituation = fllowSituation;
+	}
+	public int getSex() {
+		return sex;
+	}
+	public void setSex(int sex) {
+		this.sex = sex;
+	}
+	public String getCustomerStatue() {
+		return customerStatue;
+	}
+	public void setCustomerStatue(String customerStatue) {
+		this.customerStatue = customerStatue;
+	}
+	public String getTelNum() {
+		return telNum;
+	}
+	public void setTelNum(String telNum) {
+		this.telNum = telNum;
+	}
+	
+	public String getCustomerTyp() {
+		return customerTyp;
+	}
+	public void setCustomerTyp(String customerTyp) {
+		this.customerTyp = customerTyp;
+	}
+	@Override
+	public String toString() {
+		return "Customer [createTime=" + createTime + ", ownerId=" + ownerId + ", companyName=" + companyName
+				+ ", companyIndustry=" + companyIndustry + ", companyIntention=" + companyIntention + ", adress="
+				+ adress + ", customerName=" + customerName + ", mobile=" + mobile + ", email=" + email
+				+ ", department=" + department + ", qq=" + qq + ", wechat=" + wechat + ", customerPosition="
+				+ customerPosition + ", remark=" + remark + ", province=" + province + ", fllowSituation="
+				+ fllowSituation + ", sex=" + sex + ", customerStatue=" + customerStatue + "]";
+	}
+	
+	
+	
+	
+	
+	
+}

+ 0 - 1
src/main/webapp/WEB-INF/views/admin/customer.html

@@ -7,7 +7,6 @@
 </head>
 <body>
 	<div id="root"></div>
-	
 	<div th:replace="common::footer(~{::script})">
 		<script type="text/javascript" th:src="${staticHost+'/vendors.js'}"></script>
 		<script type="text/javascript" th:src="${staticHost+'/admin/customer.js'}"></script>