|
@@ -15,12 +15,12 @@
|
|
|
hour
|
|
|
from (select num,date,hour
|
|
|
from ctop_pangolin_report_app_hour appHourActive
|
|
|
- left join ctop_pangolin_app app on app.id = appHourActive.app_id
|
|
|
- left join ctop_bind_account_login login on login.account_name = app.account_name
|
|
|
+ left join ctop_pangolin_app app on app.app_id = appHourActive.app_id
|
|
|
+ left join ctop_bind_account_login login on login.account_name = appHourActive.account_name
|
|
|
where appHourActive.type = #{type}
|
|
|
and date = #{today} and hour = #{hour}
|
|
|
<if test="appId!=null">
|
|
|
- and app.id = #{appId}
|
|
|
+ and app.app_id = #{appId}
|
|
|
</if>
|
|
|
<if test="userId!=null">
|
|
|
and login.user_id = #{userId}
|
|
@@ -28,7 +28,7 @@ and date = #{today} and hour = #{hour}
|
|
|
<if test="accountNames!=null or projectIds!=null">
|
|
|
and ( 1=0
|
|
|
<if test="accountNames!=null">
|
|
|
- or login.account_name in
|
|
|
+ or appHourActive.account_name in
|
|
|
<foreach item="item" index="index" collection="accountNames" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -44,12 +44,12 @@ and date = #{today} and hour = #{hour}
|
|
|
group by appHourActive.date, appHourActive.hour
|
|
|
union all select num,date,hour
|
|
|
from ctop_pangolin_report_app_hour appHourActive
|
|
|
- left join ctop_pangolin_app app on app.id = appHourActive.app_id
|
|
|
- left join ctop_bind_account_login login on login.account_name = app.account_name
|
|
|
+ left join ctop_pangolin_app app on app.app_id = appHourActive.app_id
|
|
|
+ left join ctop_bind_account_login login on login.account_name = appHourActive.account_name
|
|
|
where appHourActive.type = #{type}
|
|
|
and date = #{yesterday} and hour = #{hour}
|
|
|
<if test="appId!=null">
|
|
|
- and app.id = #{appId}
|
|
|
+ and app.app_id = #{appId}
|
|
|
</if>
|
|
|
<if test="userId!=null">
|
|
|
and login.user_id = #{userId}
|
|
@@ -57,7 +57,7 @@ where appHourActive.type = #{type}
|
|
|
<if test="accountNames!=null or projectIds!=null">
|
|
|
and ( 1=0
|
|
|
<if test="accountNames!=null">
|
|
|
- or login.account_name in
|
|
|
+ or appHourActive.account_name in
|
|
|
<foreach item="item" index="index" collection="accountNames" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -73,12 +73,12 @@ where appHourActive.type = #{type}
|
|
|
group by appHourActive.date, appHourActive.hour
|
|
|
union all select num,date,hour
|
|
|
from ctop_pangolin_report_app_hour appHourActive
|
|
|
- left join ctop_pangolin_app app on app.id = appHourActive.app_id
|
|
|
- left join ctop_bind_account_login login on login.account_name = app.account_name
|
|
|
+ left join ctop_pangolin_app app on app.app_id = appHourActive.app_id
|
|
|
+ left join ctop_bind_account_login login on login.account_name = appHourActive.account_name
|
|
|
where appHourActive.type = #{type}
|
|
|
and date = #{sevenDaysAgo} and hour = #{hour}
|
|
|
<if test="appId!=null">
|
|
|
- and app.id = #{appId}
|
|
|
+ and app.app_id = #{appId}
|
|
|
</if>
|
|
|
<if test="userId!=null">
|
|
|
and login.user_id = #{userId}
|
|
@@ -86,7 +86,7 @@ where appHourActive.type = #{type}
|
|
|
<if test="accountNames!=null or projectIds!=null">
|
|
|
and ( 1=0
|
|
|
<if test="accountNames!=null">
|
|
|
- or login.account_name in
|
|
|
+ or appHourActive.account_name in
|
|
|
<foreach item="item" index="index" collection="accountNames" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -104,8 +104,8 @@ where appHourActive.type = #{type}
|
|
|
union all
|
|
|
select num,date,hour
|
|
|
from ctop_pangolin_report_app_hour appHourActive
|
|
|
- left join ctop_pangolin_app app on app.id = appHourActive.app_id
|
|
|
- left join ctop_bind_account_login login on login.account_name = app.account_name
|
|
|
+ left join ctop_pangolin_app app on app.app_id = appHourActive.app_id
|
|
|
+ left join ctop_bind_account_login login on login.account_name = appHourActive.account_name
|
|
|
where appHourActive.type = #{type}
|
|
|
and date = #{compareTime1} and hour = #{hour}
|
|
|
<if test="appId!=null">
|
|
@@ -117,7 +117,7 @@ where appHourActive.type = #{type}
|
|
|
<if test="accountNames!=null or projectIds!=null">
|
|
|
and ( 1=0
|
|
|
<if test="accountNames!=null">
|
|
|
- or login.account_name in
|
|
|
+ or appHourActive.account_name in
|
|
|
<foreach item="item" index="index" collection="accountNames" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -136,12 +136,12 @@ where appHourActive.type = #{type}
|
|
|
union all
|
|
|
select num,date,hour
|
|
|
from ctop_pangolin_report_app_hour appHourActive
|
|
|
- left join ctop_pangolin_app app on app.id = appHourActive.app_id
|
|
|
- left join ctop_bind_account_login login on login.account_name = app.account_name
|
|
|
+ left join ctop_pangolin_app app on app.app_id = appHourActive.app_id
|
|
|
+ left join ctop_bind_account_login login on login.account_name = appHourActive.account_name
|
|
|
where appHourActive.type = #{type}
|
|
|
and date = #{compareTime2} and hour = #{hour}
|
|
|
<if test="appId!=null">
|
|
|
- and app.id = #{appId}
|
|
|
+ and app.app_id = #{appId}
|
|
|
</if>
|
|
|
<if test="userId!=null">
|
|
|
and login.user_id = #{userId}
|
|
@@ -149,7 +149,7 @@ where appHourActive.type = #{type}
|
|
|
<if test="accountNames!=null or projectIds!=null">
|
|
|
and ( 1=0
|
|
|
<if test="accountNames!=null">
|
|
|
- or login.account_name in
|
|
|
+ or appHourActive.account_name in
|
|
|
<foreach item="item" index="index" collection="accountNames" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|