whycrzg
2021-05-26 bf7833def6436a4100f15d179717190d9574666c
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?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.ExperimentWindingStep1Mapper">
  <resultMap id="BaseResultMap" type="com.whyc.pojo.ExperimentWindingStep1">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="winding" jdbcType="VARCHAR" property="winding" />
    <result column="electric_current" jdbcType="FLOAT" property="electricCurrent" />
    <result column="vol" jdbcType="FLOAT" property="vol" />
    <result column="resistance" jdbcType="FLOAT" property="resistance" />
    <result column="temperature" jdbcType="FLOAT" property="temperature" />
    <result column="save_time" jdbcType="TIMESTAMP" property="saveTime" />
    <result column="experiment_id" jdbcType="VARCHAR" property="experimentId" />
    <result column="status" jdbcType="BOOLEAN" property="status" />
    <result column="note" jdbcType="VARCHAR" property="note" />
  </resultMap>
  <sql id="Base_Column_List">
    id, winding, electric_current, vol, resistance, temperature, save_time, experiment_id, 
    `status`, note
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_experiment_winding_step1
    where id = #{id,jdbcType=INTEGER}
  </select>
  <select id="getRealName" resultType="java.lang.String">
    SELECT real_name FROM `db_3.5mw_web`.`tb_user`
    WHERE id = (SELECT user_id FROM `db_3.5mw_web`.`tb_experiment` WHERE
    id = #{experimentId})
  </select>
  <select id="selectlistByCondition" resultType="com.whyc.pojo.ExperimentWindingStep1">
    SELECT
    *
    FROM
    `db_3.5mw_web`.`tb_experiment_winding_step1` WHERE step =#{step} AND rz_link =#{rzLink} AND experiment_id =
    #{experimentId}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_experiment_winding_step1
    where id = #{id,jdbcType=INTEGER}
  </delete>
    <delete id="delExperimentWindingbyId">
      delete from tb_experiment_winding_step1
      where experiment_id = #{experimentId,jdbcType=INTEGER}
    </delete>
 
  <insert id="insertSelective" parameterType="com.whyc.pojo.ExperimentWindingStep1">
    insert into tb_experiment_winding_step1
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="winding != null">
        winding,
      </if>
      <if test="electricCurrent != null">
        electric_current,
      </if>
      <if test="vol != null">
        vol,
      </if>
      <if test="resistance != null">
        resistance,
      </if>
      <if test="temperature != null">
        temperature,
      </if>
      <if test="saveTime != null">
        save_time,
      </if>
      <if test="experimentId != null">
        experiment_id,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="note != null">
        note,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="winding != null">
        #{winding,jdbcType=VARCHAR},
      </if>
      <if test="electricCurrent != null">
        #{electricCurrent,jdbcType=FLOAT},
      </if>
      <if test="vol != null">
        #{vol,jdbcType=FLOAT},
      </if>
      <if test="resistance != null">
        #{resistance,jdbcType=FLOAT},
      </if>
      <if test="temperature != null">
        #{temperature,jdbcType=FLOAT},
      </if>
      <if test="saveTime != null">
        #{saveTime,jdbcType=TIMESTAMP},
      </if>
      <if test="experimentId != null">
        #{experimentId,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=BOOLEAN},
      </if>
      <if test="note != null">
        #{note,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.whyc.pojo.ExperimentWindingStep1">
    update tb_experiment_winding_step1
    <set>
      <if test="winding != null">
        winding = #{winding,jdbcType=VARCHAR},
      </if>
      <if test="electricCurrent != null">
        electric_current = #{electricCurrent,jdbcType=FLOAT},
      </if>
      <if test="vol != null">
        vol = #{vol,jdbcType=FLOAT},
      </if>
      <if test="resistance != null">
        resistance = #{resistance,jdbcType=FLOAT},
      </if>
      <if test="temperature != null">
        temperature = #{temperature,jdbcType=FLOAT},
      </if>
      <if test="saveTime != null">
        save_time = #{saveTime,jdbcType=TIMESTAMP},
      </if>
      <if test="experimentId != null">
        experiment_id = #{experimentId,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=BOOLEAN},
      </if>
      <if test="note != null">
        note = #{note,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.whyc.pojo.ExperimentWindingStep1">
    update tb_experiment_winding_step1
    set winding = #{winding,jdbcType=VARCHAR},
      electric_current = #{electricCurrent,jdbcType=FLOAT},
      vol = #{vol,jdbcType=FLOAT},
      resistance = #{resistance,jdbcType=FLOAT},
      temperature = #{temperature,jdbcType=FLOAT},
      save_time = #{saveTime,jdbcType=TIMESTAMP},
      experiment_id = #{experimentId,jdbcType=VARCHAR},
      `status` = #{status,jdbcType=BOOLEAN},
      note = #{note,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
    <update id="updateById">
      update tb_experiment_winding_step1
      set winding = #{winding,jdbcType=VARCHAR},
          electric_current = #{electricCurrent,jdbcType=FLOAT},
          vol = #{vol,jdbcType=FLOAT},
          resistance = #{resistance,jdbcType=FLOAT},
          temperature = #{temperature,jdbcType=FLOAT},
          save_time = #{saveTime,jdbcType=TIMESTAMP},
          experiment_id = #{experimentId,jdbcType=VARCHAR},
          `status` = #{status,jdbcType=BOOLEAN},
          note = #{note,jdbcType=VARCHAR}
      where
        experiment_id = #{experimentId,jdbcType=VARCHAR}
    </update>
 
  <update id="updateByIdandIndex" parameterType="com.whyc.pojo.ExperimentWindingStep1">
    update `db_3.5mw_web`.tb_experiment_winding_step1
    set
    electric_current = #{electricCurrent},
    vol = #{vol},
    resistance = #{resistance},
    save_time = #{saveTime},
    temperature = #{temperature}
    WHERE
    experiment_id = #{experimentId} AND
    index_id = #{indexId} AND
    step = #{step}
  </update>
    <update id="updateRzFlag">
      UPDATE `db_3.5mw_web`.`tb_experiment_winding_step1` SET status = 2 where experiment_id = #{id}
    </update>
</mapper>