Browse Source

Merge branch 'dev' of https://git.coding.net/aft/AFT.git into dev

zou_ht 8 years ago
parent
commit
cdd6d22cdc

+ 47 - 38
src/main/java/com/goafanti/admin/controller/AdminCustomerApiController.java

@@ -1,7 +1,7 @@
 package com.goafanti.admin.controller;
 
-import java.util.Date;
-import java.util.List;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.UUID;
 
 import javax.annotation.Resource;
@@ -9,75 +9,84 @@ 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.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 
-
-
-
 @RestController
 @RequestMapping(value = "/api/admin/customer")
-public class AdminCustomerApiController extends CertifyApiController{
-	
+public class AdminCustomerApiController extends CertifyApiController {
+
 	@Resource
-	private CustomerService		customerService;
+	private CustomerService customerService;
+
 	/**
 	 * 新增客户
 	 * 
 	 * @return
+	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
-	public Result addCustomer(HttpServletRequest req, String aid) {
-		Customer cus =new Customer();
-		Result res=new Result();
+	public Result addCustomer(String createTime, String companyName, String companyIndustry, String companyIntention,
+			String adress, String customerName, String mobile, String email, String qq, String wechat,
+			String customerPosition, String remark, String province, String fllowSituation, int sex,
+			String customerStatue, String department, int customerTyp, String telNum) throws ParseException {
+		Customer cus = new Customer();
+		Result res = new Result();
+		cus.setAdress(adress);
+		cus.setCompanyIndustry(companyIndustry);
+		cus.setCompanyIntention(companyIntention);
+		cus.setCompanyName(companyName);
+		if (null != createTime && createTime != "") {
+			cus.setCreateTime((new SimpleDateFormat("yyyy-MM-dd").parse(createTime)));
+		}
+		cus.setCustomerName(customerName);
+		cus.setCustomerPosition(customerPosition);
+		cus.setCustomerStatue(customerStatue);
+		cus.setCustomerTyp(customerTyp);
+		cus.setDepartment(department);
+		cus.setEmail(email);
+		cus.setFllowSituation(fllowSituation);
 		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"));
+		cus.setMobile(mobile);
+		cus.setAid(TokenManager.getUserId());
+		cus.setProvince(province);
+		cus.setQq(qq);
+		cus.setRemark(remark);
+		cus.setSex(sex);
+		cus.setTelNum(telNum);
+		cus.setWechat(wechat);
 		customerService.addCustomer(cus);
 		return res;
 	}
-	
+
 	/**
 	 * 删除客户信息
 	 * 
 	 * @return
 	 */
-	@RequestMapping(value = "/deleteCustomer", method = RequestMethod.POST)
+	@RequestMapping(value = "/deleteCustomer", method = RequestMethod.GET)
 	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;
+	@RequestMapping(value = "/SearchCustomerList", method = RequestMethod.GET)
+	public Result SearchCustomerList(String companyName, Integer customerTyp, String province,
+			String customerName, String telNum, String customerStatue, String CompanyIntention, String fllowSituation,Integer pageNo,Integer pageSize) {
+		Result res =new Result();
+		res.setData(customerService.findCustomerByPage(companyName, customerTyp, province, customerName, telNum, customerStatue,
+				CompanyIntention, fllowSituation,pageNo,pageSize));
+		return res;
 	}
-	
-	
+
 }

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

@@ -1,11 +1,16 @@
 package com.goafanti.admin.service;
 
+
 import com.goafanti.common.model.Customer;
+import com.goafanti.core.mybatis.page.Pagination;
 
 public interface CustomerService {
 
 	int addCustomer(Customer cus);
 	
 	int deleteCustomer(String id);
+	
+	Pagination<Customer> findCustomerByPage(String companyName ,Integer customerTyp ,String province ,String customerName ,String telNum ,
+			String customerStatue  ,String CompanyIntention  ,String fllowSituation,Integer pageNo, Integer pageSize);
 
 }

+ 54 - 2
src/main/java/com/goafanti/admin/service/impl/CustomerServiceImpl.java

@@ -1,13 +1,19 @@
 package com.goafanti.admin.service.impl;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-
+import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.admin.service.CustomerService;
 import com.goafanti.common.dao.CustomerMapper;
 import com.goafanti.common.model.Customer;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
 @Service
-public class CustomerServiceImpl implements CustomerService {
+public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implements CustomerService {
 	@Autowired
 	private CustomerMapper customerMapper ;
 	@Override
@@ -15,10 +21,56 @@ public class CustomerServiceImpl implements CustomerService {
 		int res = customerMapper.insertCustomer(cus);
 		return res;
 	}
+	
+	
 	@Override
 	public int deleteCustomer(String id) {
 		int res = customerMapper.deleteByPrimaryKey(id);
 		return res;
 	}
 	
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<Customer> findCustomerByPage(String companyName ,Integer customerTyp ,String province ,String customerName ,String telNum ,
+			String customerStatue  ,String CompanyIntention  ,String fllowSituation ,Integer pageNo, Integer pageSize) {
+		return (Pagination<Customer>) findPage("findSearchCustomerListByPage", "findSearchCustomerCount",
+				buildListParams(companyName, customerTyp, province, customerName, telNum, customerStatue, CompanyIntention, 
+						fllowSituation, TokenManager.getUserId()),
+				pageNo, pageSize);
+	}
+	
+	
+	private Map<String, Object> buildListParams(String companyName, Integer customerTyp,String province,String customerName,String telNum,
+			String customerStatue,String CompanyIntention,String fllowSituation,String aid) {
+		Map<String, Object> params = new HashMap<>();
+
+		if (null != companyName) {
+			params.put("companyName", companyName);
+		}
+		if (null!=customerTyp) {
+			params.put("customerTyp", customerTyp);
+		}
+		if (StringUtils.isNotBlank(province)) {
+			params.put("province", province);
+		}
+		if (StringUtils.isNotBlank(customerName)) {
+			params.put("customerName", customerName);
+		}
+		if (null!=customerStatue ) {
+			params.put("customerStatue", customerStatue);
+		}
+		if (StringUtils.isNotBlank(CompanyIntention)) {
+			params.put("CompanyIntention", CompanyIntention);
+		}
+		if (StringUtils.isNotBlank(fllowSituation)) {
+			params.put("fllowSituation", fllowSituation);
+		}
+		if (StringUtils.isNotBlank(aid)) {
+			params.put("aid", aid);
+		}
+		
+		return params;
+	}
+	
 }

+ 9 - 4
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -155,7 +155,6 @@ public class WebpageController extends BaseController {
 		return modelview;
 	}
 
-	@SuppressWarnings("unused")
 	@RequestMapping(value = "/user/subscriberDetail", method = RequestMethod.GET)
 	public ModelAndView subscriberDetail(HttpServletRequest request, ModelAndView modelview, String uid, Integer type) {
 		ModelAndView mv = new ModelAndView();
@@ -261,10 +260,16 @@ public class WebpageController extends BaseController {
 
 	@RequestMapping(value = "/admin/userManage", method = RequestMethod.GET)
 	public ModelAndView adminUserManage(HttpServletRequest request, ModelAndView modelview) {
-		System.out.println("用户管理");
 		modelview.setViewName("/admin/userManage");
 		return modelview;
 	}
+	
+	@RequestMapping(value = "/admin/customer", method = RequestMethod.GET)
+	public ModelAndView adminCustomer(HttpServletRequest request, ModelAndView modelview) {
+		System.out.println("用户管理");
+		modelview.setViewName("/admin/customer");
+		return modelview;
+	}
 
 	@RequestMapping(value = "/admin/servicesManage/technology", method = RequestMethod.GET)
 	public ModelAndView adminServicesManageTechnology(HttpServletRequest request, ModelAndView modelview) {
@@ -599,11 +604,11 @@ public class WebpageController extends BaseController {
 	 * @param modelview
 	 * @return
 	 */
-	@RequestMapping(value="/admin/marketing")
+	/*@RequestMapping(value="/admin/marketing")
 	public ModelAndView marketing(HttpServletRequest request, ModelAndView modelview){
 		modelview.setViewName("/admin/marketing");
 		return modelview;
-	}
+	}*/
 	
 	/**
 	 *  技术评估

+ 9 - 30
src/main/java/com/goafanti/common/dao/CustomerMapper.java

@@ -1,23 +1,11 @@
 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 {
+import com.goafanti.common.model.Customer;
 
-	/**
-	 * 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);
+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
-	 */
-	int deleteByExample(CustomerExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
@@ -26,40 +14,31 @@ public interface CustomerMapper {
 	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);
+	List<Customer> findSearchCustomerListByPage(String companyName ,Integer customerTyp ,String province ,String customerName ,String telNum ,
+			String customerStatue  ,String CompanyIntention  ,String fllowSituation  ,String aid);
 
 	/**
 	 * 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);
+	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
-	 */
-	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);
+	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 updateByExample(@Param("record") Customer record, @Param("example") CustomerExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer

+ 84 - 139
src/main/java/com/goafanti/common/mapper/CustomerMapper.xml

@@ -2,14 +2,9 @@
 <!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="company_nmae" 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" />
@@ -30,11 +25,6 @@
     <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">
@@ -64,11 +54,6 @@
     </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">
@@ -98,21 +83,11 @@
     </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
@@ -127,58 +102,38 @@
     </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
+    update  customer set delete_flg= 1
     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}, 
+      customer_statue,customer_typ,tel_num,typ,delete_flg)
+    values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{companyName,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)
+      #{customerStatue,jdbcType=VARCHAR}, #{customerTyp,jdbcType=INTEGER}, #{telNum,jdbcType=VARCHAR},0,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">
@@ -187,7 +142,7 @@
       <if test="aid != null">
         aid,
       </if>
-      <if test="companyNmae != null">
+      <if test="companyName != null">
         company_nmae,
       </if>
       <if test="createTime != null">
@@ -246,8 +201,8 @@
       <if test="aid != null">
         #{aid,jdbcType=VARCHAR},
       </if>
-      <if test="companyNmae != null">
-        #{companyNmae,jdbcType=VARCHAR},
+      <if test="companyName != null">
+        #{companyName,jdbcType=VARCHAR},
       </if>
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
@@ -324,8 +279,8 @@
       <if test="record.aid != null">
         aid = #{record.aid,jdbcType=VARCHAR},
       </if>
-      <if test="record.companyNmae != null">
-        company_nmae = #{record.companyNmae,jdbcType=VARCHAR},
+      <if test="record.companyName != null">
+        company_nmae = #{record.companyName,jdbcType=VARCHAR},
       </if>
       <if test="record.createTime != null">
         create_time = #{record.createTime,jdbcType=TIMESTAMP},
@@ -389,7 +344,7 @@
     update customer
     set id = #{record.id,jdbcType=VARCHAR},
       aid = #{record.aid,jdbcType=VARCHAR},
-      company_nmae = #{record.companyNmae,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},
@@ -421,8 +376,8 @@
       <if test="aid != null">
         aid = #{aid,jdbcType=VARCHAR},
       </if>
-      <if test="companyNmae != null">
-        company_nmae = #{companyNmae,jdbcType=VARCHAR},
+      <if test="companyName != null">
+        company_nmae = #{companyName,jdbcType=VARCHAR},
       </if>
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -483,7 +438,7 @@
     -->
     update customer
     set aid = #{aid,jdbcType=VARCHAR},
-      company_nmae = #{companyNmae,jdbcType=VARCHAR},
+      company_nmae = #{companyName,jdbcType=VARCHAR},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       company_industry = #{companyIndustry,jdbcType=VARCHAR},
       company_intention = #{companyIntention,jdbcType=VARCHAR},
@@ -507,93 +462,83 @@
   
   
   
-  <select id="findSearchAchievementListByPage" parameterType="String" resultType="com.goafanti.portal.bo.AchievementSearchListBo">
+  <select id="findSearchCustomerListByPage"  resultType="com.goafanti.common.model.Customer">
   	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>	
+  		a.id,
+  	    a.company_name as companyName ,
+  		a.customer_typ as customerTyp ,
+  		a.province ,
+  		a.tel_num as telNum ,  
+  		a.customer_name as customerName ,
+  		a.customer_statue as customerStatue,
+  		a.Company_intention as CompanyIntention ,
+  		a.fllow_situation as fllowSituation 
+  	from aft.customer a 
+  	 where a.delete_flg = 0 
+  	 and a.aid=#{aid,jdbcType=VARCHAR}
+     <if test="companyName != null">
+      a.company_name = #{companyName,jdbcType=VARCHAR},
+    </if>
+    <if test="telNum != null">
+      a.tel_num = #{telNum,jdbcType=VARCHAR},
+    </if>
+    <if test="customerTyp != null">
+      a.typ = #{customerTyp,jdbcType=INTEGER},
+    </if>
+    <if test="companyIntention != null">
+      a.company_intention = #{companyIntention,jdbcType=VARCHAR},
+    </if>
+    <if test="customerName != null">
+      a.customer_name = #{customerName,jdbcType=VARCHAR},
+    </if>
+    <if test="province != null">
+      a.province = #{province,jdbcType=VARCHAR},
+    </if>
+    <if test="fllowSituation != null">
+      a.fllow_situation = #{fllowSituation,jdbcType=VARCHAR},
+    </if>
+    <if test="customerStatue != null">
+      a.customer_statue = #{customerStatue,jdbcType=VARCHAR},
+    </if>
   	<if test="page_sql != null">
 		${page_sql}
 	</if>
+	
   </select>
   
-  <select id="findSearchAchievementCount" parameterType="String" resultType="java.lang.Integer">
+  <select id="findSearchCustomerCount" 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>	
+  	from customer a
+  	where a.delete_flg = 0 
+  	and a.aid=#{aid,jdbcType=VARCHAR}
+     <if test="companyName != null">
+      a.company_name = #{companyName,jdbcType=VARCHAR},
+    </if>
+    <if test="telNum != null">
+      a.tel_num = #{telNum,jdbcType=VARCHAR},
+    </if>
+    <if test="customerTyp != null">
+      a.typ = #{customerTyp,jdbcType=INTEGER},
+    </if>
+    <if test="companyIntention != null">
+      a.company_intention = #{companyIntention,jdbcType=VARCHAR},
+    </if>
+    <if test="customerName != null">
+      a.customer_name = #{customerName,jdbcType=VARCHAR},
+    </if>
+    <if test="province != null">
+      a.province = #{province,jdbcType=VARCHAR},
+    </if>
+    <if test="fllowSituation != null">
+      a.fllow_situation = #{fllowSituation,jdbcType=VARCHAR},
+    </if>
+    <if test="customerStatue != null">
+      a.customer_statue = #{customerStatue,jdbcType=VARCHAR},
+    </if>
+  	<if test="page_sql != null">
+		${page_sql}
+	</if>
+	
   </select>
 </mapper>

+ 9 - 10
src/main/java/com/goafanti/common/model/Customer.java

@@ -14,7 +14,7 @@ public class Customer {
 	/**
 	 * 拥有者
 	 */
-	private String ownerId;
+	private String aid;
 	/**
 	 * 公司名称
 	 */
@@ -22,7 +22,7 @@ public class Customer {
 	/**
 	 * 客户类型
 	 */
-	private String customerTyp;
+	private int customerTyp;
 	
 	/**
 	 * 行业
@@ -103,13 +103,12 @@ public class Customer {
 		this.createTime = createTime;
 	}
 	
-	public String getOwnerId() {
-		return ownerId;
+	public String getAid() {
+		return aid;
 	}
-	public void setOwnerId(String ownerId) {
-		this.ownerId = ownerId;
+	public void setAid(String aid) {
+		this.aid = aid;
 	}
-	
 	public String getCompanyName() {
 		return companyName;
 	}
@@ -213,15 +212,15 @@ public class Customer {
 		this.telNum = telNum;
 	}
 	
-	public String getCustomerTyp() {
+	public int getCustomerTyp() {
 		return customerTyp;
 	}
-	public void setCustomerTyp(String customerTyp) {
+	public void setCustomerTyp(int customerTyp) {
 		this.customerTyp = customerTyp;
 	}
 	@Override
 	public String toString() {
-		return "Customer [createTime=" + createTime + ", ownerId=" + ownerId + ", companyName=" + companyName
+		return "Customer [createTime=" + createTime + ", ownerId=" + aid + ", companyName=" + companyName
 				+ ", companyIndustry=" + companyIndustry + ", companyIntention=" + companyIntention + ", adress="
 				+ adress + ", customerName=" + customerName + ", mobile=" + mobile + ", email=" + email
 				+ ", department=" + department + ", qq=" + qq + ", wechat=" + wechat + ", customerPosition="