INTERNATIONALTRANSITMapper.xml 8.0 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.tianbo.analysis.dao.INTERNATIONALTRANSITMapper" >
  <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.INTERNATIONALTRANSIT" >
    <result column="AUTOID" property="autoid" jdbcType="VARCHAR" />
    <result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
    <result column="ORIGINAL_CARRIER" property="originalCarrier" jdbcType="VARCHAR" />
    <result column="ORIGINAL_FLIGHTNO" property="originalFlightno" jdbcType="VARCHAR" />
    <result column="ORIGINAL_FLIGHTDATE" property="originalFlightdate" jdbcType="TIMESTAMP" />
    <result column="ORIGINAL_BILLNO" property="originalBillno" jdbcType="VARCHAR" />
    <result column="ORIGINAL_SUB_NUMBER" property="originalSubNumber" jdbcType="VARCHAR" />
    <result column="PRE_CARRIER" property="preCarrier" jdbcType="VARCHAR" />
    <result column="PRE_FLIGHTNO" property="preFlightno" jdbcType="VARCHAR" />
    <result column="PRE_FLIGHTDATE" property="preFlightdate" jdbcType="TIMESTAMP" />
    <result column="PRE_BILLNO" property="preBillno" jdbcType="VARCHAR" />
    <result column="PRE_SUB_NUMBER" property="preSubNumber" jdbcType="VARCHAR" />
    <result column="BILLPIECE" property="billpiece" jdbcType="VARCHAR" />
    <result column="BILLWEIGHT" property="billweight" jdbcType="VARCHAR" />
    <result column="PRODUCT" property="product" jdbcType="VARCHAR" />
    <result column="ORIGINATINGSTATION" property="originatingstation" jdbcType="VARCHAR" />
    <result column="PACKAGINGTYPE" property="packagingtype" jdbcType="VARCHAR" />
    <result column="STATUS" property="status" jdbcType="VARCHAR" />
    <result column="RECEIPTION" property="receiption" jdbcType="VARCHAR" />
    <result column="DESTINATIONSTATION_BILL" property="destinationstationBill" jdbcType="VARCHAR" />
  </resultMap>
  <insert id="insert" parameterType="com.tianbo.analysis.model.INTERNATIONALTRANSIT" >
    insert into INTERNATIONALTRANSIT (AUTOID, CREATEDATE, ORIGINAL_CARRIER,
      ORIGINAL_FLIGHTNO, ORIGINAL_FLIGHTDATE,
      ORIGINAL_BILLNO, ORIGINAL_SUB_NUMBER, PRE_CARRIER,
      PRE_FLIGHTNO, PRE_FLIGHTDATE, PRE_BILLNO,
      PRE_SUB_NUMBER, BILLPIECE, BILLWEIGHT,
      PRODUCT, ORIGINATINGSTATION, PACKAGINGTYPE,
      STATUS, RECEIPTION, DESTINATIONSTATION_BILL
      )
    values (#{autoid,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{originalCarrier,jdbcType=VARCHAR},
      #{originalFlightno,jdbcType=VARCHAR}, #{originalFlightdate,jdbcType=TIMESTAMP},
      #{originalBillno,jdbcType=VARCHAR}, #{originalSubNumber,jdbcType=VARCHAR}, #{preCarrier,jdbcType=VARCHAR},
      #{preFlightno,jdbcType=VARCHAR}, #{preFlightdate,jdbcType=TIMESTAMP}, #{preBillno,jdbcType=VARCHAR},
      #{preSubNumber,jdbcType=VARCHAR}, #{billpiece,jdbcType=VARCHAR}, #{billweight,jdbcType=VARCHAR},
      #{product,jdbcType=VARCHAR}, #{originatingstation,jdbcType=VARCHAR}, #{packagingtype,jdbcType=VARCHAR},
      #{status,jdbcType=VARCHAR}, #{receiption,jdbcType=VARCHAR}, #{destinationstationBill,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.tianbo.analysis.model.INTERNATIONALTRANSIT" >
    insert into INTERNATIONALTRANSIT
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="autoid != null" >
        AUTOID,
      </if>
      <if test="createdate != null" >
        CREATEDATE,
      </if>
      <if test="originalCarrier != null" >
        ORIGINAL_CARRIER,
      </if>
      <if test="originalFlightno != null" >
        ORIGINAL_FLIGHTNO,
      </if>
      <if test="originalFlightdate != null" >
        ORIGINAL_FLIGHTDATE,
      </if>
      <if test="originalBillno != null" >
        ORIGINAL_BILLNO,
      </if>
      <if test="originalSubNumber != null" >
        ORIGINAL_SUB_NUMBER,
      </if>
      <if test="preCarrier != null" >
        PRE_CARRIER,
      </if>
      <if test="preFlightno != null" >
        PRE_FLIGHTNO,
      </if>
      <if test="preFlightdate != null" >
        PRE_FLIGHTDATE,
      </if>
      <if test="preBillno != null" >
        PRE_BILLNO,
      </if>
      <if test="preSubNumber != null" >
        PRE_SUB_NUMBER,
      </if>
      <if test="billpiece != null" >
        BILLPIECE,
      </if>
      <if test="billweight != null" >
        BILLWEIGHT,
      </if>
      <if test="product != null" >
        PRODUCT,
      </if>
      <if test="originatingstation != null" >
        ORIGINATINGSTATION,
      </if>
      <if test="packagingtype != null" >
        PACKAGINGTYPE,
      </if>
      <if test="status != null" >
        STATUS,
      </if>
      <if test="receiption != null" >
        RECEIPTION,
      </if>
      <if test="destinationstationBill != null" >
        DESTINATIONSTATION_BILL,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="autoid != null" >
        #{autoid,jdbcType=VARCHAR},
      </if>
      <if test="createdate != null" >
        #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="originalCarrier != null" >
        #{originalCarrier,jdbcType=VARCHAR},
      </if>
      <if test="originalFlightno != null" >
        #{originalFlightno,jdbcType=VARCHAR},
      </if>
      <if test="originalFlightdate != null" >
        #{originalFlightdate,jdbcType=TIMESTAMP},
      </if>
      <if test="originalBillno != null" >
        #{originalBillno,jdbcType=VARCHAR},
      </if>
      <if test="originalSubNumber != null" >
        #{originalSubNumber,jdbcType=VARCHAR},
      </if>
      <if test="preCarrier != null" >
        #{preCarrier,jdbcType=VARCHAR},
      </if>
      <if test="preFlightno != null" >
        #{preFlightno,jdbcType=VARCHAR},
      </if>
      <if test="preFlightdate != null" >
        #{preFlightdate,jdbcType=TIMESTAMP},
      </if>
      <if test="preBillno != null" >
        #{preBillno,jdbcType=VARCHAR},
      </if>
      <if test="preSubNumber != null" >
        #{preSubNumber,jdbcType=VARCHAR},
      </if>
      <if test="billpiece != null" >
        #{billpiece,jdbcType=VARCHAR},
      </if>
      <if test="billweight != null" >
        #{billweight,jdbcType=VARCHAR},
      </if>
      <if test="product != null" >
        #{product,jdbcType=VARCHAR},
      </if>
      <if test="originatingstation != null" >
        #{originatingstation,jdbcType=VARCHAR},
      </if>
      <if test="packagingtype != null" >
        #{packagingtype,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="receiption != null" >
        #{receiption,jdbcType=VARCHAR},
      </if>
      <if test="destinationstationBill != null" >
        #{destinationstationBill,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>


  <update id="updateRECEIPTION" parameterType="com.tianbo.analysis.model.INTERNATIONALTRANSIT" >
    UPDATE INTERNATIONALTRANSIT
    SET RECEIPTION= #{receiption,jdbcType=VARCHAR},
    STATUS = #{status,jdbcType=VARCHAR }
    WHERE
    ORIGINAL_FLIGHTNO = #{originalFlightno,jdbcType=VARCHAR}
    AND
    ORIGINAL_CARRIER = #{originalCarrier,jdbcType=VARCHAR}
    AND
    trunc(ORIGINAL_FLIGHTDATE)= #{originalFlightdate,jdbcType=DATE}
    AND
    ORIGINAL_BILLNO = #{originalBillno,jdbcType=VARCHAR}
    <if test="originalSubNumber != null and originalSubNumber != ''" >
    AND
    ORIGINAL_SUB_NUMBER = #{originalSubNumber,jdbcType=VARCHAR}
    </if>
  </update>

  <select id="selectAutoIdByAwb" parameterType="com.tianbo.analysis.model.INTERNATIONALTRANSIT" resultType="com.tianbo.analysis.model.INTERNATIONALTRANSIT">
    SELECT AUTOID
    FROM INTERNATIONALTRANSIT
    WHERE
    ORIGINAL_FLIGHTNO= #{originalFlightno,jdbcType=VARCHAR}
    AND
     ORIGINAL_CARRIER = #{originalCarrier,jdbcType=VARCHAR}
    AND
    trunc(ORIGINAL_FLIGHTDATE)= #{originalFlightdate,jdbcType=DATE}
    AND
    ORIGINAL_BILLNO = #{originalBillno,jdbcType=VARCHAR}
    <if test="originalSubNumber != null and originalSubNumber != ''" >
    AND
    ORIGINAL_SUB_NUMBER = #{originalSubNumber,jdbcType=VARCHAR}
    </if>
  </select>

</mapper>