Browse Source

update

Signed-off-by: anderx <312518615@qq.com>
anderx 5 years ago
parent
commit
076ac2becd

+ 11 - 18
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -420,7 +420,11 @@
 			from user a left join admin b on  a.aid=b.id 
 			left join organization_identity d on a.id = d.uid left join district_glossory dg1 on d.location_province = dg1.id
 			left join district_glossory dg2 on d.location_city = dg2.id left join district_glossory dg3 on d.location_area = dg3.id
-			<if test="power != 0">
+			<if test="power == 0">
+			left join (select aid,uid,max(lock_time) last_sign_time from user_lock_release where aid= #{aid,jdbcType=VARCHAR} group by uid) t0 on a.id=t0.uid 
+			left join (select uid,aid,max(create_time) last_follow_time from user_follow  where aid= #{aid,jdbcType=VARCHAR} group by uid) t1 on a.id=t1.uid 
+			</if>
+			<if test="power == 1 or power==2">
 			left join (select aid,uid,max(lock_time) last_sign_time from user_lock_release where aid in 
 			<foreach item="item" collection="alist" separator="," open="(" close=")" index="">
 		       #{item}
@@ -432,26 +436,20 @@
 		     </foreach> 
 			 group by aid,uid)t1 on a.id=t1.uid and a.aid=t1.aid
 			</if>
-			<if test="power == 0">
-			left join (select aid,uid,max(lock_time) last_sign_time from user_lock_release where aid= #{aid,jdbcType=VARCHAR} group by uid) t0 on a.id=t0.uid 
-			left join (select uid,aid,max(create_time) last_follow_time from user_follow  where aid= #{aid,jdbcType=VARCHAR} group by uid) t1 on a.id=t1.uid 
+			<if test="power == 3">
+			left join (select aid,uid,max(lock_time) last_sign_time from user_lock_release group by aid,uid)t0 on a.id=t0.uid
+			left join (select uid,aid,max(create_time)  last_follow_time from user_follow  group by aid,uid)t1 on a.id=t1.uid
 			</if>
 			where a.type= 1 and a.share_type=0  and source !=0
 		<if test="power ==0">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
-		<if test="power ==1">
+		<if test="power ==1  or power ==2">
 			and a.aid in
 			<foreach item="item" collection="alist" separator="," open="(" close=")" index="">
 		       #{item}
 		     </foreach> 
 		</if>
-		<if test="power ==2">
-			and a.aid in  
-			<foreach item="item" collection="alist" separator="," open="(" close=")" index="">
-		       #{item}
-		     </foreach> 
-		</if>
 		<if test="name != null and name != ''">
 			and a.identify_name like concat('%',#{name},'%')
 		</if>
@@ -495,18 +493,13 @@
 		<if test="power ==0">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
-		<if test="power ==1">
+		<if test="power ==1 or power ==2">
 			and a.aid in
 			<foreach item="item" collection="alist" separator="," open="(" close=")" index="">
 		       #{item}
 		     </foreach> 
 		</if>
-		<if test="power ==2">
-			and a.aid in  
-			<foreach item="item" collection="alist" separator="," open="(" close=")" index="">
-		       #{item}
-		     </foreach> 
-		</if>
+		
 		<if test="name != null and name != ''">
 			and a.identify_name like concat('%',#{name},'%')
 		</if>

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

@@ -195,6 +195,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 				}
 				alist.addAll(alist2);
 			}
+		}else if (TokenManager.hasRole(AFTConstants.CED)) {
+			params.put("power", 3);
 		}
 		params.put("alist", alist);
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPrivateOrganizationCustomerList","selectPrivateOrganizationCustomerCount",params,pageNo,pageSize);