From d0c9761b12e09801ff8d061c0b5d04033284a704 Mon Sep 17 00:00:00 2001 From: yubinquitous Date: Fri, 22 Jul 2022 16:09:54 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=20=EC=97=B0=EC=B2=B4=20?= =?UTF-8?q?=EA=B8=B0=EC=A4=80=20=EB=82=A0=EC=A7=9C=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?(#83)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/db/query.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/db/query.js b/backend/db/query.js index 51114ff..d6fdcde 100644 --- a/backend/db/query.js +++ b/backend/db/query.js @@ -172,6 +172,7 @@ const deleteLent = async (connection, userLentInfo) => { await connection.query(deleteLentQuery, userLentInfo.lent_cabinet_id); }; +// 연체 사물함 정보 조회 const getLentOverdue = async (connection) => { const content = ` SELECT u.intra_id, c.floor, c.cabinet_num, l.lent_time,l.expire_time from lent l @@ -191,10 +192,10 @@ const getCabinetInfoByFloor = async (connection) => { const content = ` SELECT c.floor, COUNT(*) as total, - COUNT(case when c.cabinet_id=l.lent_cabinet_id and l.expire_time>now() then 1 end) as used, - COUNT(case when l.expire_time=DATE_FORMAT(NOW(), '%Y-%m-%d') then 1 end) as used, + COUNT(case when l.expire_time