2020-11-19 10:07:10 +08:00
|
|
|
<?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">
|
2020-11-19 18:28:54 +08:00
|
|
|
<mapper namespace="club.joylink.rtss.dao.CommandDefinitionDAO">
|
|
|
|
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.CommandDefinition">
|
2020-11-19 10:07:10 +08:00
|
|
|
<id column="id" jdbcType="BIGINT" property="id" />
|
|
|
|
<result column="line_code" jdbcType="VARCHAR" property="lineCode" />
|
|
|
|
<result column="prd_type" jdbcType="VARCHAR" property="prdType" />
|
|
|
|
<result column="simulation_role" jdbcType="VARCHAR" property="simulationRole" />
|
|
|
|
<result column="control_mode" jdbcType="VARCHAR" property="controlMode" />
|
|
|
|
<result column="operate_object" jdbcType="VARCHAR" property="operateObject" />
|
|
|
|
<result column="operate" jdbcType="VARCHAR" property="operate" />
|
|
|
|
<result column="conditions" jdbcType="VARCHAR" property="conditions" />
|
|
|
|
<result column="params" jdbcType="VARCHAR" property="params" />
|
|
|
|
</resultMap>
|
|
|
|
<sql id="Example_Where_Clause">
|
|
|
|
<where>
|
|
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
|
<if test="criteria.valid">
|
|
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
|
|
<choose>
|
|
|
|
<when test="criterion.noValue">
|
|
|
|
and ${criterion.condition}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.singleValue">
|
|
|
|
and ${criterion.condition} #{criterion.value}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.betweenValue">
|
|
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.listValue">
|
|
|
|
and ${criterion.condition}
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
#{listItem}
|
|
|
|
</foreach>
|
|
|
|
</when>
|
|
|
|
</choose>
|
|
|
|
</foreach>
|
|
|
|
</trim>
|
|
|
|
</if>
|
|
|
|
</foreach>
|
|
|
|
</where>
|
|
|
|
</sql>
|
|
|
|
<sql id="Update_By_Example_Where_Clause">
|
|
|
|
<where>
|
|
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
|
<if test="criteria.valid">
|
|
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
|
|
<choose>
|
|
|
|
<when test="criterion.noValue">
|
|
|
|
and ${criterion.condition}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.singleValue">
|
|
|
|
and ${criterion.condition} #{criterion.value}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.betweenValue">
|
|
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
</when>
|
|
|
|
<when test="criterion.listValue">
|
|
|
|
and ${criterion.condition}
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
#{listItem}
|
|
|
|
</foreach>
|
|
|
|
</when>
|
|
|
|
</choose>
|
|
|
|
</foreach>
|
|
|
|
</trim>
|
|
|
|
</if>
|
|
|
|
</foreach>
|
|
|
|
</where>
|
|
|
|
</sql>
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
id, line_code, prd_type, simulation_role, control_mode, operate_object, operate,
|
|
|
|
conditions, params
|
|
|
|
</sql>
|
2020-11-19 18:28:54 +08:00
|
|
|
<select id="selectByExample" parameterType="club.joylink.rtss.entity.CommandDefinitionExample" resultMap="BaseResultMap">
|
2020-11-19 10:07:10 +08:00
|
|
|
select
|
|
|
|
<if test="distinct">
|
|
|
|
distinct
|
|
|
|
</if>
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
from command_definition
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
</if>
|
|
|
|
<if test="orderByClause != null">
|
|
|
|
order by ${orderByClause}
|
|
|
|
</if>
|
|
|
|
<if test="limit != null">
|
|
|
|
<if test="offset != null">
|
|
|
|
limit ${offset}, ${limit}
|
|
|
|
</if>
|
|
|
|
<if test="offset == null">
|
|
|
|
limit ${limit}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
|
select
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
from command_definition
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
</select>
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
|
delete from command_definition
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
</delete>
|
2020-11-19 18:28:54 +08:00
|
|
|
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.CommandDefinitionExample">
|
2020-11-19 10:07:10 +08:00
|
|
|
delete from command_definition
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
</if>
|
|
|
|
</delete>
|
2020-11-19 18:28:54 +08:00
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.CommandDefinition" useGeneratedKeys="true">
|
2020-11-19 10:07:10 +08:00
|
|
|
insert into command_definition (line_code, prd_type, simulation_role,
|
|
|
|
control_mode, operate_object, operate,
|
|
|
|
conditions, params)
|
|
|
|
values (#{lineCode,jdbcType=VARCHAR}, #{prdType,jdbcType=VARCHAR}, #{simulationRole,jdbcType=VARCHAR},
|
|
|
|
#{controlMode,jdbcType=VARCHAR}, #{operateObject,jdbcType=VARCHAR}, #{operate,jdbcType=VARCHAR},
|
|
|
|
#{conditions,jdbcType=VARCHAR}, #{params,jdbcType=VARCHAR})
|
|
|
|
</insert>
|
2020-11-19 18:28:54 +08:00
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.CommandDefinition" useGeneratedKeys="true">
|
2020-11-19 10:07:10 +08:00
|
|
|
insert into command_definition
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="lineCode != null">
|
|
|
|
line_code,
|
|
|
|
</if>
|
|
|
|
<if test="prdType != null">
|
|
|
|
prd_type,
|
|
|
|
</if>
|
|
|
|
<if test="simulationRole != null">
|
|
|
|
simulation_role,
|
|
|
|
</if>
|
|
|
|
<if test="controlMode != null">
|
|
|
|
control_mode,
|
|
|
|
</if>
|
|
|
|
<if test="operateObject != null">
|
|
|
|
operate_object,
|
|
|
|
</if>
|
|
|
|
<if test="operate != null">
|
|
|
|
operate,
|
|
|
|
</if>
|
|
|
|
<if test="conditions != null">
|
|
|
|
conditions,
|
|
|
|
</if>
|
|
|
|
<if test="params != null">
|
|
|
|
params,
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="lineCode != null">
|
|
|
|
#{lineCode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="prdType != null">
|
|
|
|
#{prdType,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="simulationRole != null">
|
|
|
|
#{simulationRole,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="controlMode != null">
|
|
|
|
#{controlMode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="operateObject != null">
|
|
|
|
#{operateObject,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="operate != null">
|
|
|
|
#{operate,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="conditions != null">
|
|
|
|
#{conditions,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="params != null">
|
|
|
|
#{params,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
2020-11-19 18:28:54 +08:00
|
|
|
<select id="countByExample" parameterType="club.joylink.rtss.entity.CommandDefinitionExample" resultType="java.lang.Long">
|
2020-11-19 10:07:10 +08:00
|
|
|
select count(*) from command_definition
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
|
|
update command_definition
|
|
|
|
<set>
|
|
|
|
<if test="record.id != null">
|
|
|
|
id = #{record.id,jdbcType=BIGINT},
|
|
|
|
</if>
|
|
|
|
<if test="record.lineCode != null">
|
|
|
|
line_code = #{record.lineCode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="record.prdType != null">
|
|
|
|
prd_type = #{record.prdType,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="record.simulationRole != null">
|
|
|
|
simulation_role = #{record.simulationRole,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="record.controlMode != null">
|
|
|
|
control_mode = #{record.controlMode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="record.operateObject != null">
|
|
|
|
operate_object = #{record.operateObject,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="record.operate != null">
|
|
|
|
operate = #{record.operate,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="record.conditions != null">
|
|
|
|
conditions = #{record.conditions,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="record.params != null">
|
|
|
|
params = #{record.params,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
</set>
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
</if>
|
|
|
|
</update>
|
|
|
|
<update id="updateByExample" parameterType="map">
|
|
|
|
update command_definition
|
|
|
|
set id = #{record.id,jdbcType=BIGINT},
|
|
|
|
line_code = #{record.lineCode,jdbcType=VARCHAR},
|
|
|
|
prd_type = #{record.prdType,jdbcType=VARCHAR},
|
|
|
|
simulation_role = #{record.simulationRole,jdbcType=VARCHAR},
|
|
|
|
control_mode = #{record.controlMode,jdbcType=VARCHAR},
|
|
|
|
operate_object = #{record.operateObject,jdbcType=VARCHAR},
|
|
|
|
operate = #{record.operate,jdbcType=VARCHAR},
|
|
|
|
conditions = #{record.conditions,jdbcType=VARCHAR},
|
|
|
|
params = #{record.params,jdbcType=VARCHAR}
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
</if>
|
|
|
|
</update>
|
2020-11-19 18:28:54 +08:00
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.CommandDefinition">
|
2020-11-19 10:07:10 +08:00
|
|
|
update command_definition
|
|
|
|
<set>
|
|
|
|
<if test="lineCode != null">
|
|
|
|
line_code = #{lineCode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="prdType != null">
|
|
|
|
prd_type = #{prdType,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="simulationRole != null">
|
|
|
|
simulation_role = #{simulationRole,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="controlMode != null">
|
|
|
|
control_mode = #{controlMode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="operateObject != null">
|
|
|
|
operate_object = #{operateObject,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="operate != null">
|
|
|
|
operate = #{operate,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="conditions != null">
|
|
|
|
conditions = #{conditions,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="params != null">
|
|
|
|
params = #{params,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
</set>
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
</update>
|
2020-11-19 18:28:54 +08:00
|
|
|
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.CommandDefinition">
|
2020-11-19 10:07:10 +08:00
|
|
|
update command_definition
|
|
|
|
set line_code = #{lineCode,jdbcType=VARCHAR},
|
|
|
|
prd_type = #{prdType,jdbcType=VARCHAR},
|
|
|
|
simulation_role = #{simulationRole,jdbcType=VARCHAR},
|
|
|
|
control_mode = #{controlMode,jdbcType=VARCHAR},
|
|
|
|
operate_object = #{operateObject,jdbcType=VARCHAR},
|
|
|
|
operate = #{operate,jdbcType=VARCHAR},
|
|
|
|
conditions = #{conditions,jdbcType=VARCHAR},
|
|
|
|
params = #{params,jdbcType=VARCHAR}
|
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
|
</update>
|
|
|
|
</mapper>
|