Pārlūkot izejas kodu

作者:张哲
时间:2023/03/27
类型:开发
描述:里程碑(3) 处理删除的一级分类也要统计的情况

zizg 1 gadu atpakaļ
vecāks
revīzija
03f5df6b9b

+ 6 - 4
src/main/resources/mapper/knowledge/analysis/AnalysisAlbumMapper.xml

@@ -56,14 +56,16 @@
         </where>
         group by COMPANY_ID) a
         full join
-        (select COMPANY_ID_ as companyId, count(*) album from KM_ALBUM_INFO
+        (select users.COMPANY_ID_ as companyId, count(*) album from KM_ALBUM_INFO album
+        join LEARNING_USER_DEV.OS_USER users
+        on album.UPDATE_BY_ = users.USER_ID_
         <where>
             <if test="firstDay != null and lastDay != null">
-                and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') &gt;= #{firstDay}
-                and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') &lt;= #{lastDay}
+                and TO_CHAR(album.CREATE_TIME_,'yyyy-mm-dd') &gt;= #{firstDay}
+                and TO_CHAR(album.CREATE_TIME_,'yyyy-mm-dd') &lt;= #{lastDay}
             </if>
         </where>
-        group by COMPANY_ID_) b
+        group by users.COMPANY_ID_) b
         using (companyId)
         )
         order by album desc

+ 6 - 4
src/main/resources/mapper/knowledge/analysis/AnalysisMapMapper.xml

@@ -50,14 +50,16 @@
         </where>
         group by COMPANY_ID) a
         full join
-        (select COMPANY_ID_ as companyId, count(*) map from KM_MAP
+        (select users.COMPANY_ID_ as companyId, count(*) map from KM_MAP map
+        join LEARNING_USER_DEV.OS_USER users
+        on map.UPDATE_BY_ = users.USER_ID_
         <where>
             <if test="firstDay != null and lastDay != null">
-                and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') &gt;= #{firstDay}
-                and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') &lt;= #{lastDay}
+                and TO_CHAR(map.CREATE_TIME_,'yyyy-mm-dd') &gt;= #{firstDay}
+                and TO_CHAR(map.CREATE_TIME_,'yyyy-mm-dd') &lt;= #{lastDay}
             </if>
         </where>
-        group by COMPANY_ID_) b
+        group by users.COMPANY_ID_) b
         using (companyId)
         )
         order by map desc