HubParkingEntranceExitMapper.xml 13.9 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.HubParkingEntranceExitMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.HubParkingEntranceExit">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="park_code" jdbcType="VARCHAR" property="parkCode" />
    <result column="entrance_type" jdbcType="INTEGER" property="entranceType" />
    <result column="cr_name" jdbcType="VARCHAR" property="crName" />
    <result column="cr_no" jdbcType="VARCHAR" property="crNo" />
    <result column="cr_road_name" jdbcType="VARCHAR" property="crRoadName" />
    <result column="cr_longitude" jdbcType="VARCHAR" property="crLongitude" />
    <result column="cr_latitude" jdbcType="VARCHAR" property="crLatitude" />
    <result column="cr_picture" jdbcType="VARCHAR" property="crPicture" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_op" jdbcType="VARCHAR" property="createOp" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="modify_op" jdbcType="VARCHAR" property="modifyOp" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </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, park_code, entrance_type, cr_name, cr_no, cr_road_name, cr_longitude, cr_latitude, 
    cr_picture, data_status, create_time, create_op, modify_time, modify_op, remark
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.HubParkingEntranceExitExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from hub_parking_entrance_exit
    <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.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from hub_parking_entrance_exit
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from hub_parking_entrance_exit
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.HubParkingEntranceExitExample">
    delete from hub_parking_entrance_exit
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.HubParkingEntranceExit">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into hub_parking_entrance_exit (park_code, entrance_type, cr_name, 
      cr_no, cr_road_name, cr_longitude, 
      cr_latitude, cr_picture, data_status, 
      create_time, create_op, modify_time, 
      modify_op, remark)
    values (#{parkCode,jdbcType=VARCHAR}, #{entranceType,jdbcType=INTEGER}, #{crName,jdbcType=VARCHAR}, 
      #{crNo,jdbcType=VARCHAR}, #{crRoadName,jdbcType=VARCHAR}, #{crLongitude,jdbcType=VARCHAR}, 
      #{crLatitude,jdbcType=VARCHAR}, #{crPicture,jdbcType=VARCHAR}, #{dataStatus,jdbcType=INTEGER}, 
      #{createTime,jdbcType=TIMESTAMP}, #{createOp,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, 
      #{modifyOp,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.HubParkingEntranceExit">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into hub_parking_entrance_exit
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="parkCode != null">
        park_code,
      </if>
      <if test="entranceType != null">
        entrance_type,
      </if>
      <if test="crName != null">
        cr_name,
      </if>
      <if test="crNo != null">
        cr_no,
      </if>
      <if test="crRoadName != null">
        cr_road_name,
      </if>
      <if test="crLongitude != null">
        cr_longitude,
      </if>
      <if test="crLatitude != null">
        cr_latitude,
      </if>
      <if test="crPicture != null">
        cr_picture,
      </if>
      <if test="dataStatus != null">
        data_status,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createOp != null">
        create_op,
      </if>
      <if test="modifyTime != null">
        modify_time,
      </if>
      <if test="modifyOp != null">
        modify_op,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="parkCode != null">
        #{parkCode,jdbcType=VARCHAR},
      </if>
      <if test="entranceType != null">
        #{entranceType,jdbcType=INTEGER},
      </if>
      <if test="crName != null">
        #{crName,jdbcType=VARCHAR},
      </if>
      <if test="crNo != null">
        #{crNo,jdbcType=VARCHAR},
      </if>
      <if test="crRoadName != null">
        #{crRoadName,jdbcType=VARCHAR},
      </if>
      <if test="crLongitude != null">
        #{crLongitude,jdbcType=VARCHAR},
      </if>
      <if test="crLatitude != null">
        #{crLatitude,jdbcType=VARCHAR},
      </if>
      <if test="crPicture != null">
        #{crPicture,jdbcType=VARCHAR},
      </if>
      <if test="dataStatus != null">
        #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createOp != null">
        #{createOp,jdbcType=VARCHAR},
      </if>
      <if test="modifyTime != null">
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null">
        #{modifyOp,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.HubParkingEntranceExitExample" resultType="java.lang.Long">
    select count(*) from hub_parking_entrance_exit
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update hub_parking_entrance_exit
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.parkCode != null">
        park_code = #{record.parkCode,jdbcType=VARCHAR},
      </if>
      <if test="record.entranceType != null">
        entrance_type = #{record.entranceType,jdbcType=INTEGER},
      </if>
      <if test="record.crName != null">
        cr_name = #{record.crName,jdbcType=VARCHAR},
      </if>
      <if test="record.crNo != null">
        cr_no = #{record.crNo,jdbcType=VARCHAR},
      </if>
      <if test="record.crRoadName != null">
        cr_road_name = #{record.crRoadName,jdbcType=VARCHAR},
      </if>
      <if test="record.crLongitude != null">
        cr_longitude = #{record.crLongitude,jdbcType=VARCHAR},
      </if>
      <if test="record.crLatitude != null">
        cr_latitude = #{record.crLatitude,jdbcType=VARCHAR},
      </if>
      <if test="record.crPicture != null">
        cr_picture = #{record.crPicture,jdbcType=VARCHAR},
      </if>
      <if test="record.dataStatus != null">
        data_status = #{record.dataStatus,jdbcType=INTEGER},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createOp != null">
        create_op = #{record.createOp,jdbcType=VARCHAR},
      </if>
      <if test="record.modifyTime != null">
        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modifyOp != null">
        modify_op = #{record.modifyOp,jdbcType=VARCHAR},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update hub_parking_entrance_exit
    set id = #{record.id,jdbcType=INTEGER},
      park_code = #{record.parkCode,jdbcType=VARCHAR},
      entrance_type = #{record.entranceType,jdbcType=INTEGER},
      cr_name = #{record.crName,jdbcType=VARCHAR},
      cr_no = #{record.crNo,jdbcType=VARCHAR},
      cr_road_name = #{record.crRoadName,jdbcType=VARCHAR},
      cr_longitude = #{record.crLongitude,jdbcType=VARCHAR},
      cr_latitude = #{record.crLatitude,jdbcType=VARCHAR},
      cr_picture = #{record.crPicture,jdbcType=VARCHAR},
      data_status = #{record.dataStatus,jdbcType=INTEGER},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_op = #{record.createOp,jdbcType=VARCHAR},
      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      modify_op = #{record.modifyOp,jdbcType=VARCHAR},
      remark = #{record.remark,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.HubParkingEntranceExit">
    update hub_parking_entrance_exit
    <set>
      <if test="parkCode != null">
        park_code = #{parkCode,jdbcType=VARCHAR},
      </if>
      <if test="entranceType != null">
        entrance_type = #{entranceType,jdbcType=INTEGER},
      </if>
      <if test="crName != null">
        cr_name = #{crName,jdbcType=VARCHAR},
      </if>
      <if test="crNo != null">
        cr_no = #{crNo,jdbcType=VARCHAR},
      </if>
      <if test="crRoadName != null">
        cr_road_name = #{crRoadName,jdbcType=VARCHAR},
      </if>
      <if test="crLongitude != null">
        cr_longitude = #{crLongitude,jdbcType=VARCHAR},
      </if>
      <if test="crLatitude != null">
        cr_latitude = #{crLatitude,jdbcType=VARCHAR},
      </if>
      <if test="crPicture != null">
        cr_picture = #{crPicture,jdbcType=VARCHAR},
      </if>
      <if test="dataStatus != null">
        data_status = #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createOp != null">
        create_op = #{createOp,jdbcType=VARCHAR},
      </if>
      <if test="modifyTime != null">
        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null">
        modify_op = #{modifyOp,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.HubParkingEntranceExit">
    update hub_parking_entrance_exit
    set park_code = #{parkCode,jdbcType=VARCHAR},
      entrance_type = #{entranceType,jdbcType=INTEGER},
      cr_name = #{crName,jdbcType=VARCHAR},
      cr_no = #{crNo,jdbcType=VARCHAR},
      cr_road_name = #{crRoadName,jdbcType=VARCHAR},
      cr_longitude = #{crLongitude,jdbcType=VARCHAR},
      cr_latitude = #{crLatitude,jdbcType=VARCHAR},
      cr_picture = #{crPicture,jdbcType=VARCHAR},
      data_status = #{dataStatus,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_op = #{createOp,jdbcType=VARCHAR},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      modify_op = #{modifyOp,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>