wanghui лет назад: 7
Родитель
Сommit
3fe8d4d816

+ 25 - 14
src/main/java/com/goafanti/common/mapper/UserBusinessMapper.xml

@@ -381,23 +381,34 @@
   </select>
   
   <select id="selectLockedBusinessByUAid" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.BusinessListBo">
-	select x.* from(
+	select 
+		x.id as businessId,
+		x.uid,
+		x.follow_situation as followSituation,
+		x.customer_status as customerStatus,
+		y.business_project_id as businessProjectId,
+		y.bname as businessProjectName,
+		y.cname as businessvarietiesName
+	from(
+		select 
+			id,
+			uid,
+			business_project_id,
+			follow_situation,
+			customer_status,
+			remarks
+		from user_business
+		where uid = #{uid} and aid = #{aid} and customer_status != 6
+	)x right join(
 		select 
-			a.id as businessId,
-			a.uid,
-			a.business_project_id as businessProjectId,
-			a.follow_situation as followSituation,
-			a.customer_status as customerStatus,
-			a.remarks,
-			b.bname as businessProjectName,
-			c.cname as businessvarietiesName
-		from user_business a
+			a.business_project_id,
+			b.bname,
+			c.cname
+		from user_lock_release a
 		left join business_project b on a.business_project_id = b.id
 		left join business_varieties c on b.cid = c.id
-		where  a.uid = '1' and a.aid = '1' and  a.customer_status != 6
-	)x right join(
-		select business_project_id from user_lock_release where uid = '1' and aid = '1' and type = 1 and status = 0
-	)y on x.businessProjectId = y.business_project_id
+		where a.uid = #{uid} and a.aid = #{aid} and a.type = 1 and a.status = 0	
+	)y on x.business_project_id = y.business_project_id
   </select>
   
   <select id="selectFollowCountByUAid" parameterType="java.lang.String" resultType="java.lang.Integer">

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

@@ -256,7 +256,7 @@
 		left join district_glossory dg2 on b.city = dg2.id
 		left join district_glossory dg3 on b.area = dg3.id
 		left join industry_category c on b.industry = c.id
-		left join admin d on t2.aid = d.id
+		left join admin d on t2.aid = d.id where 1 = 1
 		<if test="name != null and name != ''">
 			and t2.identify_name like concat('%',#{name},'%')
 		</if>
@@ -291,7 +291,7 @@
 		inner join
 			(select id,aid,share_type,society_tag,identify_name,transfer_time from user where type = 0 and status != 1)t2
 		on t0.buyer_id = t2.id
-		left join user_identity b on t0.buyer_id = b.uid
+		left join user_identity b on t0.buyer_id = b.uid where 1 = 1
 		<if test="name != null and name != ''">
 			and t2.identify_name like concat('%',#{name},'%')
 		</if>
@@ -581,7 +581,7 @@
 		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 t2.aid = d.id where 1 = 1
 		<if test="name != null and name != ''">
 			and t2.identify_name like concat('%',#{name},'%')
 		</if>
@@ -617,7 +617,7 @@
 		inner join
 			(select id,aid,share_type,society_tag,identify_name,transfer_time from user where type = 1)t2
 		on t0.buyer_id = t2.id
-		left join organization_identity b on t0.buyer_id = b.uid where 1=1
+		left join organization_identity b on t0.buyer_id = b.uid where 1 = 1
 		<if test="name != null and name != ''">
 			and t2.identify_name like concat('%',#{name},'%')
 		</if>