wanghui пре 8 година
родитељ
комит
031c837b14

+ 4 - 63
src/main/java/com/goafanti/common/dao/CustomerOrganizationInfoMapper.java

@@ -1,80 +1,21 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.CustomerOrganizationInfo;
-import com.goafanti.common.model.CustomerOrganizationInfoExample;
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
 
 public interface CustomerOrganizationInfoMapper {
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
-	 */
-	long countByExample(CustomerOrganizationInfoExample example);
 
 	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
-	 */
-	int deleteByExample(CustomerOrganizationInfoExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
+	 * 删除
 	 */
 	int deleteCustomerOrganizationByCid(String cid);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
-	 */
-	int insert(CustomerOrganizationInfo record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
-	 */
-	int insertSelective(CustomerOrganizationInfo record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
-	 */
-	List<CustomerOrganizationInfo> selectByExample(CustomerOrganizationInfoExample example);
-
 	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
+	 * 修改
 	 */
-	CustomerOrganizationInfo selectByPrimaryKey(String id);
-
+	int updateCustomerOrganizationByPrimaryKey(String cid);
 	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
+	 * 新增
 	 */
-	int updateByExampleSelective(@Param("record") CustomerOrganizationInfo record,
-			@Param("example") CustomerOrganizationInfoExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
-	 */
-	int updateByExample(@Param("record") CustomerOrganizationInfo record,
-			@Param("example") CustomerOrganizationInfoExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
-	 */
-	int updateByPrimaryKeySelective(CustomerOrganizationInfo record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_organization_info
-	 * @mbg.generated  Wed Oct 11 15:42:57 CST 2017
-	 */
-	int updateByPrimaryKey(CustomerOrganizationInfo record);
-
 	int insertCustomerOrganization(CustomerOrganizationInfo cui);
 
 }

+ 4 - 61
src/main/java/com/goafanti/common/dao/CustomerUserInfoMapper.java

@@ -1,79 +1,22 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.CustomerUserInfo;
-import com.goafanti.common.model.CustomerUserInfoExample;
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
 
 public interface CustomerUserInfoMapper {
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
-	 */
-	long countByExample(CustomerUserInfoExample example);
 
 	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
-	 */
-	int deleteByExample(CustomerUserInfoExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 删除
 	 */
 	int deleteCustomerUserByCid(String cid);
 
 	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 修改
 	 */
-	int insert(CustomerUserInfo record);
-
+	int updateCustomerUserByPrimaryKey(String cid);
 	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
+	 * 新增
 	 */
-	int insertSelective(CustomerUserInfo record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
-	 */
-	List<CustomerUserInfo> selectByExample(CustomerUserInfoExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
-	 */
-	CustomerUserInfo selectByPrimaryKey(String id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
-	 */
-	int updateByExampleSelective(@Param("record") CustomerUserInfo record,
-			@Param("example") CustomerUserInfoExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
-	 */
-	int updateByExample(@Param("record") CustomerUserInfo record, @Param("example") CustomerUserInfoExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
-	 */
-	int updateByPrimaryKeySelective(CustomerUserInfo record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer_user_info
-	 * @mbg.generated  Wed Oct 11 15:42:45 CST 2017
-	 */
-	int updateByPrimaryKey(CustomerUserInfo record);
-
 	int insertCustomerUser(CustomerUserInfo record);
 
 }

+ 23 - 0
src/main/java/com/goafanti/common/mapper/CustomerOrganizationInfoMapper.xml

@@ -72,4 +72,27 @@
     delete from customer_organization_info 
     where cid = #{cid,jdbcType=VARCHAR}
   </delete>
+  
+  
+  <update id="updateCustomerOrganizationByPrimaryKey" parameterType="com.goafanti.common.model.CustomerOrganizationInfo">
+    update customer_organization_info
+    <set>
+      <if test="cid != null">
+        cid = #{cid,jdbcType=VARCHAR},
+      </if>
+      <if test="companyName != null">
+        company_name = #{companyName,jdbcType=VARCHAR},
+      </if>
+      <if test="locationProvince != null">
+        location_province = #{locationProvince,jdbcType=INTEGER},
+      </if>
+      <if test="adress != null">
+        adress = #{adress,jdbcType=VARCHAR},
+      </if>
+      <if test="companyIndustry != null">
+        company_industry = #{companyIndustry,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where cid = #{cid,jdbcType=VARCHAR}
+  </update>
 </mapper>

+ 37 - 0
src/main/java/com/goafanti/common/mapper/CustomerUserInfoMapper.xml

@@ -103,4 +103,41 @@
     where cid = #{cid,jdbcType=VARCHAR}
   </delete>
   
+  <update id="updateCustomerUserByPrimaryKey" parameterType="com.goafanti.common.model.CustomerUserInfo">
+    update customer_user_info
+    <set>
+      <if test="cid != null">
+        cid = #{cid,jdbcType=VARCHAR},
+      </if>
+      <if test="name != null">
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="sex != null">
+        sex = #{sex,jdbcType=INTEGER},
+      </if>
+      <if test="mobile != null">
+        mobile = #{mobile,jdbcType=VARCHAR},
+      </if>
+      <if test="email != null">
+        email = #{email,jdbcType=VARCHAR},
+      </if>
+      <if test="qq != null">
+        qq = #{qq,jdbcType=VARCHAR},
+      </if>
+      <if test="wechat != null">
+        wechat = #{wechat,jdbcType=VARCHAR},
+      </if>
+      <if test="depatrment != null">
+        depatrment = #{depatrment,jdbcType=VARCHAR},
+      </if>
+      <if test="customerPosition != null">
+        customer_position = #{customerPosition,jdbcType=VARCHAR},
+      </if>
+      <if test="remarks != null">
+        remarks = #{remarks,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where cid = #{cid,jdbcType=VARCHAR}
+  </update>
+  
 </mapper>

+ 2 - 0
src/main/java/com/goafanti/customer/service/CustomerOrganizationService.java

@@ -6,4 +6,6 @@ public interface CustomerOrganizationService {
 	int addCustomerOrganization(CustomerOrganizationInfo coi);
 	
 	void deleteCustomerOrganizationByCid(String cid);
+	
+	void updCustomerOrganizationByByPrimaryKey(String cid);
 }

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

@@ -1,24 +1,29 @@
 package com.goafanti.customer.service;
 
 import com.goafanti.common.model.Customer;
+
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.CustomerBo;
-import com.goafanti.customer.bo.CustomerIn;
+import com.goafanti.customer.bo.CustomerIn;
 
 public interface CustomerService {
 
 	int addCustomer(Customer cus);
 	
 	void deleteCustomer(String id);
-	
-	CustomerBo selectCustomerByPrimaryKey (String id);
-	
-	void updCustomerByByPrimaryKey(String id);
+		
 	/**
 	 * 查询用户的管理层ID
 	 * @param userId
 	 * @return
-	 */
+	 */
+	CustomerBo selectCustomerByPrimaryKey (String id);
+
+	/**
+	 *  查询上级ID集合
+	 * @param userId
+	 * @return
+	 */
 	String findLadderIds(String userId);
 	
 	/**
@@ -38,4 +43,6 @@ public interface CustomerService {
 	 * @return
 	 */
 	Pagination<CustomerBo> getPublicCustomer(CustomerIn cin,Integer pageSize, Integer pageNumber);
+	
+	void updCustomerByByPrimaryKey(String id);
 }

+ 2 - 0
src/main/java/com/goafanti/customer/service/CustomerUserService.java

@@ -6,4 +6,6 @@ public interface CustomerUserService {
 	int addCustomerUser(CustomerUserInfo cui);
 	
 	void deleteCustomerUserByCid(String id);
+	
+	void updCustomerUserByByPrimaryKey(String cid);
 }

+ 5 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerOrganizationServiceImp.java

@@ -22,5 +22,10 @@ public class CustomerOrganizationServiceImp extends BaseMybatisDao<CustomerOrgan
 		customerOrganizationInfoMapper.deleteCustomerOrganizationByCid(cid);
 	}
 
+	@Override
+	public void updCustomerOrganizationByByPrimaryKey(String cid) {
+		customerOrganizationInfoMapper.updateCustomerOrganizationByPrimaryKey(cid);
+	}
+
 
 }

+ 5 - 4
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -40,6 +40,11 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	}
 	
 	@Override
+	public void updCustomerByByPrimaryKey(String id) {
+		customerMapper.updateCustomerByPrimaryKey(id);
+	}
+	
+	@Override
 	public String findLadderIds(String adminId) {
 		String result = "";
 		Admin admin = adminMapper.selectByPrimaryKey(adminId);
@@ -79,10 +84,6 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 		return null;
 	}
 
-	@Override
-	public void updCustomerByByPrimaryKey(String id) {
-		customerMapper.updateCustomerByPrimaryKey(id);
-	}
 	private Map<String,Object> disposeParams(CustomerIn cin){
 		Map<String,Object> params = new HashMap<String,Object>();
 		if(StringUtils.isNotBlank(cin.getAdminName())) params.put("adminName", cin.getAdminName());

+ 5 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerUserServiceImp.java

@@ -22,4 +22,9 @@ public class CustomerUserServiceImp extends BaseMybatisDao<CustomerUserInfoMappe
 		customerUserInfoMapper.deleteCustomerUserByCid(cid);
 	}
 
+	@Override
+	public void updCustomerUserByByPrimaryKey(String cid) {
+		customerUserInfoMapper.updateCustomerUserByPrimaryKey(cid);
+	}
+
 }