추가
This commit is contained in:
@@ -21,12 +21,24 @@ export default defineEventHandler(async (event) => {
|
||||
throw createError({ statusCode: 404, message: '취합 보고서를 찾을 수 없습니다.' })
|
||||
}
|
||||
|
||||
// 개별 보고서 목록
|
||||
// 개별 보고서 목록 (새 구조: 마스터 + 프로젝트별 실적 조인)
|
||||
const reports = await query(`
|
||||
SELECT r.*, e.employee_name as author_name, e.employee_position
|
||||
FROM wr_weekly_report_detail r
|
||||
SELECT
|
||||
r.report_id,
|
||||
r.author_id,
|
||||
e.employee_name as author_name,
|
||||
e.employee_position,
|
||||
r.issue_description,
|
||||
r.vacation_description,
|
||||
r.remark_description,
|
||||
r.report_status,
|
||||
r.submitted_at,
|
||||
rp.work_description,
|
||||
rp.plan_description
|
||||
FROM wr_weekly_report r
|
||||
JOIN wr_weekly_report_project rp ON r.report_id = rp.report_id
|
||||
JOIN wr_employee_info e ON r.author_id = e.employee_id
|
||||
WHERE r.project_id = $1 AND r.report_year = $2 AND r.report_week = $3
|
||||
WHERE rp.project_id = $1 AND r.report_year = $2 AND r.report_week = $3
|
||||
ORDER BY e.employee_name
|
||||
`, [summary.project_id, summary.report_year, summary.report_week])
|
||||
|
||||
@@ -41,7 +53,6 @@ export default defineEventHandler(async (event) => {
|
||||
weekStartDate: summary.week_start_date,
|
||||
weekEndDate: summary.week_end_date,
|
||||
memberCount: summary.member_count,
|
||||
totalWorkHours: summary.total_work_hours,
|
||||
reviewerId: summary.reviewer_id,
|
||||
reviewerName: summary.reviewer_name,
|
||||
reviewerComment: summary.reviewer_comment,
|
||||
@@ -56,8 +67,8 @@ export default defineEventHandler(async (event) => {
|
||||
workDescription: r.work_description,
|
||||
planDescription: r.plan_description,
|
||||
issueDescription: r.issue_description,
|
||||
vacationDescription: r.vacation_description,
|
||||
remarkDescription: r.remark_description,
|
||||
workHours: r.work_hours,
|
||||
reportStatus: r.report_status,
|
||||
submittedAt: r.submitted_at
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user