|
@@ -219,7 +219,8 @@ module.exports.getselectionData = async (req, res) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- const query3 = "SELECT person_id,person_name FROM person_details";
|
|
|
|
|
|
+ // const query3 = "SELECT person_id,person_name FROM person_details";
|
|
|
|
+ const query3 = "SELECT id_fun_person as person_id, person_name FROM function_person_details";
|
|
const queryresult3 = await db.executequery(query3);
|
|
const queryresult3 = await db.executequery(query3);
|
|
|
|
|
|
if (queryresult3.length > 0) {
|
|
if (queryresult3.length > 0) {
|
|
@@ -228,7 +229,8 @@ module.exports.getselectionData = async (req, res) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- const query4 = "SELECT func_id,func_name FROM function_details";
|
|
|
|
|
|
+ // const query4 = "SELECT func_id,func_name FROM function_details";
|
|
|
|
+ const query4 = "SELECT fun_id as func_id, fun_name as func_name FROM function_details";
|
|
const queryresult4 = await db.executequery(query4);
|
|
const queryresult4 = await db.executequery(query4);
|
|
|
|
|
|
if (queryresult4.length > 0) {
|
|
if (queryresult4.length > 0) {
|
|
@@ -2613,12 +2615,18 @@ module.exports.mappingFuncIDToPersonNames = async (req, res) => {
|
|
const func_id = req.query.func_id;
|
|
const func_id = req.query.func_id;
|
|
|
|
|
|
// SQL query to get all persons mapped to the given func_id
|
|
// SQL query to get all persons mapped to the given func_id
|
|
|
|
+ // const queryFunctionPersonMapping = `
|
|
|
|
+ // SELECT f.func_id, p.person_name
|
|
|
|
+ // FROM dvr_local.function_person_mapping fp
|
|
|
|
+ // JOIN dvr_local.function_details f ON f.func_id = fp.func_id
|
|
|
|
+ // JOIN dvr_local.person_details p ON p.person_id = fp.person_id
|
|
|
|
+ // WHERE fp.func_id = '${func_id}'`;
|
|
const queryFunctionPersonMapping = `
|
|
const queryFunctionPersonMapping = `
|
|
- SELECT f.func_id, p.person_name
|
|
|
|
- FROM dvr_local.function_person_mapping fp
|
|
|
|
- JOIN dvr_local.function_details f ON f.func_id = fp.func_id
|
|
|
|
- JOIN dvr_local.person_details p ON p.person_id = fp.person_id
|
|
|
|
- WHERE fp.func_id = '${func_id}'`;
|
|
|
|
|
|
+ SELECT f.fun_id, p.person_name
|
|
|
|
+ FROM function_person_mapping fp
|
|
|
|
+ JOIN function_details f ON f.fun_id = fp.fun_id
|
|
|
|
+ JOIN function_person_details p ON p.id_fun_person = fp.id_fun_person
|
|
|
|
+ WHERE fp.fun_id = ${func_id};`
|
|
|
|
|
|
console.log("queryFunctionPersonMapping", queryFunctionPersonMapping);
|
|
console.log("queryFunctionPersonMapping", queryFunctionPersonMapping);
|
|
|
|
|