TBillingLogsMapper.xml 4.62 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.bill.mapper.TBillingLogsMapper" >
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TBillingLogs" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="pl_no" property="plNo" jdbcType="VARCHAR" />
    <result column="car_num" property="carNum" jdbcType="VARCHAR" />
    <result column="in_time" property="inTime" jdbcType="TIMESTAMP" />
    <result column="out_time" property="outTime" jdbcType="TIMESTAMP" />
    <result column="fee" property="fee" jdbcType="INTEGER" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="com.zteits.bill.domain.TBillingLogs" extends="BaseResultMap" >
    <result column="log_detail" property="logDetail" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, pl_no, car_num, in_time, out_time, fee
  </sql>
  <sql id="Blob_Column_List" >
    log_detail
  </sql>
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from t_billing_logs
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from t_billing_logs
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TBillingLogs" >

    insert into t_billing_logs (id,pl_no, car_num, in_time,
      out_time, fee, log_detail
      )
    values (#{id,jdbcType=VARCHAR},#{plNo,jdbcType=VARCHAR}, #{carNum,jdbcType=VARCHAR}, #{inTime,jdbcType=TIMESTAMP},
      #{outTime,jdbcType=TIMESTAMP}, #{fee,jdbcType=INTEGER}, #{logDetail,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TBillingLogs" >
    <selectKey resultType="java.lang.String" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_billing_logs
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="plNo != null" >
        pl_no,
      </if>
      <if test="carNum != null" >
        car_num,
      </if>
      <if test="inTime != null" >
        in_time,
      </if>
      <if test="outTime != null" >
        out_time,
      </if>
      <if test="fee != null" >
        fee,
      </if>
      <if test="logDetail != null" >
        log_detail,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="plNo != null" >
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="carNum != null" >
        #{carNum,jdbcType=VARCHAR},
      </if>
      <if test="inTime != null" >
        #{inTime,jdbcType=TIMESTAMP},
      </if>
      <if test="outTime != null" >
        #{outTime,jdbcType=TIMESTAMP},
      </if>
      <if test="fee != null" >
        #{fee,jdbcType=INTEGER},
      </if>
      <if test="logDetail != null" >
        #{logDetail,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TBillingLogs" >
    update t_billing_logs
    <set >
      <if test="plNo != null" >
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="carNum != null" >
        car_num = #{carNum,jdbcType=VARCHAR},
      </if>
      <if test="inTime != null" >
        in_time = #{inTime,jdbcType=TIMESTAMP},
      </if>
      <if test="outTime != null" >
        out_time = #{outTime,jdbcType=TIMESTAMP},
      </if>
      <if test="fee != null" >
        fee = #{fee,jdbcType=INTEGER},
      </if>
      <if test="logDetail != null" >
        log_detail = #{logDetail,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zteits.bill.domain.TBillingLogs" >
    update t_billing_logs
    set pl_no = #{plNo,jdbcType=VARCHAR},
      car_num = #{carNum,jdbcType=VARCHAR},
      in_time = #{inTime,jdbcType=TIMESTAMP},
      out_time = #{outTime,jdbcType=TIMESTAMP},
      fee = #{fee,jdbcType=INTEGER},
      log_detail = #{logDetail,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TBillingLogs" >
    update t_billing_logs
    set pl_no = #{plNo,jdbcType=VARCHAR},
      car_num = #{carNum,jdbcType=VARCHAR},
      in_time = #{inTime,jdbcType=TIMESTAMP},
      out_time = #{outTime,jdbcType=TIMESTAMP},
      fee = #{fee,jdbcType=INTEGER}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>