koushanshan 1 год назад
Родитель
Сommit
3bc26fe780
1 измененных файлов с 23 добавлено и 2 удалено
  1. 23 2
      src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml

+ 23 - 2
src/main/java/com/dk/mdm/mapper/report/ReportMapper.xml

@@ -1860,7 +1860,13 @@
     <select id="getDailyReconciliationReportCount" resultType="java.lang.Long">
         SELECT count(1)
         FROM
-        dkic_b.t_psi_order tpo
+        FROM dkic_b.t_mac_account_item as T
+        left join (select sum(tpo.sum_amount) as totalOrderAmount ,tpo.cus_id from dkic_b.t_psi_order tpo group by tpo.cus_id ) ord on ord.cus_id =T.object_id
+        left join dkic_b.t_mac_other_receivable as tmor on tmor.receivable_id = t.biznis_id and t.biznis_type = 't_mac_other_receivable'
+        left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.object_id
+        left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
+        left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
+        left join sys.t_data_kind as tdk1 on t.rec_status = tdk1.kind_code
         <include refid="ConditionDailyReconciliationReport"/>
     </select>
 
@@ -1868,7 +1874,22 @@
     <sql id="ConditionDailyReconciliationReport">
         <where>
             <if test="cpId != null">
-                tpo.cp_id = #{cpId}
+                T.cp_id = #{cpId}
+            </if>
+            <if test="staffId != null">
+                T.staff_id = #{staffId}
+            </if>
+            <if test="orgId != null">
+                T.org_id = #{orgId}
+            </if>
+            <if test="object_id != null">
+                T.object_id = #{object_id}
+            </if>
+            <if test="accDateStart != null">
+                AND T.acc_date &gt;= #{accDateStart}::timestamp with time zone
+            </if>
+            <if test="accDateEnd != null">
+                AND T.acc_date &lt; #{accDateEnd}::timestamp with time zone + interval '1 day'
             </if>
         </where>
     </sql>