Browse Source

查询统计》按年归档统计查询bug修复

hanzhen 3 years ago
parent
commit
7749fd6384

+ 0 - 10
src/main/java/com/gz/mapper/statistics/SelectStatisticsMapper.java

@@ -5,24 +5,14 @@ import com.gz.rvo.statistics.ArchiveStatisticsRVO;
 import com.gz.rvo.statistics.ArchiveYearStatisticsRVO;
 import com.gz.rvo.statistics.ArchiveYearStatisticsRVO;
 import com.gz.rvo.statistics.BorrowStatisticsRVO;
 import com.gz.rvo.statistics.BorrowStatisticsRVO;
 import com.gz.vo.statistics.StatisticsVO;
 import com.gz.vo.statistics.StatisticsVO;
-import org.apache.ibatis.annotations.CacheNamespace;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-import org.springframework.cache.annotation.CacheConfig;
-import org.springframework.cache.annotation.Cacheable;
 
 
 import java.util.List;
 import java.util.List;
 
 
-@CacheConfig(cacheNames = "SelectStatisticsMapper")
-@CacheNamespace
 public interface SelectStatisticsMapper{
 public interface SelectStatisticsMapper{
 
 
-    @Cacheable(key ="#p0")
     List<ArchiveStatisticsRVO> selectArchiveStatistics(StatisticsVO vo);
     List<ArchiveStatisticsRVO> selectArchiveStatistics(StatisticsVO vo);
 
 
-    @Cacheable(key ="#p0")
     List<ArchiveYearStatisticsRVO> selectArchiveYearStatistics(StatisticsVO vo);
     List<ArchiveYearStatisticsRVO> selectArchiveYearStatistics(StatisticsVO vo);
 
 
-    @Cacheable(key ="#p0")
     List<BorrowStatisticsRVO> selectBorrowStatistics(StatisticsVO vo);
     List<BorrowStatisticsRVO> selectBorrowStatistics(StatisticsVO vo);
 }
 }

+ 12 - 6
src/main/resources/mapper/selectStatisticsMapper.xml

@@ -42,6 +42,12 @@
             FROM tab_archives a
             FROM tab_archives a
             WHERE a1.`gdnd` = a.gdnd
             WHERE a1.`gdnd` = a.gdnd
               AND a.deleted = 0
               AND a.deleted = 0
+        <if test="mlCodes != null and mlCodes.size > 0">
+            AND a.ml in
+            <foreach collection="mlCodes" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         ) AS archive_count
         ) AS archive_count
              , (
              , (
             SELECT count(af.id)
             SELECT count(af.id)
@@ -50,6 +56,12 @@
             WHERE a1.`gdnd` = a.gdnd
             WHERE a1.`gdnd` = a.gdnd
               AND a.deleted = 0
               AND a.deleted = 0
               AND af.deleted = 0
               AND af.deleted = 0
+            <if test="mlCodes != null and mlCodes.size > 0">
+                AND a.ml in
+                <foreach collection="mlCodes" item="item" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
         ) AS file_count
         ) AS file_count
         FROM tab_archives a1
         FROM tab_archives a1
         <where>
         <where>
@@ -59,12 +71,6 @@
             <if test="bgqx != null and bgqx != ''">
             <if test="bgqx != null and bgqx != ''">
                 and a1.bgqx=#{bgqx}
                 and a1.bgqx=#{bgqx}
             </if>
             </if>
-            <if test="mlCodes != null and mlCodes.size > 0">
-                AND a1.ml in
-                <foreach collection="mlCodes" item="item" index="index" open="(" close=")" separator=",">
-                    #{item}
-                </foreach>
-            </if>
         </where>
         </where>
         GROUP BY a1.gdnd
         GROUP BY a1.gdnd
     </select>
     </select>