new ep usoWhitout
This commit is contained in:
@@ -142,4 +142,27 @@ export class MesaService {
|
||||
.orderBy('mesa.id_mesa', 'ASC')
|
||||
.getRawMany();
|
||||
}
|
||||
|
||||
findActiveMesasWhitoudOcupado() {
|
||||
return this.mesaRepository
|
||||
.createQueryBuilder('mesa')
|
||||
.select([
|
||||
'mesa.id_mesa AS id_mesa',
|
||||
])
|
||||
.where('mesa.activo = 1')
|
||||
.andWhere(`
|
||||
NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM bitacora_mesa bm
|
||||
WHERE bm.id_mesa = mesa.id_mesa
|
||||
AND TIMESTAMPDIFF(
|
||||
SECOND,
|
||||
NOW(),
|
||||
DATE_ADD(bm.tiempo_entrada, INTERVAL bm.tiempo_asignado MINUTE)
|
||||
) > 0
|
||||
)
|
||||
`)
|
||||
.orderBy('mesa.id_mesa', 'ASC')
|
||||
.getRawMany();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user