TpPChargingPileMapper.xml 14.7 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.TpPChargingPileMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.TpPChargingPile">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="berth_no" jdbcType="VARCHAR" property="berthNo" />
    <result column="charging_pile_no" jdbcType="VARCHAR" property="chargingPileNo" />
    <result column="charging_pile_name" jdbcType="VARCHAR" property="chargingPileName" />
    <result column="charging_pile_address" jdbcType="VARCHAR" property="chargingPileAddress" />
    <result column="charging_type" jdbcType="INTEGER" property="chargingType" />
    <result column="charging_status" jdbcType="INTEGER" property="chargingStatus" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <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" />
  </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, org_id, pl_no, pl_name, berth_no, charging_pile_no, charging_pile_name, charging_pile_address, 
    charging_type, charging_status, data_status, remark, create_time, create_op, modify_time, 
    modify_op
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.TpPChargingPileExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from tp_p_charging_pile
    <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 tp_p_charging_pile
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from tp_p_charging_pile
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.TpPChargingPileExample">
    delete from tp_p_charging_pile
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.TpPChargingPile">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into tp_p_charging_pile (org_id, pl_no, pl_name, 
      berth_no, charging_pile_no, charging_pile_name, 
      charging_pile_address, charging_type, charging_status, 
      data_status, remark, create_time, 
      create_op, modify_time, modify_op
      )
    values (#{orgId,jdbcType=BIGINT}, #{plNo,jdbcType=VARCHAR}, #{plName,jdbcType=VARCHAR}, 
      #{berthNo,jdbcType=VARCHAR}, #{chargingPileNo,jdbcType=VARCHAR}, #{chargingPileName,jdbcType=VARCHAR}, 
      #{chargingPileAddress,jdbcType=VARCHAR}, #{chargingType,jdbcType=INTEGER}, #{chargingStatus,jdbcType=INTEGER}, 
      #{dataStatus,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createOp,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{modifyOp,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.TpPChargingPile">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into tp_p_charging_pile
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="orgId != null">
        org_id,
      </if>
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="plName != null">
        pl_name,
      </if>
      <if test="berthNo != null">
        berth_no,
      </if>
      <if test="chargingPileNo != null">
        charging_pile_no,
      </if>
      <if test="chargingPileName != null">
        charging_pile_name,
      </if>
      <if test="chargingPileAddress != null">
        charging_pile_address,
      </if>
      <if test="chargingType != null">
        charging_type,
      </if>
      <if test="chargingStatus != null">
        charging_status,
      </if>
      <if test="dataStatus != null">
        data_status,
      </if>
      <if test="remark != null">
        remark,
      </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>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="orgId != null">
        #{orgId,jdbcType=BIGINT},
      </if>
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="plName != null">
        #{plName,jdbcType=VARCHAR},
      </if>
      <if test="berthNo != null">
        #{berthNo,jdbcType=VARCHAR},
      </if>
      <if test="chargingPileNo != null">
        #{chargingPileNo,jdbcType=VARCHAR},
      </if>
      <if test="chargingPileName != null">
        #{chargingPileName,jdbcType=VARCHAR},
      </if>
      <if test="chargingPileAddress != null">
        #{chargingPileAddress,jdbcType=VARCHAR},
      </if>
      <if test="chargingType != null">
        #{chargingType,jdbcType=INTEGER},
      </if>
      <if test="chargingStatus != null">
        #{chargingStatus,jdbcType=INTEGER},
      </if>
      <if test="dataStatus != null">
        #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </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>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.TpPChargingPileExample" resultType="java.lang.Long">
    select count(*) from tp_p_charging_pile
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update tp_p_charging_pile
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=BIGINT},
      </if>
      <if test="record.plNo != null">
        pl_no = #{record.plNo,jdbcType=VARCHAR},
      </if>
      <if test="record.plName != null">
        pl_name = #{record.plName,jdbcType=VARCHAR},
      </if>
      <if test="record.berthNo != null">
        berth_no = #{record.berthNo,jdbcType=VARCHAR},
      </if>
      <if test="record.chargingPileNo != null">
        charging_pile_no = #{record.chargingPileNo,jdbcType=VARCHAR},
      </if>
      <if test="record.chargingPileName != null">
        charging_pile_name = #{record.chargingPileName,jdbcType=VARCHAR},
      </if>
      <if test="record.chargingPileAddress != null">
        charging_pile_address = #{record.chargingPileAddress,jdbcType=VARCHAR},
      </if>
      <if test="record.chargingType != null">
        charging_type = #{record.chargingType,jdbcType=INTEGER},
      </if>
      <if test="record.chargingStatus != null">
        charging_status = #{record.chargingStatus,jdbcType=INTEGER},
      </if>
      <if test="record.dataStatus != null">
        data_status = #{record.dataStatus,jdbcType=INTEGER},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </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>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update tp_p_charging_pile
    set id = #{record.id,jdbcType=BIGINT},
      org_id = #{record.orgId,jdbcType=BIGINT},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      pl_name = #{record.plName,jdbcType=VARCHAR},
      berth_no = #{record.berthNo,jdbcType=VARCHAR},
      charging_pile_no = #{record.chargingPileNo,jdbcType=VARCHAR},
      charging_pile_name = #{record.chargingPileName,jdbcType=VARCHAR},
      charging_pile_address = #{record.chargingPileAddress,jdbcType=VARCHAR},
      charging_type = #{record.chargingType,jdbcType=INTEGER},
      charging_status = #{record.chargingStatus,jdbcType=INTEGER},
      data_status = #{record.dataStatus,jdbcType=INTEGER},
      remark = #{record.remark,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_op = #{record.createOp,jdbcType=VARCHAR},
      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      modify_op = #{record.modifyOp,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.TpPChargingPile">
    update tp_p_charging_pile
    <set>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=BIGINT},
      </if>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="plName != null">
        pl_name = #{plName,jdbcType=VARCHAR},
      </if>
      <if test="berthNo != null">
        berth_no = #{berthNo,jdbcType=VARCHAR},
      </if>
      <if test="chargingPileNo != null">
        charging_pile_no = #{chargingPileNo,jdbcType=VARCHAR},
      </if>
      <if test="chargingPileName != null">
        charging_pile_name = #{chargingPileName,jdbcType=VARCHAR},
      </if>
      <if test="chargingPileAddress != null">
        charging_pile_address = #{chargingPileAddress,jdbcType=VARCHAR},
      </if>
      <if test="chargingType != null">
        charging_type = #{chargingType,jdbcType=INTEGER},
      </if>
      <if test="chargingStatus != null">
        charging_status = #{chargingStatus,jdbcType=INTEGER},
      </if>
      <if test="dataStatus != null">
        data_status = #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </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>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.TpPChargingPile">
    update tp_p_charging_pile
    set org_id = #{orgId,jdbcType=BIGINT},
      pl_no = #{plNo,jdbcType=VARCHAR},
      pl_name = #{plName,jdbcType=VARCHAR},
      berth_no = #{berthNo,jdbcType=VARCHAR},
      charging_pile_no = #{chargingPileNo,jdbcType=VARCHAR},
      charging_pile_name = #{chargingPileName,jdbcType=VARCHAR},
      charging_pile_address = #{chargingPileAddress,jdbcType=VARCHAR},
      charging_type = #{chargingType,jdbcType=INTEGER},
      charging_status = #{chargingStatus,jdbcType=INTEGER},
      data_status = #{dataStatus,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_op = #{createOp,jdbcType=VARCHAR},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      modify_op = #{modifyOp,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>