1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
| <mapper namespace="com.whyc.mapper.Fbs9100sFodParamMapper">
|
|
| <update id="startOrStopTest" parameterType="fbs9100sFodParam">
| <!-- replace into db_ram_db.tb_fbs9100s_fod_param(dev_id,GroupNum,BattGroupNum)
| values(#{devId},#{GroupNum},#{BattGroupNum})-->
| 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}
| when not matched then
| 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
| ,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})-->
| 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>
|
|