Dashboard count 0으로 나누기 오류 수정
parent
d2901908c8
commit
ca9dd81dc1
|
|
@ -23,7 +23,7 @@ const AnalyticEcommerce = ({ color, title, count, percentage, isLoss, extra }) =
|
|||
{count}
|
||||
</Typography>
|
||||
</Grid>
|
||||
{percentage && (
|
||||
{percentage !== undefined && (
|
||||
<Grid item>
|
||||
<Chip
|
||||
variant="combined"
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ function EgovAdminDashboard(props) {
|
|||
<Grid item xs={12} md={7} lg={8}>
|
||||
<Grid container alignItems="center" justifyContent="space-between">
|
||||
<Grid item>
|
||||
<Typography variant="h5">최근 문의사항</Typography>
|
||||
<Typography variant="h5">미답변 문의사항</Typography>
|
||||
</Grid>
|
||||
<Grid item />
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,11 @@ public interface DashboardRepository extends JpaRepository<TnDailyMenuLog, Long>
|
|||
") " +
|
||||
"SELECT " +
|
||||
" this_month_cnt, " +
|
||||
" ROUND(((CAST(this_month_cnt AS NUMERIC) - last_month_cnt) / last_month_cnt * 100), 1) AS ratio, " +
|
||||
" CASE " +
|
||||
" WHEN last_month_cnt = 0 AND this_month_cnt = 0 THEN 0" +
|
||||
" WHEN last_month_cnt = 0 THEN 100" +
|
||||
" ELSE ROUND(((CAST(this_month_cnt AS NUMERIC) - last_month_cnt) / last_month_cnt * 100), 1)" +
|
||||
" END AS ratio, " +
|
||||
" last_month_cnt " +
|
||||
"FROM this_month_logs, last_month_logs", nativeQuery = true)
|
||||
List<Object[]> ConnMonthlyCount();
|
||||
|
|
@ -44,7 +48,11 @@ public interface DashboardRepository extends JpaRepository<TnDailyMenuLog, Long>
|
|||
") " +
|
||||
"SELECT " +
|
||||
" this_month_cnt, " +
|
||||
" ROUND(((CAST(this_month_cnt AS NUMERIC) - last_month_cnt) / last_month_cnt * 100), 1) AS ratio, " +
|
||||
" CASE " +
|
||||
" WHEN last_month_cnt = 0 AND this_month_cnt = 0 THEN 0" +
|
||||
" WHEN last_month_cnt = 0 THEN 100" +
|
||||
" ELSE ROUND(((CAST(this_month_cnt AS NUMERIC) - last_month_cnt) / last_month_cnt * 100), 1) " +
|
||||
" END AS ratio, " +
|
||||
" last_month_cnt " +
|
||||
"FROM this_month_logs, last_month_logs", nativeQuery = true)
|
||||
List<Object[]> DocuMonthlyCount();
|
||||
|
|
|
|||
Loading…
Reference in New Issue