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

276 lines
9.9 KiB
XML
Raw Normal View History

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">
<mapper namespace="club.joylink.rtss.dao.MapInfoDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.MapInfo">
2020-11-19 10:07:10 +08:00
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="line_code" jdbcType="VARCHAR" property="lineCode" />
<result column="city_code" jdbcType="VARCHAR" property="cityCode" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="project" jdbcType="BIT" property="project" />
<result column="project_code" jdbcType="VARCHAR" property="projectCode" />
<result column="order_number" jdbcType="INTEGER" property="orderNumber" />
<result column="version" jdbcType="VARCHAR" property="version" />
2020-11-19 10:07:10 +08:00
</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, `name`, line_code, city_code, `status`, project, project_code, order_number,
version
2020-11-19 10:07:10 +08:00
</sql>
<select id="selectByExample" parameterType="club.joylink.rtss.entity.MapInfoExample" resultMap="BaseResultMap">
2020-11-19 10:07:10 +08:00
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from map_info
<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 map_info
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from map_info
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.MapInfoExample">
2020-11-19 10:07:10 +08:00
delete from map_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.MapInfo" useGeneratedKeys="true">
2020-11-19 10:07:10 +08:00
insert into map_info (`name`, line_code, city_code,
`status`, project, project_code,
order_number, version)
2020-11-19 10:07:10 +08:00
values (#{name,jdbcType=VARCHAR}, #{lineCode,jdbcType=VARCHAR}, #{cityCode,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{project,jdbcType=BIT}, #{projectCode,jdbcType=VARCHAR},
#{orderNumber,jdbcType=INTEGER}, #{version,jdbcType=VARCHAR})
2020-11-19 10:07:10 +08:00
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.MapInfo" useGeneratedKeys="true">
2020-11-19 10:07:10 +08:00
insert into map_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
`name`,
</if>
<if test="lineCode != null">
line_code,
</if>
<if test="cityCode != null">
city_code,
</if>
<if test="status != null">
`status`,
</if>
<if test="project != null">
project,
</if>
<if test="projectCode != null">
project_code,
</if>
<if test="orderNumber != null">
order_number,
</if>
<if test="version != null">
version,
</if>
2020-11-19 10:07:10 +08:00
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="lineCode != null">
#{lineCode,jdbcType=VARCHAR},
</if>
<if test="cityCode != null">
#{cityCode,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="project != null">
#{project,jdbcType=BIT},
</if>
<if test="projectCode != null">
#{projectCode,jdbcType=VARCHAR},
</if>
<if test="orderNumber != null">
#{orderNumber,jdbcType=INTEGER},
</if>
<if test="version != null">
#{version,jdbcType=VARCHAR},
</if>
2020-11-19 10:07:10 +08:00
</trim>
</insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.MapInfoExample" resultType="java.lang.Long">
2020-11-19 10:07:10 +08:00
select count(*) from map_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update map_info
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.lineCode != null">
line_code = #{record.lineCode,jdbcType=VARCHAR},
</if>
<if test="record.cityCode != null">
city_code = #{record.cityCode,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.project != null">
project = #{record.project,jdbcType=BIT},
</if>
<if test="record.projectCode != null">
project_code = #{record.projectCode,jdbcType=VARCHAR},
</if>
<if test="record.orderNumber != null">
order_number = #{record.orderNumber,jdbcType=INTEGER},
</if>
<if test="record.version != null">
version = #{record.version,jdbcType=VARCHAR},
</if>
2020-11-19 10:07:10 +08:00
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update map_info
set id = #{record.id,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
line_code = #{record.lineCode,jdbcType=VARCHAR},
city_code = #{record.cityCode,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
project = #{record.project,jdbcType=BIT},
project_code = #{record.projectCode,jdbcType=VARCHAR},
order_number = #{record.orderNumber,jdbcType=INTEGER},
version = #{record.version,jdbcType=VARCHAR}
2020-11-19 10:07:10 +08:00
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.MapInfo">
2020-11-19 10:07:10 +08:00
update map_info
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="lineCode != null">
line_code = #{lineCode,jdbcType=VARCHAR},
</if>
<if test="cityCode != null">
city_code = #{cityCode,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="project != null">
project = #{project,jdbcType=BIT},
</if>
<if test="projectCode != null">
project_code = #{projectCode,jdbcType=VARCHAR},
</if>
<if test="orderNumber != null">
order_number = #{orderNumber,jdbcType=INTEGER},
</if>
<if test="version != null">
version = #{version,jdbcType=VARCHAR},
</if>
2020-11-19 10:07:10 +08:00
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.MapInfo">
2020-11-19 10:07:10 +08:00
update map_info
set `name` = #{name,jdbcType=VARCHAR},
line_code = #{lineCode,jdbcType=VARCHAR},
city_code = #{cityCode,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
project = #{project,jdbcType=BIT},
project_code = #{projectCode,jdbcType=VARCHAR},
order_number = #{orderNumber,jdbcType=INTEGER},
version = #{version,jdbcType=VARCHAR}
2020-11-19 10:07:10 +08:00
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>