修正詳細評審頁面結果
This commit is contained in:
61
check-strength-improvement.js
Normal file
61
check-strength-improvement.js
Normal file
@@ -0,0 +1,61 @@
|
||||
const mysql = require('mysql2/promise');
|
||||
|
||||
const dbConfig = {
|
||||
host: 'mysql.theaken.com',
|
||||
port: 33306,
|
||||
user: 'root',
|
||||
password: 'zh6161168',
|
||||
database: 'db_AI_scoring'
|
||||
};
|
||||
|
||||
async function checkStrengthImprovement() {
|
||||
let connection;
|
||||
try {
|
||||
console.log('🔗 連接到資料庫...');
|
||||
connection = await mysql.createConnection(dbConfig);
|
||||
console.log('✅ 資料庫連接成功');
|
||||
|
||||
// 檢查 strength 類型的數據
|
||||
console.log('💪 檢查 strength 類型的數據...');
|
||||
const [strengthData] = await connection.execute(`
|
||||
SELECT ef.id, ef.evaluation_id, ef.criteria_item_id, ef.content, ci.name as criteria_name
|
||||
FROM evaluation_feedback ef
|
||||
LEFT JOIN criteria_items ci ON ef.criteria_item_id = ci.id
|
||||
WHERE ef.evaluation_id = 2 AND ef.feedback_type = 'strength'
|
||||
ORDER BY ef.criteria_item_id, ef.sort_order
|
||||
`);
|
||||
console.log('優點數據:', strengthData);
|
||||
|
||||
// 檢查 improvement 類型的數據
|
||||
console.log('🔧 檢查 improvement 類型的數據...');
|
||||
const [improvementData] = await connection.execute(`
|
||||
SELECT ef.id, ef.evaluation_id, ef.criteria_item_id, ef.content, ci.name as criteria_name
|
||||
FROM evaluation_feedback ef
|
||||
LEFT JOIN criteria_items ci ON ef.criteria_item_id = ci.id
|
||||
WHERE ef.evaluation_id = 2 AND ef.feedback_type = 'improvement'
|
||||
ORDER BY ef.criteria_item_id, ef.sort_order
|
||||
`);
|
||||
console.log('改進建議數據:', improvementData);
|
||||
|
||||
// 檢查 criteria 類型的數據(AI 評語)
|
||||
console.log('💬 檢查 criteria 類型的數據(AI 評語)...');
|
||||
const [criteriaData] = await connection.execute(`
|
||||
SELECT ef.id, ef.evaluation_id, ef.criteria_item_id, ef.content, ci.name as criteria_name
|
||||
FROM evaluation_feedback ef
|
||||
LEFT JOIN criteria_items ci ON ef.criteria_item_id = ci.id
|
||||
WHERE ef.evaluation_id = 2 AND ef.feedback_type = 'criteria'
|
||||
ORDER BY ef.criteria_item_id, ef.sort_order
|
||||
`);
|
||||
console.log('AI 評語數據:', criteriaData);
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ 錯誤:', error.message);
|
||||
} finally {
|
||||
if (connection) {
|
||||
await connection.end();
|
||||
console.log('🔌 資料庫連接已關閉');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkStrengthImprovement();
|
Reference in New Issue
Block a user