select decode(dt.LATN_ID ,290,'西安','910','咸阳',911,'延安',912,'榆林',913,'渭南',914,'商洛',915,'安康',
916,'汉中',917,'宝鸡',919,'铜川') LATN_ID ,to_number(nvl(dt.dt,0))dt,to_number(nvl(wx.wx,0))wx,to_number(nvl(wap.wap,0))wap,to_number(nvl(day_sums.day_sums,0))day_sums,to_number(nvl(dt_month_sum.dt_month_sum,0))dt_month_sum,
to_number(nvl(wx_month_sum.wx_month_sum,0))wx_month_sum,to_number(nvl(wap_month_sum.wap_month_sum,0))wap_month_sum,to_number(nvl(month_sums,0))month_sums,
to_number(nvl(yearSum.yearSum,0))yearSum from ((SELECT T.LATN_ID,COUNT(*)dt
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID) dt left join (SELECT T.LATN_ID,COUNT(*) wx
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID)wx on wx.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wap
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap on wap.LATN_ID=dt.LATN_ID left join(
select LATN_ID, sum(to_number(nvl(dt,0))+to_number(nvl(wap,0))+to_number(nvl(wx,0))) day_sums from (
select dt.LATN_ID,to_number(nvl(dt.dt,0))dt,to_number(nvl(wx.wx,0))wx,to_number(nvl(wap.wap,0))wap,to_number(nvl(dt_month_sum.dt_month_sum,0))dt_month_sum,
to_number(nvl(wx_month_sum.wx_month_sum,0))wx_month_sum, to_number(nvl(wap_month_sum.wap_month_sum,0))wap_month_sum,
to_number(nvl(yearSum.yearSum,0))yearSum from ((SELECT T.LATN_ID,COUNT(*)dt
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID) dt left join (SELECT T.LATN_ID,COUNT(*) wx
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID)wx on wx.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wap
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap on wap.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)dt_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) dt_month_sum on dt.LATN_ID=dt_month_sum.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wx_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) wx_month_sum on dt.LATN_ID=wx_month_sum.LATN_ID left join (
SELECT T.LATN_ID ,COUNT(*) wap_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap_month_sum on wap_month_sum.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID ,COUNT(*) yearSum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,4),'yyyy')= to_date(substr(#{end_time},1,4),'yyyy')
and productid in ('1629712')
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) yearSum on yearSum.LATN_ID=dt.LATN_ID
)) GROUP BY LATN_ID
ORDER BY LATN_ID
)day_sums on day_sums.LATN_ID=dt.LATN_ID left join
(
SELECT T.LATN_ID,COUNT(*)dt_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) dt_month_sum on dt.LATN_ID=dt_month_sum.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wx_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) wx_month_sum on dt.LATN_ID=wx_month_sum.LATN_ID left join (
SELECT T.LATN_ID ,COUNT(*) wap_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap_month_sum on wap_month_sum.LATN_ID=dt.LATN_ID
left join(
select LATN_ID, sum(to_number(nvl(dt_month_sum,0))+to_number(nvl(wap_month_sum,0))+to_number(nvl(wx_month_sum,0))) month_sums from (
select dt.LATN_ID,to_number(nvl(dt.dt,0))dt,to_number(nvl(wx.wx,0))wx,to_number(nvl(wap.wap,0))wap,to_number(nvl(dt_month_sum.dt_month_sum,0))dt_month_sum,
to_number(nvl(wx_month_sum.wx_month_sum,0))wx_month_sum,to_number(nvl(wap_month_sum.wap_month_sum,0))wap_month_sum,
to_number(nvl(yearSum.yearSum,0))yearSum from ((SELECT T.LATN_ID,COUNT(*)dt
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID) dt left join (SELECT T.LATN_ID,COUNT(*) wx
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID)wx on wx.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wap
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap on wap.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)dt_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) dt_month_sum on dt.LATN_ID=dt_month_sum.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wx_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) wx_month_sum on dt.LATN_ID=wx_month_sum.LATN_ID left join (
SELECT T.LATN_ID ,COUNT(*) wap_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap_month_sum on wap_month_sum.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID ,COUNT(*) yearSum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,4),'yyyy')= to_date(substr(#{end_time},1,4),'yyyy')
and productid in ('1629712')
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) yearSum on yearSum.LATN_ID=dt.LATN_ID
)) GROUP BY LATN_ID
ORDER BY LATN_ID
)month_sums on month_sums.LATN_ID=dt.LATN_ID
left join (
SELECT T.LATN_ID ,COUNT(*) yearSum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,4),'yyyy')= to_date(substr(#{end_time},1,4),'yyyy')
and productid in ('1629712')
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) yearSum on yearSum.LATN_ID=dt.LATN_ID
)
union select '全省' as LATN_ID ,sum(dt),sum(wx),sum(wap),sum(day_sums),sum(dt_month_sum),sum(wx_month_sum),sum(wap_month_sum),
sum(month_sums),sum(yearSum) from
(
select dt.LATN_ID,to_number(dt.dt)dt,to_number(wx.wx)wx,to_number(wap.wap)wap,to_number(day_sums.day_sums)day_sums,to_number(dt_month_sum.dt_month_sum)dt_month_sum,
to_number(wx_month_sum.wx_month_sum)wx_month_sum,to_number(wap_month_sum.wap_month_sum)wap_month_sum,to_number(month_sums)month_sums,
to_number(yearSum.yearSum)yearSum from ((SELECT T.LATN_ID,COUNT(*)dt
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID) dt left join (SELECT T.LATN_ID,COUNT(*) wx
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID)wx on wx.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wap
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap on wap.LATN_ID=dt.LATN_ID left join(
select LATN_ID, sum(to_number(dt)+to_number(wx)+to_number(wap)) day_sums from (
select dt.LATN_ID,to_number(nvl(dt.dt,0))dt,to_number(nvl(wx.wx,0))wx,to_number(nvl(wap.wap,0))wap,to_number(nvl(dt_month_sum.dt_month_sum,0))dt_month_sum,
to_number(nvl(wx_month_sum.wx_month_sum,0))wx_month_sum,to_number(nvl(wap_month_sum.wap_month_sum,0))wap_month_sum,
to_number(nvl(yearSum.yearSum,0))yearSum from ((SELECT T.LATN_ID,COUNT(*)dt
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID) dt left join (SELECT T.LATN_ID,COUNT(*) wx
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID)wx on wx.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wap
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,8),'yyyy-MM-dd') = to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap on wap.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)dt_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(t.query_time,1,6),'yyyy-MM') = to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) dt_month_sum on dt.LATN_ID=dt_month_sum.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wx_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) wx_month_sum on dt.LATN_ID=wx_month_sum.LATN_ID left join (
SELECT T.LATN_ID ,COUNT(*) wap_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap_month_sum on wap_month_sum.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID ,COUNT(*) yearSum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,4),'yyyy')= to_date(substr(#{end_time},1,4),'yyyy')
and productid in ('1629712')
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) yearSum on yearSum.LATN_ID=dt.LATN_ID
)) GROUP BY LATN_ID
ORDER BY LATN_ID
)day_sums on day_sums.LATN_ID=dt.LATN_ID left join
(
SELECT T.LATN_ID,COUNT(*)dt_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) dt_month_sum on dt.LATN_ID=dt_month_sum.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wx_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) wx_month_sum on dt.LATN_ID=wx_month_sum.LATN_ID left join (
SELECT T.LATN_ID ,COUNT(*) wap_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap_month_sum on wap_month_sum.LATN_ID=dt.LATN_ID
left join(
select LATN_ID, sum(to_number(dt_month_sum)+to_number(wx_month_sum)+to_number(wap_month_sum)) month_sums from (
select dt.LATN_ID,to_number(nvl(dt.dt,0))dt,to_number(nvl(wx.wx,0))wx,to_number(nvl(wap.wap,0))wap,to_number(nvl(dt_month_sum.dt_month_sum,0))dt_month_sum,
to_number(nvl(wx_month_sum.wx_month_sum,0))wx_month_sum,to_number(nvl(wap_month_sum.wap_month_sum,0))wap_month_sum,
to_number(nvl( yearSum.yearSum,0))yearSum from ((SELECT T.LATN_ID,COUNT(*)dt
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,8),'yyyy-MM-dd')= to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID) dt left join (SELECT T.LATN_ID,COUNT(*) wx
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,8),'yyyy-MM-dd')= to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID)wx on wx.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wap
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,8),'yyyy-MM-dd')= to_date(#{end_time},'yyyy-MM-dd')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap on wap.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)dt_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='3'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) dt_month_sum on dt.LATN_ID=dt_month_sum.LATN_ID left join (
SELECT T.LATN_ID,COUNT(*)wx_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='4'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) wx_month_sum on dt.LATN_ID=wx_month_sum.LATN_ID left join (
SELECT T.LATN_ID ,COUNT(*) wap_month_sum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,6),'yyyy-MM')= to_date(substr(#{end_time},1,7),'yyyy-MM')
and productid in ('1629712')
and channel ='2'
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
)wap_month_sum on wap_month_sum.LATN_ID=dt.LATN_ID left join (
SELECT T.LATN_ID ,COUNT(*) yearSum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,4),'yyyy')= to_date(substr(#{end_time},1,4),'yyyy')
and productid in ('1629712')
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) yearSum on yearSum.LATN_ID=dt.LATN_ID
)) GROUP BY LATN_ID
ORDER BY LATN_ID
)month_sums on month_sums.LATN_ID=dt.LATN_ID
left join (
SELECT T.LATN_ID ,COUNT(*) yearSum
FROM wsscmsuser.TB_APP_FLOW_PACKAGE_DATA_1 T
WHERE T.SUCCESS = '0'
and to_date(substr(query_time,1,4),'yyyy')= to_date(substr(#{end_time},1,4),'yyyy')
and productid in ('1629712')
GROUP BY T.LATN_ID
ORDER BY T.LATN_ID
) yearSum on yearSum.LATN_ID=dt.LATN_ID
)
) ORDER BY LATN_ID desc
转载于:https://www.cnblogs.com/qxqbk/p/7117608.html