Commit 410c74c6 authored by Administrator's avatar Administrator

修改了下载交接单的方法

parent ecddba2d
......@@ -180,5 +180,4 @@ public class ReceiptListEntity {
}
}
......@@ -29,7 +29,7 @@
WITH
t_county
AS(
SELECT COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,SUM(COUNTY_LIST.OUT_STORAGE_COUNT) AS TYPE_COUNT,floor(SUM(COUNTY_LIST.OUT_STORAGE_COUNT)/250)+1 AS BOX_COUNT,SAVE_DATE
SELECT COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,SUM(COUNTY_LIST.OUT_STORAGE_COUNT) AS TYPE_COUNT,floor(SUM(COUNTY_LIST.OUT_STORAGE_COUNT)/250)+1 AS boxCount,SAVE_DATE
FROM (SELECT CARD_TYPE_ID,CARD_TYPE FROM CARD_TYPE_DIC GROUP BY CARD_TYPE_ID,CARD_TYPE ) CARD_TYPE_DIC
LEFT JOIN (SELECT TASK_ID,CARD_TYPE FROM TASK GROUP BY TASK_ID,CARD_TYPE) TASK ON CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE
LEFT JOIN (SELECT COUNTY_CODE,TASK_ID,OUT_STORAGE_COUNT,SAVE_DATE FROM COUNTY_LIST GROUP BY COUNTY_CODE,TASK_ID,OUT_STORAGE_COUNT,SAVE_DATE) COUNTY_LIST ON COUNTY_LIST.TASK_ID = TASK.TASK_ID
......@@ -38,7 +38,7 @@
),
t_total_count
AS(
SELECT * FROM (SELECT COUNTYNAME,CARD_TYPE,TYPE_COUNT,BOX_COUNT,SAVE_DATE FROM t_county) PIVOT(SUM(TYPE_COUNT) FOR CARD_TYPE IN ('普通证' AS PTZ,'快证' AS KZ,'省内异地快速通道邮' AS YDKSY,'省内异地快速通道
SELECT * FROM (SELECT COUNTYNAME,CARD_TYPE,TYPE_COUNT,boxCount,SAVE_DATE FROM t_county) PIVOT(SUM(TYPE_COUNT) FOR CARD_TYPE IN ('普通证' AS PTZ,'快证' AS KZ,'省内异地快速通道邮' AS YDKSY,'省内异地快速通道
普' AS YDKSP,'省内异地邮' AS YDY,'省内异地普' AS YDP,'军人证' AS JRZ,'快速通道普' AS KSP,'快速通道邮' AS KSY,'邮寄证' AS YJZ))
),
county_xiaoji
......@@ -57,7 +57,7 @@
SUM(KSY)KSY,
SUM(YJZ)YJZ,
SUM(XIAOJI)XIAOJI,
SUM(BOX_COUNT)BOX_COUNT
SUM(boxCount)boxCount
FROM t_total_count,county_xiaoji WHERE t_total_count.COUNTYNAME=county_xiaoji.COUNTYNAME AND substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8) >= #{startDate} AND #{endDate} >= substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8)
GROUP BY ROLLUP(t_total_count.COUNTYNAME)
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment