ParkFreeBerthMapper.xml 9.98 KB
<?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.zteits.job.mapper.ParkFreeBerthMapper">
  <resultMap id="BaseResultMap" type="com.zteits.job.domain.ParkFreeBerth">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="pl_id" jdbcType="BIGINT" property="plId" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="free_berth" jdbcType="INTEGER" property="freeBerth" />
    <result column="real_free_berth" jdbcType="INTEGER" property="realFreeBerth" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="type" jdbcType="VARCHAR" property="type" />
  </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, pl_id, pl_name, pl_no, free_berth, real_free_berth, data_status, modify_time, 
    type
  </sql>
  <select id="selectByExample" parameterType="com.zteits.job.domain.ParkFreeBerthExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    'true' as QUERYID,
    <include refid="Base_Column_List" />
    from park_free_berth
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from park_free_berth
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from park_free_berth
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.job.domain.ParkFreeBerthExample">
    delete from park_free_berth
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.job.domain.ParkFreeBerth">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into park_free_berth (pl_id, pl_name, pl_no, 
      free_berth, real_free_berth, data_status, 
      modify_time, type)
    values (#{plId,jdbcType=BIGINT}, #{plName,jdbcType=VARCHAR}, #{plNo,jdbcType=VARCHAR}, 
      #{freeBerth,jdbcType=INTEGER}, #{realFreeBerth,jdbcType=INTEGER}, #{dataStatus,jdbcType=INTEGER}, 
      #{modifyTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.job.domain.ParkFreeBerth">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into park_free_berth
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="plId != null">
        pl_id,
      </if>
      <if test="plName != null">
        pl_name,
      </if>
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="freeBerth != null">
        free_berth,
      </if>
      <if test="realFreeBerth != null">
        real_free_berth,
      </if>
      <if test="dataStatus != null">
        data_status,
      </if>
      <if test="modifyTime != null">
        modify_time,
      </if>
      <if test="type != null">
        type,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="plId != null">
        #{plId,jdbcType=BIGINT},
      </if>
      <if test="plName != null">
        #{plName,jdbcType=VARCHAR},
      </if>
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="freeBerth != null">
        #{freeBerth,jdbcType=INTEGER},
      </if>
      <if test="realFreeBerth != null">
        #{realFreeBerth,jdbcType=INTEGER},
      </if>
      <if test="dataStatus != null">
        #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="modifyTime != null">
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.job.domain.ParkFreeBerthExample" resultType="java.lang.Long">
    select count(*) from park_free_berth
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update park_free_berth
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.plId != null">
        pl_id = #{record.plId,jdbcType=BIGINT},
      </if>
      <if test="record.plName != null">
        pl_name = #{record.plName,jdbcType=VARCHAR},
      </if>
      <if test="record.plNo != null">
        pl_no = #{record.plNo,jdbcType=VARCHAR},
      </if>
      <if test="record.freeBerth != null">
        free_berth = #{record.freeBerth,jdbcType=INTEGER},
      </if>
      <if test="record.realFreeBerth != null">
        real_free_berth = #{record.realFreeBerth,jdbcType=INTEGER},
      </if>
      <if test="record.dataStatus != null">
        data_status = #{record.dataStatus,jdbcType=INTEGER},
      </if>
      <if test="record.modifyTime != null">
        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.type != null">
        type = #{record.type,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update park_free_berth
    set id = #{record.id,jdbcType=BIGINT},
      pl_id = #{record.plId,jdbcType=BIGINT},
      pl_name = #{record.plName,jdbcType=VARCHAR},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      free_berth = #{record.freeBerth,jdbcType=INTEGER},
      real_free_berth = #{record.realFreeBerth,jdbcType=INTEGER},
      data_status = #{record.dataStatus,jdbcType=INTEGER},
      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      type = #{record.type,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.job.domain.ParkFreeBerth">
    update park_free_berth
    <set>
      <if test="plId != null">
        pl_id = #{plId,jdbcType=BIGINT},
      </if>
      <if test="plName != null">
        pl_name = #{plName,jdbcType=VARCHAR},
      </if>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="freeBerth != null">
        free_berth = #{freeBerth,jdbcType=INTEGER},
      </if>
      <if test="realFreeBerth != null">
        real_free_berth = #{realFreeBerth,jdbcType=INTEGER},
      </if>
      <if test="dataStatus != null">
        data_status = #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="modifyTime != null">
        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.job.domain.ParkFreeBerth">
    update park_free_berth
    set pl_id = #{plId,jdbcType=BIGINT},
      pl_name = #{plName,jdbcType=VARCHAR},
      pl_no = #{plNo,jdbcType=VARCHAR},
      free_berth = #{freeBerth,jdbcType=INTEGER},
      real_free_berth = #{realFreeBerth,jdbcType=INTEGER},
      data_status = #{dataStatus,jdbcType=INTEGER},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      type = #{type,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>