Files

29 lines
1.0 KiB
JavaScript
Raw Permalink Normal View History

2020-09-16 18:03:09 -05:00
const sequelize = require('../../../config/sequelize.conf');
2020-09-14 18:30:15 -05:00
const { QueryTypes } = require('sequelize');
2020-09-16 18:03:09 -05:00
const get = async(req, res) => {
2020-09-14 18:30:15 -05:00
await sequelize.query(`
2020-09-25 19:13:47 -05:00
SELECT I.noInventario, T.tipo, P.modelo, M.marca, P.noSerie, P. descripcion, I.noResguardo, UR.uResponsable, UR.nombreResponsable, Ub.ubicacion, U.uso
2020-09-14 18:30:15 -05:00
FROM inventario I
INNER JOIN printers P ON P.noInventario = I.noInventario
INNER JOIN marca M ON M.idMarca = P.idMarca
INNER JOIN tipo T ON T.idTipo = P.idTipo
2020-09-25 19:13:47 -05:00
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
2020-10-09 22:32:43 -05:00
ORDER BY P.noInventario ASC
2020-09-14 18:30:15 -05:00
`, { type: QueryTypes.SELECT })
.then(printers => {
return res.json({
printers
});
})
.catch(error => res.status(500).json({
error
}));
}
2020-09-16 18:03:09 -05:00
module.exports = get;