ParkingLotEquipmentConfigDetailMapper.xml 8.39 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.ParkingLotEquipmentConfigDetailMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.ParkingLotEquipmentConfigDetail">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="equipment_id" jdbcType="BIGINT" property="equipmentId" />
    <result column="config_key" jdbcType="VARCHAR" property="configKey" />
    <result column="config_value" jdbcType="VARCHAR" property="configValue" />
    <result column="config_description" jdbcType="VARCHAR" property="configDescription" />
  </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, equipment_id, config_key, config_value, config_description
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDetailExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from parking_lot_equipment_config_detail
    <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_detail
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from parking_lot_equipment_config_detail
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDetailExample">
    delete from parking_lot_equipment_config_detail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDetail">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into parking_lot_equipment_config_detail (equipment_id, config_key, config_value, 
      config_description)
    values (#{equipmentId,jdbcType=BIGINT}, #{configKey,jdbcType=VARCHAR}, #{configValue,jdbcType=VARCHAR}, 
      #{configDescription,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDetail">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into parking_lot_equipment_config_detail
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="equipmentId != null">
        equipment_id,
      </if>
      <if test="configKey != null">
        config_key,
      </if>
      <if test="configValue != null">
        config_value,
      </if>
      <if test="configDescription != null">
        config_description,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="equipmentId != null">
        #{equipmentId,jdbcType=BIGINT},
      </if>
      <if test="configKey != null">
        #{configKey,jdbcType=VARCHAR},
      </if>
      <if test="configValue != null">
        #{configValue,jdbcType=VARCHAR},
      </if>
      <if test="configDescription != null">
        #{configDescription,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDetailExample" resultType="java.lang.Long">
    select count(*) from parking_lot_equipment_config_detail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update parking_lot_equipment_config_detail
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.equipmentId != null">
        equipment_id = #{record.equipmentId,jdbcType=BIGINT},
      </if>
      <if test="record.configKey != null">
        config_key = #{record.configKey,jdbcType=VARCHAR},
      </if>
      <if test="record.configValue != null">
        config_value = #{record.configValue,jdbcType=VARCHAR},
      </if>
      <if test="record.configDescription != null">
        config_description = #{record.configDescription,jdbcType=VARCHAR},
      </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_detail
    set id = #{record.id,jdbcType=BIGINT},
      equipment_id = #{record.equipmentId,jdbcType=BIGINT},
      config_key = #{record.configKey,jdbcType=VARCHAR},
      config_value = #{record.configValue,jdbcType=VARCHAR},
      config_description = #{record.configDescription,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDetail">
    update parking_lot_equipment_config_detail
    <set>
      <if test="equipmentId != null">
        equipment_id = #{equipmentId,jdbcType=BIGINT},
      </if>
      <if test="configKey != null">
        config_key = #{configKey,jdbcType=VARCHAR},
      </if>
      <if test="configValue != null">
        config_value = #{configValue,jdbcType=VARCHAR},
      </if>
      <if test="configDescription != null">
        config_description = #{configDescription,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.ParkingLotEquipmentConfigDetail">
    update parking_lot_equipment_config_detail
    set equipment_id = #{equipmentId,jdbcType=BIGINT},
      config_key = #{configKey,jdbcType=VARCHAR},
      config_value = #{configValue,jdbcType=VARCHAR},
      config_description = #{configDescription,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>