Browse Source

修改团队客户查询SQL

wanghui 8 years ago
parent
commit
2da1a79be9

+ 11 - 5
src/main/java/com/goafanti/common/mapper/CustomerMapper.xml

@@ -414,11 +414,14 @@
     left join customer_organization_info d on a.id = d.cid
     left join admin e on a.aid = e.id 
     where a.effective = 0
-    <if test="aid != null and aid != ''">
-    	and a.aid = #{aid,jdbcType=VARCHAR}
+     <if test="aid != null and aid != ''">
+    	and (a.aid = #{aid,jdbcType=VARCHAR}
     </if>
     <if test="paid != null and paid != ''">
-    	or a.paid like concat('%',#{paid,jdbcType=VARCHAR},'%')
+    	or a.paid like concat('%',#{paid,jdbcType=VARCHAR},'%'))
+    </if>
+    <if  test="paid == null or paid == ''">
+    	)
     </if>
     <if test="shareType != null">
         and a.share_type = #{shareType,jdbcType=INTEGER}
@@ -465,10 +468,13 @@
     left join admin e on a.aid = e.id 
     where a.effective = 0
     <if test="aid != null and aid != ''">
-    	and a.aid = #{aid,jdbcType=VARCHAR}
+    	and (a.aid = #{aid,jdbcType=VARCHAR}
     </if>
     <if test="paid != null and paid != ''">
-    	or a.paid like concat('%',#{paid,jdbcType=VARCHAR},'%')
+    	or a.paid like concat('%',#{paid,jdbcType=VARCHAR},'%'))
+    </if>
+    <if  test="paid == null or paid == ''">
+    	)
     </if>
     <if test="shareType != null">
         and a.share_type = #{shareType,jdbcType=INTEGER}

+ 1 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -108,6 +108,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	public Pagination<CustomerOut> getTeamCustomer(CustomerIn cin, Integer pageSize, Integer pageNumber) {
 		cin.setShareType("0");
 		cin.setPaid(TokenManager.getAdminId());
+		cin.setAid(TokenManager.getAdminId());
 		Map<String,Object> params = disposeParams(cin);
 		if(pageSize == null || pageSize < 0) pageSize = 10;
 		if(pageNumber == null || pageNumber <0 ) pageNumber = 1;