EnclosedParkingLotConfigMapper.xml 11 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.EnclosedParkingLotConfigMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.EnclosedParkingLotConfig">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="area_id" jdbcType="BIGINT" property="areaId" />
    <result column="config_type" jdbcType="VARCHAR" property="configType" />
    <result column="config_name" jdbcType="VARCHAR" property="configName" />
    <result column="config_code" jdbcType="VARCHAR" property="configCode" />
    <result column="config_value" jdbcType="VARCHAR" property="configValue" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="sort" jdbcType="INTEGER" property="sort" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </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_no, area_id, config_type, config_name, config_code, config_value, remarks, 
    sort, create_time
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.EnclosedParkingLotConfigExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from enclosed_parking_lot_config
    <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 enclosed_parking_lot_config
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from enclosed_parking_lot_config
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.EnclosedParkingLotConfigExample">
    delete from enclosed_parking_lot_config
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.EnclosedParkingLotConfig">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into enclosed_parking_lot_config (pl_no, area_id, config_type, 
      config_name, config_code, config_value, 
      remarks, sort, create_time
      )
    values (#{plNo,jdbcType=VARCHAR}, #{areaId,jdbcType=BIGINT}, #{configType,jdbcType=VARCHAR}, 
      #{configName,jdbcType=VARCHAR}, #{configCode,jdbcType=VARCHAR}, #{configValue,jdbcType=VARCHAR}, 
      #{remarks,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.EnclosedParkingLotConfig">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into enclosed_parking_lot_config
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="areaId != null">
        area_id,
      </if>
      <if test="configType != null">
        config_type,
      </if>
      <if test="configName != null">
        config_name,
      </if>
      <if test="configCode != null">
        config_code,
      </if>
      <if test="configValue != null">
        config_value,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="sort != null">
        sort,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="areaId != null">
        #{areaId,jdbcType=BIGINT},
      </if>
      <if test="configType != null">
        #{configType,jdbcType=VARCHAR},
      </if>
      <if test="configName != null">
        #{configName,jdbcType=VARCHAR},
      </if>
      <if test="configCode != null">
        #{configCode,jdbcType=VARCHAR},
      </if>
      <if test="configValue != null">
        #{configValue,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="sort != null">
        #{sort,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.EnclosedParkingLotConfigExample" resultType="java.lang.Long">
    select count(*) from enclosed_parking_lot_config
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update enclosed_parking_lot_config
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.plNo != null">
        pl_no = #{record.plNo,jdbcType=VARCHAR},
      </if>
      <if test="record.areaId != null">
        area_id = #{record.areaId,jdbcType=BIGINT},
      </if>
      <if test="record.configType != null">
        config_type = #{record.configType,jdbcType=VARCHAR},
      </if>
      <if test="record.configName != null">
        config_name = #{record.configName,jdbcType=VARCHAR},
      </if>
      <if test="record.configCode != null">
        config_code = #{record.configCode,jdbcType=VARCHAR},
      </if>
      <if test="record.configValue != null">
        config_value = #{record.configValue,jdbcType=VARCHAR},
      </if>
      <if test="record.remarks != null">
        remarks = #{record.remarks,jdbcType=VARCHAR},
      </if>
      <if test="record.sort != null">
        sort = #{record.sort,jdbcType=INTEGER},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update enclosed_parking_lot_config
    set id = #{record.id,jdbcType=BIGINT},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      area_id = #{record.areaId,jdbcType=BIGINT},
      config_type = #{record.configType,jdbcType=VARCHAR},
      config_name = #{record.configName,jdbcType=VARCHAR},
      config_code = #{record.configCode,jdbcType=VARCHAR},
      config_value = #{record.configValue,jdbcType=VARCHAR},
      remarks = #{record.remarks,jdbcType=VARCHAR},
      sort = #{record.sort,jdbcType=INTEGER},
      create_time = #{record.createTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.EnclosedParkingLotConfig">
    update enclosed_parking_lot_config
    <set>
      <if test="plNo != null and plNo != ''">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="areaId != null and areaId != ''">
        area_id = #{areaId,jdbcType=BIGINT},
      </if>
      <if test="configType != null and configType != ''">
        config_type = #{configType,jdbcType=VARCHAR},
      </if>
      <if test="configName != null and configName != ''">
        config_name = #{configName,jdbcType=VARCHAR},
      </if>
      <if test="configCode != null and configCode != ''">
        config_code = #{configCode,jdbcType=VARCHAR},
      </if>
      <if test="configValue != null and configValue != ''">
        config_value = #{configValue,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null and remarks != ''">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="sort != null ">
        sort = #{sort,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.EnclosedParkingLotConfig">
    update enclosed_parking_lot_config
    set pl_no = #{plNo,jdbcType=VARCHAR},
      area_id = #{areaId,jdbcType=BIGINT},
      config_type = #{configType,jdbcType=VARCHAR},
      config_name = #{configName,jdbcType=VARCHAR},
      config_code = #{configCode,jdbcType=VARCHAR},
      config_value = #{configValue,jdbcType=VARCHAR},
      remarks = #{remarks,jdbcType=VARCHAR},
      sort = #{sort,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>