Files
performance-evaluation-system/backend/check-manager-relation.ts
2026-04-11 11:51:54 +08:00

20 lines
598 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import * as dotenv from 'dotenv';
dotenv.config();
import pool from './src/config/database';
async function run() {
const [users] = await pool.query<any[]>(
'SELECT user_id, username, name, role, manager_id FROM user ORDER BY role, user_id'
);
console.table(users);
const [perfs] = await pool.query<any[]>(
'SELECT pm.perf_id, pm.user_id, u.name, u.manager_id, pm.month, pm.status FROM performance_month pm JOIN user u ON pm.user_id = u.user_id'
);
console.log('\n绩效记录与管理层关联');
console.table(perfs);
await pool.end();
}
run().catch(console.error);