ParkPayLogMapper.xml 8.78 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.ParkPayLogMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.ParkPayLog">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="charge_type" jdbcType="INTEGER" property="chargeType" />
    <result column="charger" jdbcType="VARCHAR" property="charger" />
    <result column="account" jdbcType="DECIMAL" property="account" />
    <result column="time" jdbcType="TIMESTAMP" property="time" />
    <result column="seq_num" jdbcType="VARCHAR" property="seqNum" />
    <result column="parking_log_id" jdbcType="BIGINT" property="parkingLogId" />
  </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, charge_type, charger, account, time, seq_num, parking_log_id
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.ParkPayLogExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from park_pay_log
    <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 park_pay_log
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from park_pay_log
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.ParkPayLogExample">
    delete from park_pay_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.ParkPayLog">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into park_pay_log (charge_type, charger, account, 
      time, seq_num, parking_log_id
      )
    values (#{chargeType,jdbcType=INTEGER}, #{charger,jdbcType=VARCHAR}, #{account,jdbcType=DECIMAL}, 
      #{time,jdbcType=TIMESTAMP}, #{seqNum,jdbcType=VARCHAR}, #{parkingLogId,jdbcType=BIGINT}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.ParkPayLog">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into park_pay_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="chargeType != null">
        charge_type,
      </if>
      <if test="charger != null">
        charger,
      </if>
      <if test="account != null">
        account,
      </if>
      <if test="time != null">
        time,
      </if>
      <if test="seqNum != null">
        seq_num,
      </if>
      <if test="parkingLogId != null">
        parking_log_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="chargeType != null">
        #{chargeType,jdbcType=INTEGER},
      </if>
      <if test="charger != null">
        #{charger,jdbcType=VARCHAR},
      </if>
      <if test="account != null">
        #{account,jdbcType=DECIMAL},
      </if>
      <if test="time != null">
        #{time,jdbcType=TIMESTAMP},
      </if>
      <if test="seqNum != null">
        #{seqNum,jdbcType=VARCHAR},
      </if>
      <if test="parkingLogId != null">
        #{parkingLogId,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.ParkPayLogExample" resultType="java.lang.Long">
    select count(*) from park_pay_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update park_pay_log
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.chargeType != null">
        charge_type = #{record.chargeType,jdbcType=INTEGER},
      </if>
      <if test="record.charger != null">
        charger = #{record.charger,jdbcType=VARCHAR},
      </if>
      <if test="record.account != null">
        account = #{record.account,jdbcType=DECIMAL},
      </if>
      <if test="record.time != null">
        time = #{record.time,jdbcType=TIMESTAMP},
      </if>
      <if test="record.seqNum != null">
        seq_num = #{record.seqNum,jdbcType=VARCHAR},
      </if>
      <if test="record.parkingLogId != null">
        parking_log_id = #{record.parkingLogId,jdbcType=BIGINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update park_pay_log
    set id = #{record.id,jdbcType=BIGINT},
      charge_type = #{record.chargeType,jdbcType=INTEGER},
      charger = #{record.charger,jdbcType=VARCHAR},
      account = #{record.account,jdbcType=DECIMAL},
      time = #{record.time,jdbcType=TIMESTAMP},
      seq_num = #{record.seqNum,jdbcType=VARCHAR},
      parking_log_id = #{record.parkingLogId,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.ParkPayLog">
    update park_pay_log
    <set>
      <if test="chargeType != null">
        charge_type = #{chargeType,jdbcType=INTEGER},
      </if>
      <if test="charger != null">
        charger = #{charger,jdbcType=VARCHAR},
      </if>
      <if test="account != null">
        account = #{account,jdbcType=DECIMAL},
      </if>
      <if test="time != null">
        time = #{time,jdbcType=TIMESTAMP},
      </if>
      <if test="seqNum != null">
        seq_num = #{seqNum,jdbcType=VARCHAR},
      </if>
      <if test="parkingLogId != null">
        parking_log_id = #{parkingLogId,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.ParkPayLog">
    update park_pay_log
    set charge_type = #{chargeType,jdbcType=INTEGER},
      charger = #{charger,jdbcType=VARCHAR},
      account = #{account,jdbcType=DECIMAL},
      time = #{time,jdbcType=TIMESTAMP},
      seq_num = #{seqNum,jdbcType=VARCHAR},
      parking_log_id = #{parkingLogId,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>