Browse Source

收款预警数据权限添加

wucl 10 tháng trước cách đây
mục cha
commit
326a5b9311
1 tập tin đã thay đổi với 39 bổ sung34 xóa
  1. 39 34
      dao/src/main/resources/mapper/FinanceRealFundMapper.xml

+ 39 - 34
dao/src/main/resources/mapper/FinanceRealFundMapper.xml

@@ -871,22 +871,23 @@
         LEFT JOIN `user` u1 ON u1.id = p.outward_staff
         LEFT JOIN `user` u2 ON u2.id = p.inward_staff
         LEFT JOIN `user` u3 ON u3.id = p.pricing_staff
-        WHERE
-        DATEDIFF(
-        CURDATE(),
-        DATE ( pp.rot )) >= #{overdueVO.overdueMin}
-        <if test="overdueVO!=null and overdueVO.overdueMax!=null">
-            AND DATEDIFF(CURDATE(),DATE( pp.rot )) &lt;= #{overdueVO.overdueMax}
-        </if>
-        <if test="overdueVO!=null and overdueVO.orderId!=null and overdueVO.orderId!=''">
-            and m.order_id = #{overdueVO.orderId}
-        </if>
-        <if test="overdueVO!=null and overdueVO.userIds!=null and overdueVO.userIds.size!=0">
-            and p.client_manager_id in
-            <foreach collection="overdueVO.userIds" open="(" close=")" separator="," item="userId">
-                #{userId}
-            </foreach>
-        </if>
+        <where>
+            <if test="overdueVO!=null and overdueVO.overdueMin!=null">
+                AND DATEDIFF(CURDATE(),DATE ( pp.rot )) >= #{overdueVO.overdueMin}
+            </if>
+            <if test="overdueVO!=null and overdueVO.overdueMax!=null">
+                AND DATEDIFF(CURDATE(),DATE( pp.rot )) &lt;= #{overdueVO.overdueMax}
+            </if>
+            <if test="overdueVO!=null and overdueVO.orderId!=null and overdueVO.orderId!=''">
+                and m.order_id = #{overdueVO.orderId}
+            </if>
+            <if test="overdueVO!=null and overdueVO.userIds!=null and overdueVO.userIds.size!=0">
+                and p.client_manager_id in
+                <foreach collection="overdueVO.userIds" open="(" close=")" separator="," item="userId">
+                    #{userId}
+                </foreach>
+            </if>
+        </where>
         ORDER BY
         overdueDay DESC
     </sql>
@@ -1450,25 +1451,29 @@
         WHERE
         ap.productionType != 'STATEMENT'
         AND ( pf.production_no IS NULL OR pf.real_amount IS NULL )
-        AND DATEDIFF(CURDATE(),DATE( ap.repertory_out_time )) &gt;= #{overdueVO.overdueMin}
-        <if test="overdueVO!=null and overdueVO.overdueMax!=null">
-            AND DATEDIFF(CURDATE(),DATE( ap.repertory_out_time )) &lt;= #{overdueVO.overdueMax}
-        </if>
-        <if test="overdueVO!=null and overdueVO.orderId!=null and overdueVO.orderId!=''">
-            and a.order_id = #{overdueVO.orderId}
-        </if>
-        <if test="overdueVO!=null and overdueVO.productionNo!=null and overdueVO.productionNo!=''">
-            and ap.production_no like concat ('%',#{overdueVO.productionNo},'%')
-        </if>
-        <if test="overdueVO!=null and overdueVO.principal!=null and overdueVO.principal!=''">
-            and u1.name like concat ('%',#{overdueVO.principal},'%')
-        </if>
-        <if test="overdueVO!=null and overdueVO.userIds!=null and overdueVO.userIds.size!=0">
+        <where>
+            <if test="overdueVO!=null and overdueVO.overdueMin!=null">
+                AND DATEDIFF(CURDATE(),DATE( ap.repertory_out_time )) &gt;= #{overdueVO.overdueMin}
+            </if>
+            <if test="overdueVO!=null and overdueVO.overdueMax!=null">
+                AND DATEDIFF(CURDATE(),DATE( ap.repertory_out_time )) &lt;= #{overdueVO.overdueMax}
+            </if>
+            <if test="overdueVO!=null and overdueVO.orderId!=null and overdueVO.orderId!=''">
+                and a.order_id = #{overdueVO.orderId}
+            </if>
+            <if test="overdueVO!=null and overdueVO.productionNo!=null and overdueVO.productionNo!=''">
+                and ap.production_no like concat ('%',#{overdueVO.productionNo},'%')
+            </if>
+            <if test="overdueVO!=null and overdueVO.principal!=null and overdueVO.principal!=''">
+                and u1.name like concat ('%',#{overdueVO.principal},'%')
+            </if>
+            <if test="overdueVO!=null and overdueVO.userIds!=null and overdueVO.userIds.size!=0">
             and a.client_manager_id in
-            <foreach collection="overdueVO.userIds" open="(" close=")" separator="," item="userId">
-                #{userId}
-            </foreach>
-        </if>
+                <foreach collection="overdueVO.userIds" open="(" close=")" separator="," item="userId">
+                    #{userId}
+                </foreach>
+            </if>
+        </where>
         order by overdueDay desc
     </sql>