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

275 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="draw_way" jdbcType="BIT" property="drawWay" />
<result column="order_number" jdbcType="INTEGER" property="orderNumber" />
</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, draw_way, order_number
</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,
draw_way, order_number)
values (#{name,jdbcType=VARCHAR}, #{lineCode,jdbcType=VARCHAR}, #{cityCode,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{project,jdbcType=BIT}, #{projectCode,jdbcType=VARCHAR},
#{drawWay,jdbcType=BIT}, #{orderNumber,jdbcType=INTEGER})
</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="drawWay != null">
draw_way,
</if>
<if test="orderNumber != null">
order_number,
</if>
</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="drawWay != null">
#{drawWay,jdbcType=BIT},
</if>
<if test="orderNumber != null">
#{orderNumber,jdbcType=INTEGER},
</if>
</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.drawWay != null">
draw_way = #{record.drawWay,jdbcType=BIT},
</if>
<if test="record.orderNumber != null">
order_number = #{record.orderNumber,jdbcType=INTEGER},
</if>
</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},
draw_way = #{record.drawWay,jdbcType=BIT},
order_number = #{record.orderNumber,jdbcType=INTEGER}
<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="drawWay != null">
draw_way = #{drawWay,jdbcType=BIT},
</if>
<if test="orderNumber != null">
order_number = #{orderNumber,jdbcType=INTEGER},
</if>
</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},
draw_way = #{drawWay,jdbcType=BIT},
order_number = #{orderNumber,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>