ParkingLotDoorMapper.xml 8.3 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.ParkingLotDoorMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.ParkingLotDoor">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="pl_source_type" jdbcType="INTEGER" property="plSourceType" />
    <result column="pl_door_type" jdbcType="INTEGER" property="plDoorType" />
    <result column="pl_door_id" jdbcType="VARCHAR" property="plDoorId" />
    <result column="pl_door_name" jdbcType="VARCHAR" property="plDoorName" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
  </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="Base_Column_List">
    id, pl_no, pl_name, pl_source_type, pl_door_type, pl_door_id, pl_door_name, data_status, 
    create_empid, create_date, modfiy_empid, modfiy_date
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.ParkingLotDoorExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from parking_lot_door
    <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 parking_lot_door
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from parking_lot_door
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.ParkingLotDoor">
    insert into parking_lot_door (id, pl_no, pl_name, 
      pl_source_type, pl_door_type, pl_door_id, 
      pl_door_name, data_status, create_empid, 
      create_date, modfiy_empid, modfiy_date
      )
    values (#{id,jdbcType=BIGINT}, #{plNo,jdbcType=VARCHAR}, #{plName,jdbcType=VARCHAR}, 
      #{plSourceType,jdbcType=INTEGER}, #{plDoorType,jdbcType=INTEGER}, #{plDoorId,jdbcType=VARCHAR}, 
      #{plDoorName,jdbcType=VARCHAR}, #{dataStatus,jdbcType=INTEGER}, #{createEmpid,jdbcType=VARCHAR}, 
      #{createDate,jdbcType=TIMESTAMP}, #{modfiyEmpid,jdbcType=VARCHAR}, #{modfiyDate,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.ParkingLotDoor">
    insert into parking_lot_door
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="plName != null">
        pl_name,
      </if>
      <if test="plSourceType != null">
        pl_source_type,
      </if>
      <if test="plDoorType != null">
        pl_door_type,
      </if>
      <if test="plDoorId != null">
        pl_door_id,
      </if>
      <if test="plDoorName != null">
        pl_door_name,
      </if>
      <if test="dataStatus != null">
        data_status,
      </if>
      <if test="createEmpid != null">
        create_empid,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="modfiyEmpid != null">
        modfiy_empid,
      </if>
      <if test="modfiyDate != null">
        modfiy_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="plName != null">
        #{plName,jdbcType=VARCHAR},
      </if>
      <if test="plSourceType != null">
        #{plSourceType,jdbcType=INTEGER},
      </if>
      <if test="plDoorType != null">
        #{plDoorType,jdbcType=INTEGER},
      </if>
      <if test="plDoorId != null">
        #{plDoorId,jdbcType=VARCHAR},
      </if>
      <if test="plDoorName != null">
        #{plDoorName,jdbcType=VARCHAR},
      </if>
      <if test="dataStatus != null">
        #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpid != null">
        #{modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.ParkingLotDoorExample" resultType="java.lang.Integer">
    select count(*) from parking_lot_door
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.ParkingLotDoor">
    update parking_lot_door
    <set>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="plName != null">
        pl_name = #{plName,jdbcType=VARCHAR},
      </if>
      <if test="plSourceType != null">
        pl_source_type = #{plSourceType,jdbcType=INTEGER},
      </if>
      <if test="plDoorType != null">
        pl_door_type = #{plDoorType,jdbcType=INTEGER},
      </if>
      <if test="plDoorId != null">
        pl_door_id = #{plDoorId,jdbcType=VARCHAR},
      </if>
      <if test="plDoorName != null">
        pl_door_name = #{plDoorName,jdbcType=VARCHAR},
      </if>
      <if test="dataStatus != null">
        data_status = #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        create_empid = #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpid != null">
        modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.ParkingLotDoor">
    update parking_lot_door
    set pl_no = #{plNo,jdbcType=VARCHAR},
      pl_name = #{plName,jdbcType=VARCHAR},
      pl_source_type = #{plSourceType,jdbcType=INTEGER},
      pl_door_type = #{plDoorType,jdbcType=INTEGER},
      pl_door_id = #{plDoorId,jdbcType=VARCHAR},
      pl_door_name = #{plDoorName,jdbcType=VARCHAR},
      data_status = #{dataStatus,jdbcType=INTEGER},
      create_empid = #{createEmpid,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
      modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>