ParkingLotVoicDefaultMapper.xml 10.8 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.ParkingLotVoicDefaultMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.ParkingLotVoicDefault">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="model_type" jdbcType="VARCHAR" property="modelType" />
    <result column="voice" jdbcType="VARCHAR" property="voice" />
    <result column="description" jdbcType="VARCHAR" property="description" />
    <result column="create_op" jdbcType="VARCHAR" property="createOp" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="modfiy_op" jdbcType="VARCHAR" property="modfiyOp" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
      <collection property="details"
                  select="com.zteits.park.mapper.ParkingLotVoicDefaultMapper.getVoiceDetail"
                  column="id">
      </collection>
  </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, model_type, voice, description, create_op, create_time, modfiy_op, modify_time
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.ParkingLotVoicDefaultExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from parking_lot_voic_default
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>

    <select id="selectModelTypeByExample" parameterType="com.zteits.park.domain.ParkingLotVoicDefaultExample" resultMap="BaseResultMap">
        select
        <if test="distinct">
            distinct
        </if>
        model_type
        from parking_lot_voic_default
        <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_voic_default
    where id = #{id,jdbcType=BIGINT}
  </select>

    <select id="getVoiceDetail" parameterType="java.lang.Long"
            resultType="com.zteits.clouds.api.dto.park.dto.VoiceTemplateDetailInfoDTO">
        select
         id as id,
         temp_id as tempId,
         display_type as displayType,
         display as display,
         display_color as displayColor,
         sort as sort
        from parking_lot_voic_default_display
        where temp_id = #{id,jdbcType=BIGINT}
    </select>


  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from parking_lot_voic_default
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.ParkingLotVoicDefaultExample">
    delete from parking_lot_voic_default
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.ParkingLotVoicDefault">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into parking_lot_voic_default (model_type, voice, description, 
      create_op, create_time, modfiy_op, 
      modify_time)
    values (#{modelType,jdbcType=VARCHAR}, #{voice,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, 
      #{createOp,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{modfiyOp,jdbcType=VARCHAR}, 
      #{modifyTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.ParkingLotVoicDefault">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into parking_lot_voic_default
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="modelType != null">
        model_type,
      </if>
      <if test="voice != null">
        voice,
      </if>
      <if test="description != null">
        description,
      </if>
      <if test="createOp != null">
        create_op,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="modfiyOp != null">
        modfiy_op,
      </if>
      <if test="modifyTime != null">
        modify_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="modelType != null">
        #{modelType,jdbcType=VARCHAR},
      </if>
      <if test="voice != null">
        #{voice,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=VARCHAR},
      </if>
      <if test="createOp != null">
        #{createOp,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyOp != null">
        #{modfiyOp,jdbcType=VARCHAR},
      </if>
      <if test="modifyTime != null">
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.ParkingLotVoicDefaultExample" resultType="java.lang.Long">
    select count(*) from parking_lot_voic_default
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update parking_lot_voic_default
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.modelType != null">
        model_type = #{record.modelType,jdbcType=VARCHAR},
      </if>
      <if test="record.voice != null">
        voice = #{record.voice,jdbcType=VARCHAR},
      </if>
      <if test="record.description != null">
        description = #{record.description,jdbcType=VARCHAR},
      </if>
      <if test="record.createOp != null">
        create_op = #{record.createOp,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modfiyOp != null">
        modfiy_op = #{record.modfiyOp,jdbcType=VARCHAR},
      </if>
      <if test="record.modifyTime != null">
        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update parking_lot_voic_default
    set id = #{record.id,jdbcType=BIGINT},
      model_type = #{record.modelType,jdbcType=VARCHAR},
      voice = #{record.voice,jdbcType=VARCHAR},
      description = #{record.description,jdbcType=VARCHAR},
      create_op = #{record.createOp,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      modfiy_op = #{record.modfiyOp,jdbcType=VARCHAR},
      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.ParkingLotVoicDefault">
    update parking_lot_voic_default
    <set>
      <if test="modelType != null">
        model_type = #{modelType,jdbcType=VARCHAR},
      </if>
      <if test="voice != null">
        voice = #{voice,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        description = #{description,jdbcType=VARCHAR},
      </if>
      <if test="createOp != null">
        create_op = #{createOp,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyOp != null">
        modfiy_op = #{modfiyOp,jdbcType=VARCHAR},
      </if>
      <if test="modifyTime != null">
        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.ParkingLotVoicDefault">
    update parking_lot_voic_default
    set model_type = #{modelType,jdbcType=VARCHAR},
      voice = #{voice,jdbcType=VARCHAR},
      description = #{description,jdbcType=VARCHAR},
      create_op = #{createOp,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      modfiy_op = #{modfiyOp,jdbcType=VARCHAR},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>