<?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>
|