ParkingLotEquipmentConfigDefMapper.xml 9.05 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.ParkingLotEquipmentConfigDefMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.ParkingLotEquipmentConfigDef">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="driver_code" jdbcType="VARCHAR" property="driverCode" />
    <result column="config_key" jdbcType="VARCHAR" property="configKey" />
    <result column="config_description" jdbcType="VARCHAR" property="configDescription" />
    <result column="config_default_value" jdbcType="VARCHAR" property="configDefaultValue" />
    <result column="config_use" jdbcType="INTEGER" property="configUse" />
  </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, driver_code, config_key, config_description, config_default_value, config_use
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDefExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from parking_lot_equipment_config_def
    <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_equipment_config_def
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from parking_lot_equipment_config_def
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDefExample">
    delete from parking_lot_equipment_config_def
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDef">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into parking_lot_equipment_config_def (driver_code, config_key, config_description, 
      config_default_value, config_use)
    values (#{driverCode,jdbcType=VARCHAR}, #{configKey,jdbcType=VARCHAR}, #{configDescription,jdbcType=VARCHAR}, 
      #{configDefaultValue,jdbcType=VARCHAR}, #{configUse,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDef">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into parking_lot_equipment_config_def
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="driverCode != null">
        driver_code,
      </if>
      <if test="configKey != null">
        config_key,
      </if>
      <if test="configDescription != null">
        config_description,
      </if>
      <if test="configDefaultValue != null">
        config_default_value,
      </if>
      <if test="configUse != null">
        config_use,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="driverCode != null">
        #{driverCode,jdbcType=VARCHAR},
      </if>
      <if test="configKey != null">
        #{configKey,jdbcType=VARCHAR},
      </if>
      <if test="configDescription != null">
        #{configDescription,jdbcType=VARCHAR},
      </if>
      <if test="configDefaultValue != null">
        #{configDefaultValue,jdbcType=VARCHAR},
      </if>
      <if test="configUse != null">
        #{configUse,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDefExample" resultType="java.lang.Long">
    select count(*) from parking_lot_equipment_config_def
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update parking_lot_equipment_config_def
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.driverCode != null">
        driver_code = #{record.driverCode,jdbcType=VARCHAR},
      </if>
      <if test="record.configKey != null">
        config_key = #{record.configKey,jdbcType=VARCHAR},
      </if>
      <if test="record.configDescription != null">
        config_description = #{record.configDescription,jdbcType=VARCHAR},
      </if>
      <if test="record.configDefaultValue != null">
        config_default_value = #{record.configDefaultValue,jdbcType=VARCHAR},
      </if>
      <if test="record.configUse != null">
        config_use = #{record.configUse,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update parking_lot_equipment_config_def
    set id = #{record.id,jdbcType=BIGINT},
      driver_code = #{record.driverCode,jdbcType=VARCHAR},
      config_key = #{record.configKey,jdbcType=VARCHAR},
      config_description = #{record.configDescription,jdbcType=VARCHAR},
      config_default_value = #{record.configDefaultValue,jdbcType=VARCHAR},
      config_use = #{record.configUse,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDef">
    update parking_lot_equipment_config_def
    <set>
      <if test="driverCode != null">
        driver_code = #{driverCode,jdbcType=VARCHAR},
      </if>
      <if test="configKey != null">
        config_key = #{configKey,jdbcType=VARCHAR},
      </if>
      <if test="configDescription != null">
        config_description = #{configDescription,jdbcType=VARCHAR},
      </if>
      <if test="configDefaultValue != null">
        config_default_value = #{configDefaultValue,jdbcType=VARCHAR},
      </if>
      <if test="configUse != null">
        config_use = #{configUse,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDef">
    update parking_lot_equipment_config_def
    set driver_code = #{driverCode,jdbcType=VARCHAR},
      config_key = #{configKey,jdbcType=VARCHAR},
      config_description = #{configDescription,jdbcType=VARCHAR},
      config_default_value = #{configDefaultValue,jdbcType=VARCHAR},
      config_use = #{configUse,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>