From 2880d75c25a0d6be8b36ed1da1916a30a761a3a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=8E=E9=96=93?= Date: Thu, 15 Jun 2023 09:00:24 +0900 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=9C=9F=E8=A1=A8=E7=A4=BA=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/repositories/ultmarc_doctor_repository.py | 9 +++++++-- .../src/repositories/ultmarc_inst_repository.py | 4 ---- ecs/jskult-webapp/src/templates/docSearch.html | 4 +--- ecs/jskult-webapp/src/templates/instSearch.html | 3 --- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py b/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py index bd89db0b..153d8164 100644 --- a/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py +++ b/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py @@ -34,8 +34,6 @@ class UltmarcDoctorRepository(BaseRepository): LEFT JOIN src05.com_alma ON com_dr.alma_cd = com_alma.alma_cd WHERE {where_clause} - AND (length(com_inst.abolish_ymd) = 0 OR com_inst.abolish_ymd IS NULL) - AND (length(com_dr.abolish_ymd) = 0 OR com_dr.abolish_ymd IS NULL) GROUP BY com_dr.dcf_pcf_dr_cd, com_inst.dcf_dsf_inst_cd, com_blng_sec.blng_sec_cd ORDER BY com_dr.dcf_pcf_dr_cd, @@ -129,6 +127,13 @@ class UltmarcDoctorRepository(BaseRepository): parameter.grad_y = f'%{parameter.grad_y}%' where_clauses.append(SQLCondition('grad_y', condition.LIKE, 'grad_y')) + # 廃業除外 + if where_clauses: + where_clauses.append(SQLCondition( + '', '', '(length(com_inst.abolish_ymd) = 0 OR com_inst.abolish_ymd IS NULL)', literal=True)) + where_clauses.append(SQLCondition( + '', '', '(length(com_dr.abolish_ymd) = 0 OR com_dr.abolish_ymd IS NULL)', literal=True)) + where_clauses_str = ' AND '.join([condition.apply() for condition in where_clauses]) return where_clauses_str diff --git a/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py b/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py index 2cf08f77..0baaf56e 100644 --- a/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py +++ b/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py @@ -100,10 +100,6 @@ class UltmarcInstRepository(BaseRepository): # 論理和での検索 where_clauses.append(SQLCondition('', '', '(length(abolish_ymd) = 0 OR abolish_ymd IS NULL)', literal=True)) - # 検索条件が入力されていない場合 - # if not where_clauses: - # where_clauses.append(SQLCondition('', '', '(length(abolish_ymd) = 0 OR abolish_ymd IS NULL)', literal=True)) - where_clauses_str = ' AND '.join([condition.apply() for condition in where_clauses]) return where_clauses_str diff --git a/ecs/jskult-webapp/src/templates/docSearch.html b/ecs/jskult-webapp/src/templates/docSearch.html index 0b86e837..e505fa13 100644 --- a/ecs/jskult-webapp/src/templates/docSearch.html +++ b/ecs/jskult-webapp/src/templates/docSearch.html @@ -162,9 +162,7 @@ let searchResultString = '{{ultmarc.ultmarc_data_json_str()}}' // {% endautoescape%} const searchResultData = JSON.parse(searchResultString) - if (searchResultData.length == 0) { - return - }else if(searchResultData.length > 500){ + if(searchResultData.length > 500){ return } // 検索条件をセッションに入れる diff --git a/ecs/jskult-webapp/src/templates/instSearch.html b/ecs/jskult-webapp/src/templates/instSearch.html index d27197f4..8cb92402 100644 --- a/ecs/jskult-webapp/src/templates/instSearch.html +++ b/ecs/jskult-webapp/src/templates/instSearch.html @@ -161,9 +161,6 @@ let searchResultString = '{{ultmarc.ultmarc_data_json_str()}}' // {% endautoescape%} const searchResultData = JSON.parse(searchResultString) - if (searchResultData.length == 0) { - return - } if (searchResultData.length > 500) { return }