IrainPknoRelationMapper.xml 8.64 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.park.mapper.IrainPknoRelationMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.IrainPknoRelation">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="irain_pkno1" jdbcType="VARCHAR" property="irainPkno1" />
    <result column="irain_pkno2" jdbcType="VARCHAR" property="irainPkno2" />
    <result column="park_lotpkno" jdbcType="VARCHAR" property="parkLotpkno" />
    <result column="park_name" jdbcType="VARCHAR" property="parkName" />
    <result column="tab_parkinglot_id" jdbcType="BIGINT" property="tabParkinglotId" />
  </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, irain_pkno1, irain_pkno2, park_lotpkno, park_name, tab_parkinglot_id
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.IrainPknoRelationExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from irain_pkno_relation
    <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 irain_pkno_relation
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from irain_pkno_relation
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.IrainPknoRelationExample">
    delete from irain_pkno_relation
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.IrainPknoRelation">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into irain_pkno_relation (irain_pkno1, irain_pkno2, park_lotpkno, 
      park_name, tab_parkinglot_id)
    values (#{irainPkno1,jdbcType=VARCHAR}, #{irainPkno2,jdbcType=VARCHAR}, #{parkLotpkno,jdbcType=VARCHAR}, 
      #{parkName,jdbcType=VARCHAR}, #{tabParkinglotId,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.IrainPknoRelation">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into irain_pkno_relation
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="irainPkno1 != null">
        irain_pkno1,
      </if>
      <if test="irainPkno2 != null">
        irain_pkno2,
      </if>
      <if test="parkLotpkno != null">
        park_lotpkno,
      </if>
      <if test="parkName != null">
        park_name,
      </if>
      <if test="tabParkinglotId != null">
        tab_parkinglot_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="irainPkno1 != null">
        #{irainPkno1,jdbcType=VARCHAR},
      </if>
      <if test="irainPkno2 != null">
        #{irainPkno2,jdbcType=VARCHAR},
      </if>
      <if test="parkLotpkno != null">
        #{parkLotpkno,jdbcType=VARCHAR},
      </if>
      <if test="parkName != null">
        #{parkName,jdbcType=VARCHAR},
      </if>
      <if test="tabParkinglotId != null">
        #{tabParkinglotId,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.IrainPknoRelationExample" resultType="java.lang.Long">
    select count(*) from irain_pkno_relation
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update irain_pkno_relation
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.irainPkno1 != null">
        irain_pkno1 = #{record.irainPkno1,jdbcType=VARCHAR},
      </if>
      <if test="record.irainPkno2 != null">
        irain_pkno2 = #{record.irainPkno2,jdbcType=VARCHAR},
      </if>
      <if test="record.parkLotpkno != null">
        park_lotpkno = #{record.parkLotpkno,jdbcType=VARCHAR},
      </if>
      <if test="record.parkName != null">
        park_name = #{record.parkName,jdbcType=VARCHAR},
      </if>
      <if test="record.tabParkinglotId != null">
        tab_parkinglot_id = #{record.tabParkinglotId,jdbcType=BIGINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update irain_pkno_relation
    set id = #{record.id,jdbcType=BIGINT},
      irain_pkno1 = #{record.irainPkno1,jdbcType=VARCHAR},
      irain_pkno2 = #{record.irainPkno2,jdbcType=VARCHAR},
      park_lotpkno = #{record.parkLotpkno,jdbcType=VARCHAR},
      park_name = #{record.parkName,jdbcType=VARCHAR},
      tab_parkinglot_id = #{record.tabParkinglotId,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.IrainPknoRelation">
    update irain_pkno_relation
    <set>
      <if test="irainPkno1 != null">
        irain_pkno1 = #{irainPkno1,jdbcType=VARCHAR},
      </if>
      <if test="irainPkno2 != null">
        irain_pkno2 = #{irainPkno2,jdbcType=VARCHAR},
      </if>
      <if test="parkLotpkno != null">
        park_lotpkno = #{parkLotpkno,jdbcType=VARCHAR},
      </if>
      <if test="parkName != null">
        park_name = #{parkName,jdbcType=VARCHAR},
      </if>
      <if test="tabParkinglotId != null">
        tab_parkinglot_id = #{tabParkinglotId,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.IrainPknoRelation">
    update irain_pkno_relation
    set irain_pkno1 = #{irainPkno1,jdbcType=VARCHAR},
      irain_pkno2 = #{irainPkno2,jdbcType=VARCHAR},
      park_lotpkno = #{parkLotpkno,jdbcType=VARCHAR},
      park_name = #{parkName,jdbcType=VARCHAR},
      tab_parkinglot_id = #{tabParkinglotId,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>