feat: 모델 및 데이터베이스 구조 개선

- 모델 파일들의 데이터베이스 연결 및 쿼리 최적화
- 마이그레이션 파일 정리 및 통합
- Docker 설정 파일 추가
- 프로젝트 시작/중지 스크립트 추가
- README 및 문서 업데이트
This commit is contained in:
hyungi
2025-10-27 10:01:12 +09:00
parent f96604b01e
commit 5ff0c7cd60
19 changed files with 13972 additions and 33 deletions

View File

@@ -26,7 +26,7 @@ const getAnalysis = async (startDate, endDate) => {
const summarySql = `
SELECT
COUNT(DISTINCT dwr.project_id) as totalProjects,
COUNT(DISTINCT dwr.worker_id) as totalWorkers,
COUNT(DISTINCT dwr.worker_id) as totalworkers,
COUNT(DISTINCT dwr.task_id) as totalTasks,
SUM(${workHoursCalc}) as totalHours
FROM DailyWorkReports dwr
@@ -48,7 +48,7 @@ const getAnalysis = async (startDate, endDate) => {
const byWorkerSql = `
SELECT w.worker_name as name, SUM(${workHoursCalc}) as hours, COUNT(DISTINCT dwr.project_id) as participants
FROM DailyWorkReports dwr
JOIN Workers w ON dwr.worker_id = w.worker_id
JOIN workers w ON dwr.worker_id = w.worker_id
${whereClause}
GROUP BY w.worker_name
HAVING hours > 0
@@ -74,7 +74,7 @@ const getAnalysis = async (startDate, endDate) => {
(${workHoursCalc}) as work_hours, dwr.memo
FROM DailyWorkReports dwr
JOIN Projects p ON dwr.project_id = p.project_id
JOIN Workers w ON dwr.worker_id = w.worker_id
JOIN workers w ON dwr.worker_id = w.worker_id
JOIN Tasks t ON dwr.task_id = t.task_id
${whereClause}
HAVING work_hours > 0