You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
backend/xymanager_dao/src/main/resources/mappers/TerminalPresetsDao.xml

117 lines
4.0 KiB
XML

<?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.shxy.xymanager_dao.dao.TerminalPresetsDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalPresets">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="term_id" jdbcType="INTEGER" property="termId" />
<result column="preset_no" jdbcType="TINYINT" property="presetNo" />
<result column="name" jdbcType="TINYINT" property="name" />
<result column="angle_x" jdbcType="REAL" property="angleX" />
<result column="angle_y" jdbcType="REAL" property="angleY" />
<result column="velocity" jdbcType="REAL" property="velocity" />
</resultMap>
<sql id="Base_Column_List">
id, term_id, preset_no, name, angle_x, angle_y, velocity
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from terminal_presets
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_presets
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalPresets">
insert into terminal_presets (id, term_id, preset_no,
name, angle_x, angle_y, velocity
)
values (#{id,jdbcType=INTEGER}, #{termId,jdbcType=INTEGER}, #{presetNo,jdbcType=TINYINT},
#{name,jdbcType=TINYINT}, #{angleX,jdbcType=REAL}, #{angleY,jdbcType=REAL}, #{velocity,jdbcType=REAL}
)
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalPresets">
insert into terminal_presets
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="termId != null">
term_id,
</if>
<if test="presetNo != null">
preset_no,
</if>
<if test="name != null">
name,
</if>
<if test="angleX != null">
angle_x,
</if>
<if test="angleY != null">
angle_y,
</if>
<if test="velocity != null">
velocity,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="presetNo != null">
#{presetNo,jdbcType=TINYINT},
</if>
<if test="name != null">
#{name,jdbcType=TINYINT},
</if>
<if test="angleX != null">
#{angleX,jdbcType=REAL},
</if>
<if test="angleY != null">
#{angleY,jdbcType=REAL},
</if>
<if test="velocity != null">
#{velocity,jdbcType=REAL},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalPresets">
update terminal_presets
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="presetNo != null">
preset_no = #{presetNo,jdbcType=TINYINT},
</if>
<if test="name != null">
name = #{name,jdbcType=TINYINT},
</if>
<if test="angleX != null">
angle_x = #{angleX,jdbcType=REAL},
</if>
<if test="angleY != null">
angle_y = #{angleY,jdbcType=REAL},
</if>
<if test="velocity != null">
velocity = #{velocity,jdbcType=REAL},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalPresets">
update terminal_presets
set term_id = #{termId,jdbcType=INTEGER},
preset_no = #{presetNo,jdbcType=TINYINT},
name = #{name,jdbcType=TINYINT},
angle_x = #{angleX,jdbcType=REAL},
angle_y = #{angleY,jdbcType=REAL},
velocity = #{velocity,jdbcType=REAL}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>