|
|
@@ -36,46 +36,22 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectArchiveYearStatistics" resultType="com.gz.rvo.statistics.ArchiveYearStatisticsRVO">
|
|
|
- SELECT a1.gdnd
|
|
|
- , (
|
|
|
- SELECT count(a.id)
|
|
|
- FROM tab_archives a
|
|
|
- WHERE a1.`gdnd` = a.gdnd
|
|
|
- AND a.deleted = 0
|
|
|
+ select t1.gdnd, count(t1.id) archive_count,sum(file_count) file_count
|
|
|
+ from tab_archives t1
|
|
|
+ left join (select archive_id,count(id) file_count
|
|
|
+ from tab_archive_file t where t.deleted = 0
|
|
|
+ ) t2 on t1.id = t2.archive_id
|
|
|
+ where t1.deleted = 0
|
|
|
<if test="mlCodes != null and mlCodes.size > 0">
|
|
|
- AND a.ml in
|
|
|
+ AND t1.ml in
|
|
|
<foreach collection="mlCodes" item="item" index="index" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="bgqx != null and bgqx != ''">
|
|
|
- and a.bgqx=#{bgqx}
|
|
|
+ and t1.bgqx=#{bgqx}
|
|
|
</if>
|
|
|
- ) AS archive_count
|
|
|
- , (
|
|
|
- SELECT count(af.id)
|
|
|
- FROM tab_archives a
|
|
|
- LEFT JOIN tab_archive_file af ON a.id = af.archive_id
|
|
|
- WHERE a1.`gdnd` = a.gdnd
|
|
|
- AND a.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>
|
|
|
- <if test="bgqx != null and bgqx != ''">
|
|
|
- and a.bgqx=#{bgqx}
|
|
|
- </if>
|
|
|
- ) AS file_count
|
|
|
- FROM tab_archives a1
|
|
|
- <where>
|
|
|
- <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
|
|
- AND a1.gdnd BETWEEN #{startTime} AND #{endTime}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- GROUP BY a1.gdnd
|
|
|
+ group by t1.gdnd
|
|
|
</select>
|
|
|
|
|
|
<select id="selectBorrowStatistics" resultType="com.gz.rvo.statistics.BorrowStatisticsRVO">
|