Sfoglia il codice sorgente

Accept Merge Request #255 生产更新 : (test -> prod)

Merge Request: 生产更新
Created By: @浅川
Accepted By: @浅川
URL: https://coding.net/t/aft/p/AFT/git/merge/255
浅川 8 anni fa
parent
commit
dc7b570e4a

+ 25 - 13
src/main/java/com/goafanti/common/mapper/CustomerMapper.xml

@@ -414,11 +414,17 @@
     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 a.aid = #{aid,jdbcType=VARCHAR}
+     <if test="aid != null and aid != ''">
+    	and (a.aid = #{aid,jdbcType=VARCHAR}
     </if>
-    <if test="paid != null">
-    	or a.paid like concat('%',#{paid,jdbcType=VARCHAR},'%')
+    <if test="aid == null or aid == ''">
+    	and (1=1
+    </if>
+    <if test="paid != null and paid != ''">
+    	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}
@@ -441,13 +447,13 @@
     <if test="contactTel != null">
     	 and c.tel_num = #{contactTel,jdbcType=VARCHAR}
     </if>
-    <if test="companyName != null">
+    <if test="companyName != null and companyName != ''">
     	and d.company_name like concat('%',#{companyName,jdbcType=VARCHAR},'%')
     </if>
     <if test="locationProvince != null">
     	and d.location_province = #{locationProvince,jdbcType=VARCHAR}
     </if>
-   	<if test="adminName != null">
+   	<if test="adminName != null and adminName != ''">
    	 	and e.name like concat('%',#{adminName,jdbcType=VARCHAR},'%')
    	</if>
    	order by a.create_time desc
@@ -464,11 +470,17 @@
     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 a.aid = #{aid,jdbcType=VARCHAR}
+    <if test="aid != null and aid != ''">
+    	and (a.aid = #{aid,jdbcType=VARCHAR}
+    </if>
+    <if test="aid == null or aid == ''">
+    	and (1=1
     </if>
-    <if test="paid != null">
-    	or a.paid like concat('%',#{paid,jdbcType=VARCHAR},'%')
+    <if test="paid != null and paid != ''">
+    	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}
@@ -491,14 +503,14 @@
     <if test="contactTel != null">
     	 and c.tel_num = #{contactTel,jdbcType=VARCHAR}
     </if>
-    <if test="companyName != null">
+    <if test="companyName != null and companyName != ''">
     	and d.company_name like concat('%',#{companyName,jdbcType=VARCHAR},'%')
     </if>
     <if test="locationProvince != null">
     	and d.location_province = #{locationProvince,jdbcType=VARCHAR}
     </if>
-   	<if test="adminName != null">
-   	 		and e.name like concat('%',#{adminName,jdbcType=VARCHAR},'%')
+   	<if test="adminName != null and adminName != ''">
+   	 	and e.name like concat('%',#{adminName,jdbcType=VARCHAR},'%')
    	</if>
   </select>
   

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

@@ -107,8 +107,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	@Override
 	public Pagination<CustomerOut> getTeamCustomer(CustomerIn cin, Integer pageSize, Integer pageNumber) {
 		cin.setShareType("0");
-		String paid = findLadderIds(TokenManager.getAdminId());
-		cin.setPaid(paid);
+		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;