From 0e0a6a0717fd198c3a8183e7704b5288bc38a245 Mon Sep 17 00:00:00 2001
From: whycxzp <glperry@163.com>
Date: 星期三, 13 十一月 2024 16:04:28 +0800
Subject: [PATCH] 调整语法不兼容

---
 src/main/resources/mapper/Fbs9100sFodParamMapper.xml |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/Fbs9100sFodParamMapper.xml b/src/main/resources/mapper/Fbs9100sFodParamMapper.xml
index bb682d6..8b17aee 100644
--- a/src/main/resources/mapper/Fbs9100sFodParamMapper.xml
+++ b/src/main/resources/mapper/Fbs9100sFodParamMapper.xml
@@ -15,7 +15,7 @@
             insert(dev_id,GroupNum,BattGroupNum) values(#{devId},#{GroupNum},#{BattGroupNum})
     </update>
     <update id="replace" parameterType="fbs9100sFodParam">
-        replace into db_ram_db.tb_fbs9100s_fod_param(dev_id,GroupNum,BattGroupNum,STDCap_one,FloatVol_one,Strength_one,YHStrength_one,TimeLong_one,STDCap_two,FloatVol_two,Strength_two,YHStrength_two,TimeLong_two
+        <!--replace into db_ram_db.tb_fbs9100s_fod_param(dev_id,GroupNum,BattGroupNum,STDCap_one,FloatVol_one,Strength_one,YHStrength_one,TimeLong_one,STDCap_two,FloatVol_two,Strength_two,YHStrength_two,TimeLong_two
 				,STDCap_three,FloatVol_three,Strength_three,YHStrength_three,TimeLong_three,STDCap_four,FloatVol_four,Strength_four,YHStrength_four,TimeLong_four
 				,STDCap_five,FloatVol_five,Strength_five,YHStrength_five,TimeLong_five)
 				  values(#{devId},#{GroupNum},#{BattGroupNum}
@@ -23,6 +23,26 @@
                 ,#{stdcapTwo},#{floatvolTwo},#{strengthTwo},#{yhstrengthTwo},#{timelongTwo}
                ,#{stdcapThree},#{floatvolThree},#{strengthThree},#{yhstrengthThree},#{timelongThree}
                ,#{stdcapFour},#{floatvolFour},#{strengthFour},#{yhstrengthFour},#{timelongFour}
-               ,#{stdcapFive},#{floatvolFive},#{strengthFive},#{yhstrengthFive},#{timelongFive})
+               ,#{stdcapFive},#{floatvolFive},#{strengthFive},#{yhstrengthFive},#{timelongFive})-->
+        merge into db_ram_db.tb_fbs9100s_fod_param tgt
+        using (select #{devId} as dev_id) as src
+        on tgt.dev_id = src.dev_id
+        when matched then
+            update set tgt.GroupNum = #{GroupNum},tgt.BattGroupNum = #{BattGroupNum},tgt.STDCap_one = #{stdcapOne},tgt.FloatVol_one = #{floatvolOne},tgt.Strength_one = #{strengthOne},tgt.YHStrength_one = #{yhstrengthOne},tgt.TimeLong_one = #{timelongOne}
+        ,tgt.STDCap_two = #{stdcapTwo},tgt.FloatVol_two = #{floatvolTwo},tgt.Strength_two = #{strengthTwo},tgt.YHStrength_two = #{yhstrengthTwo},tgt.TimeLong_two = #{timelongTwo}
+        ,tgt.STDCap_three = #{stdcapThree},tgt.FloatVol_three = #{floatvolThree},tgt.Strength_three = #{strengthThree},tgt.YHStrength_three = #{yhstrengthThree},tgt.TimeLong_three = #{timelongThree}
+        ,tgt.STDCap_four = #{stdcapFour},tgt.FloatVol_four = #{floatvolFour},tgt.Strength_four = #{strengthFour},tgt.YHStrength_four = #{yhstrengthFour},tgt.TimeLong_four = #{timelongFour}
+        ,tgt.STDCap_five = #{stdcapFive},tgt.FloatVol_five = #{floatvolFive},tgt.Strength_five = #{strengthFive},tgt.YHStrength_five = #{yhstrengthFive},tgt.TimeLong_five = #{timelongFive}
+        when not matched then
+            insert (dev_id,GroupNum,BattGroupNum,STDCap_one,FloatVol_one,Strength_one,YHStrength_one,TimeLong_one,STDCap_two,FloatVol_two,Strength_two,YHStrength_two,TimeLong_two
+            ,STDCap_three,FloatVol_three,Strength_three,YHStrength_three,TimeLong_three,STDCap_four,FloatVol_four,Strength_four,YHStrength_four,TimeLong_four
+            ,STDCap_five,FloatVol_five,Strength_five,YHStrength_five,TimeLong_five)
+            values(#{devId},#{GroupNum},#{BattGroupNum}
+            ,#{stdcapOne},#{floatvolOne},#{strengthOne},#{yhstrengthOne},#{timelongOne}
+            ,#{stdcapTwo},#{floatvolTwo},#{strengthTwo},#{yhstrengthTwo},#{timelongTwo}
+            ,#{stdcapThree},#{floatvolThree},#{strengthThree},#{yhstrengthThree},#{timelongThree}
+            ,#{stdcapFour},#{floatvolFour},#{strengthFour},#{yhstrengthFour},
+            #{timelongFour},#{stdcapFive},#{floatvolFive},#{strengthFive},#{yhstrengthFive},#{timelongFive}
+            )
     </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1