30 lines
1.2 KiB
JavaScript
30 lines
1.2 KiB
JavaScript
const sequelize = require('../../../config/sequelize.conf');
|
|
|
|
const { QueryTypes } = require('sequelize');
|
|
|
|
|
|
const get = async(req, res) => {
|
|
// res.json({
|
|
// message: "Listo"
|
|
// });
|
|
//console.log(req["tipo"].value);
|
|
await sequelize.query(`
|
|
SELECT I.noInventario, AF.activoFijo, E.modelo, M.marca, E.noSerie, E.procesador, E.vProcesador, E.hdd, E.memoriasz, E.memoria, E.vMemoria, E.graficos, OS.osname, I.noResguardo, UR.uResponsable, UR.nombreResponsable, Ub.ubicacion, U.uso
|
|
FROM inventario I
|
|
INNER JOIN activoFijo AF ON AF.idActivoFijo = I.idActivoFijo
|
|
INNER JOIN equipo E ON E.noInventario = I.noInventario
|
|
INNER JOIN marca M ON M.idMarca = E.idMarca
|
|
INNER JOIN OS ON OS.idOS = E.idOS
|
|
INNER JOIN uResponsable UR ON UR.idUnidadResponsable = I.idUnidadResponsable
|
|
INNER JOIN ubicacion Ub ON Ub.idUbicacion = I.idUbicacion
|
|
INNER JOIN uso U ON U.idUso = I.idUso
|
|
ORDER BY E.noInventario ASC`, { type: QueryTypes.SELECT })
|
|
.then(equipo => res.json({
|
|
equipo
|
|
}))
|
|
.catch(error => res.status(500).json({
|
|
error
|
|
}));
|
|
}
|
|
|
|
module.exports = get; |