Browse Source

生产部门筛选BUG修复

anderx 3 years ago
parent
commit
51809e46c6

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

@@ -965,10 +965,6 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	<if test="specially == 1">
   	and a.process_status = 1  and a.order_status = 1
-  	and a.order_dep in
-  	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
-	 #{deps.id}
-  	</foreach>
   	</if>
   	<if test="specially == 2">
   	and a.order_status in(3,5)
@@ -1004,18 +1000,6 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	<if test="specially == 4">
   	and a.process_status in (4,5,6,99)
   	and a.order_status  in(1,2,3,4,6)
-      <if test="deps!=null">
-        and a.order_dep in
-        <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-          #{deps.id}
-        </foreach>
-      </if>
-  	</if>
-  	<if test="specially == 5">
-  	and a.order_dep in
-  	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
-	 #{deps.id}
-  	</foreach>
   	</if>
   	<if test="distribution == 0">
   	and a.process_status &lt; 5
@@ -1059,8 +1043,11 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	<if test="amountStatus == 4">
   	and a.total_amount  &gt; 40
   	</if>
-  	<if test="depId != null">
-  	and a.order_dep = #{depId,jdbcType=VARCHAR}
+  	<if test="deps != null">
+      and a.order_dep in
+      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
   	</if>
     <if test="starTime !=null and endTime !=null">
       and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
@@ -1124,11 +1111,6 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     </if>
   	<if test="specially == 1">
   	and a.process_status = 1  and a.order_status = 1
-  	<!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
-  	and a.order_dep in
-  	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
-	 #{deps.id}
-  	</foreach>
   	</if>
   	<if test="specially == 2">
   	and a.order_status in(3,5)
@@ -1159,29 +1141,11 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
        </if>
        <if test="approval ==4">
            and a.approval in (1,2)
-           <if test="deps!=null">
-             and a.order_dep in
-             <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-               #{deps.id}
-             </foreach>
-           </if>
        </if>
      </if>
   	<if test="specially == 4">
   	and a.process_status in (4,5,6,99)
   	and a.order_status  in(1,2,3,4,6)
-      <if test="deps!=null">
-        and a.order_dep in
-        <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-          #{deps.id}
-        </foreach>
-      </if>
-  	</if>
-  	<if test="specially == 5">
-  	and a.order_dep in
-  	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
-	 #{deps.id}
-  	</foreach>
   	</if>
   	<if test="distribution == 0">
   	and a.process_status &lt; 5
@@ -1225,8 +1189,11 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	<if test="amountStatus == 4">
   	and a.total_amount  &gt; 40
   	</if>
-  	<if test="depId != null">
-  	and a.order_dep = #{depId,jdbcType=VARCHAR}
+  	<if test="deps != null">
+      and a.order_dep in
+      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
   	</if>
   	<if test="starTime !=null and endTime !=null">
   	and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}

+ 3 - 0
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -636,6 +636,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if(specially==1||specially==5) {
 			if (depId!=null){
 				deps=departmentService.selectSubDeps(depId,0,1);
+				if (deps.isEmpty()){
+					return new Pagination(1,10,0);
+				}
 			}else {
 				deps=departmentService.selectMyDeps();
 			}