ParkingLotUseStatisticMapper.xml 15.4 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.ParkingLotUseStatisticMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.ParkingLotUseStatistic">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="free_ratio" jdbcType="DOUBLE" property="freeRatio" />
    <result column="statistic_type" jdbcType="INTEGER" property="statisticType" />
    <result column="turnover_ratio" jdbcType="DOUBLE" property="turnoverRatio" />
    <result column="tmp_vehicle_flow" jdbcType="INTEGER" property="tmpVehicleFlow" />
    <result column="vehicle_flow" jdbcType="INTEGER" property="vehicleFlow" />
    <result column="fix_vehicle_flow" jdbcType="INTEGER" property="fixVehicleFlow" />
    <result column="statistic_begin_time" jdbcType="TIMESTAMP" property="statisticBeginTime" />
    <result column="statistic_end_time" jdbcType="TIMESTAMP" property="statisticEndTime" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="out_park_count" jdbcType="INTEGER" property="outParkCount" />
    <result column="total_free_berths" jdbcType="INTEGER" property="totalFreeBerths" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="total_berths" jdbcType="INTEGER" property="totalBerths" />
  </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, free_ratio, statistic_type, turnover_ratio, tmp_vehicle_flow, vehicle_flow, 
    fix_vehicle_flow, statistic_begin_time, statistic_end_time, create_time, data_status, 
    out_park_count, total_free_berths, pl_name, total_berths
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.ParkingLotUseStatisticExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from parking_lot_use_statistic
    <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_use_statistic
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from parking_lot_use_statistic
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.ParkingLotUseStatisticExample">
    delete from parking_lot_use_statistic
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.ParkingLotUseStatistic">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into parking_lot_use_statistic (pl_no, free_ratio, statistic_type, 
      turnover_ratio, tmp_vehicle_flow, vehicle_flow, 
      fix_vehicle_flow, statistic_begin_time, statistic_end_time, 
      create_time, data_status, out_park_count, 
      total_free_berths, pl_name, total_berths
      )
    values (#{plNo,jdbcType=VARCHAR}, #{freeRatio,jdbcType=DOUBLE}, #{statisticType,jdbcType=INTEGER}, 
      #{turnoverRatio,jdbcType=DOUBLE}, #{tmpVehicleFlow,jdbcType=INTEGER}, #{vehicleFlow,jdbcType=INTEGER}, 
      #{fixVehicleFlow,jdbcType=INTEGER}, #{statisticBeginTime,jdbcType=TIMESTAMP}, #{statisticEndTime,jdbcType=TIMESTAMP}, 
      #{createTime,jdbcType=TIMESTAMP}, #{dataStatus,jdbcType=INTEGER}, #{outParkCount,jdbcType=INTEGER}, 
      #{totalFreeBerths,jdbcType=INTEGER}, #{plName,jdbcType=VARCHAR}, #{totalBerths,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.ParkingLotUseStatistic">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into parking_lot_use_statistic
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="freeRatio != null">
        free_ratio,
      </if>
      <if test="statisticType != null">
        statistic_type,
      </if>
      <if test="turnoverRatio != null">
        turnover_ratio,
      </if>
      <if test="tmpVehicleFlow != null">
        tmp_vehicle_flow,
      </if>
      <if test="vehicleFlow != null">
        vehicle_flow,
      </if>
      <if test="fixVehicleFlow != null">
        fix_vehicle_flow,
      </if>
      <if test="statisticBeginTime != null">
        statistic_begin_time,
      </if>
      <if test="statisticEndTime != null">
        statistic_end_time,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="dataStatus != null">
        data_status,
      </if>
      <if test="outParkCount != null">
        out_park_count,
      </if>
      <if test="totalFreeBerths != null">
        total_free_berths,
      </if>
      <if test="plName != null">
        pl_name,
      </if>
      <if test="totalBerths != null">
        total_berths,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="freeRatio != null">
        #{freeRatio,jdbcType=DOUBLE},
      </if>
      <if test="statisticType != null">
        #{statisticType,jdbcType=INTEGER},
      </if>
      <if test="turnoverRatio != null">
        #{turnoverRatio,jdbcType=DOUBLE},
      </if>
      <if test="tmpVehicleFlow != null">
        #{tmpVehicleFlow,jdbcType=INTEGER},
      </if>
      <if test="vehicleFlow != null">
        #{vehicleFlow,jdbcType=INTEGER},
      </if>
      <if test="fixVehicleFlow != null">
        #{fixVehicleFlow,jdbcType=INTEGER},
      </if>
      <if test="statisticBeginTime != null">
        #{statisticBeginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="statisticEndTime != null">
        #{statisticEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dataStatus != null">
        #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="outParkCount != null">
        #{outParkCount,jdbcType=INTEGER},
      </if>
      <if test="totalFreeBerths != null">
        #{totalFreeBerths,jdbcType=INTEGER},
      </if>
      <if test="plName != null">
        #{plName,jdbcType=VARCHAR},
      </if>
      <if test="totalBerths != null">
        #{totalBerths,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.ParkingLotUseStatisticExample" resultType="java.lang.Long">
    select count(*) from parking_lot_use_statistic
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update parking_lot_use_statistic
    <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.freeRatio != null">
        free_ratio = #{record.freeRatio,jdbcType=DOUBLE},
      </if>
      <if test="record.statisticType != null">
        statistic_type = #{record.statisticType,jdbcType=INTEGER},
      </if>
      <if test="record.turnoverRatio != null">
        turnover_ratio = #{record.turnoverRatio,jdbcType=DOUBLE},
      </if>
      <if test="record.tmpVehicleFlow != null">
        tmp_vehicle_flow = #{record.tmpVehicleFlow,jdbcType=INTEGER},
      </if>
      <if test="record.vehicleFlow != null">
        vehicle_flow = #{record.vehicleFlow,jdbcType=INTEGER},
      </if>
      <if test="record.fixVehicleFlow != null">
        fix_vehicle_flow = #{record.fixVehicleFlow,jdbcType=INTEGER},
      </if>
      <if test="record.statisticBeginTime != null">
        statistic_begin_time = #{record.statisticBeginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.statisticEndTime != null">
        statistic_end_time = #{record.statisticEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.dataStatus != null">
        data_status = #{record.dataStatus,jdbcType=INTEGER},
      </if>
      <if test="record.outParkCount != null">
        out_park_count = #{record.outParkCount,jdbcType=INTEGER},
      </if>
      <if test="record.totalFreeBerths != null">
        total_free_berths = #{record.totalFreeBerths,jdbcType=INTEGER},
      </if>
      <if test="record.plName != null">
        pl_name = #{record.plName,jdbcType=VARCHAR},
      </if>
      <if test="record.totalBerths != null">
        total_berths = #{record.totalBerths,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_use_statistic
    set id = #{record.id,jdbcType=BIGINT},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      free_ratio = #{record.freeRatio,jdbcType=DOUBLE},
      statistic_type = #{record.statisticType,jdbcType=INTEGER},
      turnover_ratio = #{record.turnoverRatio,jdbcType=DOUBLE},
      tmp_vehicle_flow = #{record.tmpVehicleFlow,jdbcType=INTEGER},
      vehicle_flow = #{record.vehicleFlow,jdbcType=INTEGER},
      fix_vehicle_flow = #{record.fixVehicleFlow,jdbcType=INTEGER},
      statistic_begin_time = #{record.statisticBeginTime,jdbcType=TIMESTAMP},
      statistic_end_time = #{record.statisticEndTime,jdbcType=TIMESTAMP},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      data_status = #{record.dataStatus,jdbcType=INTEGER},
      out_park_count = #{record.outParkCount,jdbcType=INTEGER},
      total_free_berths = #{record.totalFreeBerths,jdbcType=INTEGER},
      pl_name = #{record.plName,jdbcType=VARCHAR},
      total_berths = #{record.totalBerths,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.ParkingLotUseStatistic">
    update parking_lot_use_statistic
    <set>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="freeRatio != null">
        free_ratio = #{freeRatio,jdbcType=DOUBLE},
      </if>
      <if test="statisticType != null">
        statistic_type = #{statisticType,jdbcType=INTEGER},
      </if>
      <if test="turnoverRatio != null">
        turnover_ratio = #{turnoverRatio,jdbcType=DOUBLE},
      </if>
      <if test="tmpVehicleFlow != null">
        tmp_vehicle_flow = #{tmpVehicleFlow,jdbcType=INTEGER},
      </if>
      <if test="vehicleFlow != null">
        vehicle_flow = #{vehicleFlow,jdbcType=INTEGER},
      </if>
      <if test="fixVehicleFlow != null">
        fix_vehicle_flow = #{fixVehicleFlow,jdbcType=INTEGER},
      </if>
      <if test="statisticBeginTime != null">
        statistic_begin_time = #{statisticBeginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="statisticEndTime != null">
        statistic_end_time = #{statisticEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dataStatus != null">
        data_status = #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="outParkCount != null">
        out_park_count = #{outParkCount,jdbcType=INTEGER},
      </if>
      <if test="totalFreeBerths != null">
        total_free_berths = #{totalFreeBerths,jdbcType=INTEGER},
      </if>
      <if test="plName != null">
        pl_name = #{plName,jdbcType=VARCHAR},
      </if>
      <if test="totalBerths != null">
        total_berths = #{totalBerths,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.ParkingLotUseStatistic">
    update parking_lot_use_statistic
    set pl_no = #{plNo,jdbcType=VARCHAR},
      free_ratio = #{freeRatio,jdbcType=DOUBLE},
      statistic_type = #{statisticType,jdbcType=INTEGER},
      turnover_ratio = #{turnoverRatio,jdbcType=DOUBLE},
      tmp_vehicle_flow = #{tmpVehicleFlow,jdbcType=INTEGER},
      vehicle_flow = #{vehicleFlow,jdbcType=INTEGER},
      fix_vehicle_flow = #{fixVehicleFlow,jdbcType=INTEGER},
      statistic_begin_time = #{statisticBeginTime,jdbcType=TIMESTAMP},
      statistic_end_time = #{statisticEndTime,jdbcType=TIMESTAMP},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      data_status = #{dataStatus,jdbcType=INTEGER},
      out_park_count = #{outParkCount,jdbcType=INTEGER},
      total_free_berths = #{totalFreeBerths,jdbcType=INTEGER},
      pl_name = #{plName,jdbcType=VARCHAR},
      total_berths = #{totalBerths,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>