Merge branch 'fix-NEWDWH2021-1360' of nds-tyo.git.backlog.com:/NEWDWH2021/newsdwh2021 into fix-NEWDWH2021-1360

This commit is contained in:
shimoda.m@nds-tyo.co.jp 2023-11-28 19:12:40 +09:00
commit e986f76dc0
3 changed files with 10 additions and 4 deletions

View File

@ -89,6 +89,10 @@ class ComPrefcMedEqupmentMapper(UltmarcTableMapper):
return
def __make_upsert_query(self):
# 修正のレコードだった場合はNULLに変換する
if self.record.bed_num == '@':
self.query_parameter['bed_num'] = None
# レコードの存在確認
record_count = self.db.execute_select(self.RECORD_EXISTS_QUERY, self.query_parameter)
# 存在しない場合はInsert
@ -97,9 +101,7 @@ class ComPrefcMedEqupmentMapper(UltmarcTableMapper):
# 存在する場合はUpdate
# 病床数が空の場合は更新しない
if self.record.bed_num is not None:
if self.record.bed_num == '@':
self.query_parameter['bed_num'] = None
if self.record.is_bed_num_not_empty:
return self.UPDATE_QUERY
else:
return None

View File

@ -23,8 +23,12 @@ class ComPrefcMedEqupment(UltmarcTable):
self.adddel_div = record[6]
self.bed_num = record[9]
# Update判断フラグ。数値が空の場合は更新しない。
self.is_bed_num_not_empty = True
# smallint型のカラム値は、空文字で渡ってきた場合はNULLに変換する
self.bed_num = self.bed_num if len(self.bed_num) > 0 else None
self.is_bed_num_not_empty = self.bed_num is not None
# DCFDSF施設コード
self.dcfdsf_inst_code = ''.join([self.dcfhp_id, self.dcfhp_code, self.dcfhp_yobi])

View File

@ -3,4 +3,4 @@
"133","00","9901649","","A","009","2","20141113","20141114","3"
"133","00","9901679","","A","015","2","20141113","20141114",""
"133","00","9904439","","A","006","2","20141113","20141114",""
"133","00","9929798","","A","010","2","20141113","20141114",""
"133","00","9929798","","A","010","2","20141113","20141114","@"

1 133 00 9900146 A 012 2 20141113 20141114 0
3 133 00 9901649 A 009 2 20141113 20141114 3
4 133 00 9901679 A 015 2 20141113 20141114
5 133 00 9904439 A 006 2 20141113 20141114
6 133 00 9929798 A 010 2 20141113 20141114 @