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]