Browse Source

单位客户查询接口优化

anderx 3 years ago
parent
commit
a3cb8eb317

+ 2 - 2
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -884,7 +884,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	and a.outsource= #{outsource,jdbcType=INTEGER}
   	</if>
   	<if test="specially == 0">
-  	and a.order_status not in(3,5,6,7) and a.approval !=3
+  	and a.order_status not in(3,5,6,7) and a.approval in(0,1,2)
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
   	<if test="specially == 1">
@@ -1014,7 +1014,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	and a.outsource= #{outsource,jdbcType=INTEGER}
   	</if>
   	<if test="specially == 0">
-  	and a.order_status not in(3,5,6,7) and a.approval !=3
+  	and a.order_status not in(3,5,6,7) and a.approval in(0,1,2)
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
   	<if test="specially == 1">

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

@@ -434,8 +434,7 @@
 			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
-		where
-			a.type = 1 and a.share_type = 1 and a.status != 1 and a.source != 0
+		where a.type = 1 and a.share_type = 1 and a.status = 0 and a.source in(1,2,3)
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
@@ -472,15 +471,10 @@
 			count(0)
 		from
 			user a
+		<if test="province != null or city != null or area != null">
 			inner 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
-		where
-			a.type = 1
-			and a.share_type = 1
-			and a.status != 1
-			and a.source != 0
+		</if>
+		where a.type = 1 and a.share_type = 1 and a.status = 0 and a.source in(1,2,3)
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>