我在 MyBatis 中找不到可以替换以下代码的映射示例。
"if sqlcode <> 0" 如果没有更新,则执行插入
有什么建议吗?:)
as
begin
execute SetDefaultIsolationLevel
update COMPANYLEVEL
set
companylevelid = @companylevelid,
companynameid = @companynameid,
level = @level,
memo = @memo,
operator = @operator,
changed = getdate(*)
where
companynameid = @companynameid
if sqlcode <> 0
BEGIN
insert into COMPANYLEVEL
(companylevelid,companynameid,level,memo,operator,changed)
values
(@companylevelid,@companynameid,@level,@memo,@operator,getdate(*))
END
commit transaction
end