From 67838a754d6df6127d2b368e8e07a7ee333946f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E6=9C=A8=E8=A6=81?= Date: Wed, 23 Aug 2023 17:57:19 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E3=82=A2=E3=83=AB=E3=83=88?= =?UTF-8?q?=E3=83=9E=E3=83=BC=E3=82=AF=E6=96=BD=E8=A8=AD=EF=BC=86=E5=8C=BB?= =?UTF-8?q?=E5=B8=AB=E7=85=A7=E4=BC=9A=E3=81=AE=E6=A4=9C=E7=B4=A2=E4=B8=8A?= =?UTF-8?q?=E9=99=90=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=81=AE=E3=83=AC?= =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B9=E3=81=8C=E6=82=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/repositories/ultmarc_doctor_repository.py | 5 ++++- .../src/repositories/ultmarc_inst_repository.py | 5 ++++- ecs/jskult-webapp/src/system_var/environment.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py b/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py index 810f045d..a97ec2ee 100644 --- a/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py +++ b/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py @@ -7,6 +7,7 @@ from src.model.db.ultmarc_doctor import UltmarcDoctorDBModel from src.model.db.ultmarc_doctor_info import UltmarcDoctorInfoDBModel from src.model.request.ultmarc_doctor import UltmarcDoctorSearchModel from src.repositories.base_repository import BaseRepository +from src.system_var import environment from src.util.string_util import is_not_empty logger = get_logger('COM_医師取得') @@ -46,6 +47,7 @@ class UltmarcDoctorRepository(BaseRepository): com_dr_wrkplace.dcf_dsf_inst_cd, com_dr_wrkplace.blng_sec_cd, com_dr_trt_course.trt_course_cd + LIMIT {limit} \ """ @@ -55,7 +57,8 @@ class UltmarcDoctorRepository(BaseRepository): # 文字列の検索を部分一致にするため、モデルをコピー。以降はこのコピーを使用する。 clone_parameter = UltmarcDoctorSearchModel(**parameter.model_dump()) where_clause = self.__build_condition(clone_parameter) - query = self.FETCH_SQL.format(where_clause=where_clause) + query = self.FETCH_SQL.format(where_clause=where_clause, limit=environment. + ULTMARC_SEARCH_RESULT_MAX_COUNT + 1) result = self._database.execute_select(query, clone_parameter.model_dump()) models = [UltmarcDoctorDBModel(**r) for r in result] diff --git a/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py b/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py index f94fae16..d751ba33 100644 --- a/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py +++ b/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py @@ -7,6 +7,7 @@ from src.model.db.ultmarc_inst import UltmarcInstDBModel from src.model.db.ultmarc_inst_info import UltmarcInstInfoDBModel from src.model.request.ultmarc_inst import UltmarcInstSearchModel from src.repositories.base_repository import BaseRepository +from src.system_var import environment from src.util.string_util import is_not_empty logger = get_logger('COM_施設取得') @@ -32,6 +33,7 @@ class UltmarcInstRepository(BaseRepository): LEFT JOIN src05.com_hp_assrt ON com_inst.hp_assrt_cd = com_hp_assrt.hp_assrt_cd WHERE {where_clause} ORDER BY dcf_dsf_inst_cd + LIMIT {limit} \ """ @@ -41,7 +43,8 @@ class UltmarcInstRepository(BaseRepository): # 文字列の検索を部分一致にするため、モデルをコピー。以降はこのコピーを使用する。 clone_parameter = UltmarcInstSearchModel(**parameter.model_dump()) where_clause = self.__build_condition(clone_parameter) - query = self.FETCH_SQL.format(where_clause=where_clause) + query = self.FETCH_SQL.format(where_clause=where_clause, limit=environment. + ULTMARC_SEARCH_RESULT_MAX_COUNT + 1) result = self._database.execute_select(query, clone_parameter.model_dump()) models = [UltmarcInstDBModel(**r) for r in result] diff --git a/ecs/jskult-webapp/src/system_var/environment.py b/ecs/jskult-webapp/src/system_var/environment.py index 6e7cf79d..ec24aeb9 100644 --- a/ecs/jskult-webapp/src/system_var/environment.py +++ b/ecs/jskult-webapp/src/system_var/environment.py @@ -20,7 +20,7 @@ DB_PASSWORD = os.environ['DB_PASSWORD'] DB_SCHEMA = os.environ['DB_SCHEMA'] BIO_SEARCH_RESULT_MAX_COUNT = int(os.environ.get('BIO_SEARCH_RESULT_MAX_COUNT', 35000)) -ULTMARC_SEARCH_RESULT_MAX_COUNT = int(os.environ['ULTMARC_SEARCH_RESULT_MAX_COUNT']) +ULTMARC_SEARCH_RESULT_MAX_COUNT = int(os.environ.get('ULTMARC_SEARCH_RESULT_MAX_COUNT', 500)) SESSION_EXPIRE_MINUTE = int(os.environ['SESSION_EXPIRE_MINUTE']) LOG_LEVEL = os.environ.get('LOG_LEVEL', 'INFO') From 995ea55da3dea2eee8784d1e45f6973013d20540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=8E=E9=96=93?= Date: Thu, 24 Aug 2023 09:33:26 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=E6=8C=87=E6=91=98=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/repositories/ultmarc_doctor_repository.py | 6 +++--- .../src/repositories/ultmarc_inst_repository.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py b/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py index a97ec2ee..498733d7 100644 --- a/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py +++ b/ecs/jskult-webapp/src/repositories/ultmarc_doctor_repository.py @@ -57,8 +57,8 @@ class UltmarcDoctorRepository(BaseRepository): # 文字列の検索を部分一致にするため、モデルをコピー。以降はこのコピーを使用する。 clone_parameter = UltmarcDoctorSearchModel(**parameter.model_dump()) where_clause = self.__build_condition(clone_parameter) - query = self.FETCH_SQL.format(where_clause=where_clause, limit=environment. - ULTMARC_SEARCH_RESULT_MAX_COUNT + 1) + query = self.FETCH_SQL.format( + where_clause=where_clause, limit=environment.ULTMARC_SEARCH_RESULT_MAX_COUNT + 1) result = self._database.execute_select(query, clone_parameter.model_dump()) models = [UltmarcDoctorDBModel(**r) for r in result] @@ -152,7 +152,7 @@ class UltmarcDoctorRepository(BaseRepository): '', '', "(com_dr.use_stop_div NOT IN ('01','03','04') OR com_dr.use_stop_div IS NULL)", literal=True)) # 廃業除外 - if where_clauses: + if len(where_clauses) > 0: where_clauses.append(SQLCondition( '', '', '(length(com_inst.abolish_ymd) = 0 OR com_inst.abolish_ymd IS NULL)', literal=True)) where_clauses.append(SQLCondition( diff --git a/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py b/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py index d751ba33..64eb0796 100644 --- a/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py +++ b/ecs/jskult-webapp/src/repositories/ultmarc_inst_repository.py @@ -43,8 +43,8 @@ class UltmarcInstRepository(BaseRepository): # 文字列の検索を部分一致にするため、モデルをコピー。以降はこのコピーを使用する。 clone_parameter = UltmarcInstSearchModel(**parameter.model_dump()) where_clause = self.__build_condition(clone_parameter) - query = self.FETCH_SQL.format(where_clause=where_clause, limit=environment. - ULTMARC_SEARCH_RESULT_MAX_COUNT + 1) + query = self.FETCH_SQL.format( + where_clause=where_clause, limit=environment.ULTMARC_SEARCH_RESULT_MAX_COUNT + 1) result = self._database.execute_select(query, clone_parameter.model_dump()) models = [UltmarcInstDBModel(**r) for r in result]