Browse Source

update

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

+ 28 - 43
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -593,49 +593,38 @@
 		</if>
 	</select>
 	<select id="selectSignOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
-		select 
-			t0.uid as uid,
-			date_format(t3.last_sign_time,'%Y-%m-%d %H:%I:%S') as lastSignTime,
-			t1.last_follow_time as lastFollowTime,
-			t2.society_tag as societyTag,
-			t2.identify_name as name,
-			t2.share_type as shareType,
-			t2.transfer_time as transferTime,
+		select 	
+			a.id as uid,
+			a.society_tag as societyTag,
+			a.identify_name as name,
+			a.share_type as shareType,
+			date_format(a.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime, 
 			dg1.name as province,
 			dg2.name as city, 
 			dg3.name as area,
 			c.name as industry,
 			d.name as adminName
-		from
-			(select uid,aid,max(lock_time) as update_time
-		from user_lock_release
-		where type=1 and status=0 and  aid= #{aid,jdbcType=VARCHAR} 
-		group by uid)t0
-		left join 
-			(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid,jdbcType=VARCHAR} group by uid)t1
-		on t0.uid = t1.uid
-		inner join
-			(select id,aid,share_type,society_tag,identify_name,transfer_time from user where type = 1)t2
-		on t0.uid = t2.id
-		left join (select aid,uid,max(lock_time) as last_sign_time from user_lock_release  where aid = #{aid,jdbcType=VARCHAR} group by uid)t3
-		on t0.uid = t3.uid
-		left join organization_identity b on t0.uid = b.uid
+		from user a 
+		left join organization_identity b on a.id = b.uid
 		left join district_glossory dg1 on b.location_province = dg1.id
 		left join district_glossory dg2 on b.location_city = dg2.id
 		left join district_glossory dg3 on b.location_area = dg3.id
 		left join industry_category c on b.industry = c.id
-		left join admin d on t2.aid = d.id where 1 = 1
+		left join admin d on a.aid = d.id where a.share_type =2
+		<if test="aid != null and aid != ''">
+			and a.aid = #{aid}
+		</if>
 		<if test="name != null and name != ''">
-			and t2.identify_name like concat('%',#{name},'%')
+			and a.identify_name like concat('%',#{name},'%')
 		</if>
 		<if test="shareType != null">
-			and t2.share_type = #{shareType,jdbcType=VARCHAR}
+			and a.share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
 		<if test="startDate != null and startDate != ''">
-			and t2.transfer_time &gt; #{startDate}
+			and a.transfer_time &gt; #{startDate}
 		</if>
 		<if test="endDate != null and endDate != ''">
-			and t2.transfer_time &lt; #{endDate}
+			and a.transfer_time &lt; #{endDate}
 		</if>
 		<if test="province != null">
 			and b.location_province = #{province,jdbcType=INTEGER}
@@ -646,35 +635,30 @@
 		<if test="area != null">
 			and b.location_area = #{area,jdbcType=INTEGER}
 		</if>
-		order by t1.last_follow_time desc
+		order by a.transfer_time desc
 		 <if test="page_sql != null">
     		${page_sql}
    		 </if>
 	</select>
 	
 	<select id="selectSignOrganizationCustomerCount" resultType="java.lang.Integer">
-		select 
-			count(0)
-		from
-			(select uid,aid,max(lock_time) as update_time
-		from user_lock_release
-		where type=1 and status=0 and  aid= #{aid,jdbcType=VARCHAR} 
-		group by uid)t0
-		inner join
-			(select id,aid,share_type,society_tag,identify_name,transfer_time from user where type = 1)t2
-		on t0.uid = t2.id
-		left join organization_identity b on t0.uid = b.uid where 1 = 1
+		select count(0) from user a 
+		left join organization_identity b on a.id = b.uid
+		where a.share_type =2
+		<if test="aid != null and aid != ''">
+			and a.aid = #{aid}
+		</if>
 		<if test="name != null and name != ''">
-			and t2.identify_name like concat('%',#{name},'%')
+			and a.identify_name like concat('%',#{name},'%')
 		</if>
 		<if test="shareType != null">
-			and t2.share_type = #{shareType,jdbcType=VARCHAR}
+			and a.share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
 		<if test="startDate != null and startDate != ''">
-			and t2.transfer_time &gt; #{startDate}
+			and a.transfer_time &gt; #{startDate}
 		</if>
 		<if test="endDate != null and endDate != ''">
-			and t2.transfer_time &lt; #{endDate}
+			and a.transfer_time &lt; #{endDate}
 		</if>
 		<if test="province != null">
 			and b.location_province = #{province,jdbcType=INTEGER}
@@ -1100,6 +1084,7 @@
 		a.update_time as updateTime,
 		a.follow_situation as followSituation,
 		a.customer_status as customerStatus,
+		a.remarks,
 		d.name as adminName
 	from
 		user_business a inner join user b on

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

@@ -1432,9 +1432,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 //		cli.setAid("1");
 		Map<String,Object> params = disposeParams(cli);
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectSignOrganizationCustomerList","selectSignOrganizationCustomerCount",params,pageNo,pageSize);
-		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
-		setCustomerList(tmpList,1,0);
-		list.setList(tmpList);
+//		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
+//		setCustomerList(tmpList,1,0);
+//		list.setList(tmpList);
 		return list;
 	}