rt-sim-training-service/src/main/resources/mybatis/mapper/OperatePlaceholderDAO.xml

243 lines
8.7 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="club.joylink.rtss.dao.OperatePlaceholderDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.OperatePlaceholder">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="code" jdbcType="BIGINT" property="code" />
<result column="training_type" jdbcType="VARCHAR" property="trainingType" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="val" jdbcType="VARCHAR" property="val" />
<result column="val_new" jdbcType="VARCHAR" property="valNew" />
</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, code, training_type, `type`, `name`, val, val_new
</sql>
<select id="selectByExample" parameterType="club.joylink.rtss.entity.OperatePlaceholderExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from operate_placeholder
<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 operate_placeholder
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from operate_placeholder
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.OperatePlaceholderExample">
delete from operate_placeholder
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.OperatePlaceholder" useGeneratedKeys="true">
insert into operate_placeholder (code, training_type, `type`,
`name`, val, val_new)
values (#{code,jdbcType=BIGINT}, #{trainingType,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{val,jdbcType=VARCHAR}, #{valNew,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.OperatePlaceholder" useGeneratedKeys="true">
insert into operate_placeholder
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null">
code,
</if>
<if test="trainingType != null">
training_type,
</if>
<if test="type != null">
`type`,
</if>
<if test="name != null">
`name`,
</if>
<if test="val != null">
val,
</if>
<if test="valNew != null">
val_new,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null">
#{code,jdbcType=BIGINT},
</if>
<if test="trainingType != null">
#{trainingType,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="val != null">
#{val,jdbcType=VARCHAR},
</if>
<if test="valNew != null">
#{valNew,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.OperatePlaceholderExample" resultType="java.lang.Long">
select count(*) from operate_placeholder
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update operate_placeholder
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.code != null">
code = #{record.code,jdbcType=BIGINT},
</if>
<if test="record.trainingType != null">
training_type = #{record.trainingType,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.val != null">
val = #{record.val,jdbcType=VARCHAR},
</if>
<if test="record.valNew != null">
val_new = #{record.valNew,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update operate_placeholder
set id = #{record.id,jdbcType=BIGINT},
code = #{record.code,jdbcType=BIGINT},
training_type = #{record.trainingType,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
val = #{record.val,jdbcType=VARCHAR},
val_new = #{record.valNew,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.OperatePlaceholder">
update operate_placeholder
<set>
<if test="code != null">
code = #{code,jdbcType=BIGINT},
</if>
<if test="trainingType != null">
training_type = #{trainingType,jdbcType=VARCHAR},
</if>
<if test="type != null">
`type` = #{type,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="val != null">
val = #{val,jdbcType=VARCHAR},
</if>
<if test="valNew != null">
val_new = #{valNew,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.OperatePlaceholder">
update operate_placeholder
set code = #{code,jdbcType=BIGINT},
training_type = #{trainingType,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
val = #{val,jdbcType=VARCHAR},
val_new = #{valNew,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>