<?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.steerinfo.meterwork.meterworkcarcheck.mapper.MeterWorkCarCheckMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.meterwork.meterworkcarcheck.model.MeterWorkCarCheck">
    <id column="PK_NO" jdbcType="VARCHAR" property="pkNo" />
    <result column="PREDICTION_NO" jdbcType="VARCHAR" property="predictionNo" />
    <result column="CAR_NO" jdbcType="VARCHAR" property="carNo" />
    <result column="MNEMONIC_CODE" jdbcType="VARCHAR" property="mnemonicCode" />
    <result column="DRIVER_NAME" jdbcType="VARCHAR" property="driverName" />
    <result column="ID_NUM" jdbcType="VARCHAR" property="idNum" />
    <result column="TEL_NUM" jdbcType="VARCHAR" property="telNum" />
    <result column="CUSTOMER_SUPPLIER_NO" jdbcType="VARCHAR" property="customerSupplierNo" />
    <result column="CUSTOMER_SUPPLIER_NAME" jdbcType="VARCHAR" property="customerSupplierName" />
    <result column="TRANSPORT_CHEMICAL" jdbcType="VARCHAR" property="transportChemical" />
    <result column="LIMIT_WEIGHT" jdbcType="DECIMAL" property="limitWeight" />
    <result column="TOTE" jdbcType="VARCHAR" property="tote" />
    <result column="WATER_BOX_IS_EMPTY" jdbcType="VARCHAR" property="waterBoxIsEmpty" />
    <result column="ENTER_CHECK_MAN_NO" jdbcType="VARCHAR" property="enterCheckManNo" />
    <result column="ENTER_CHECK_MAN_NAME" jdbcType="VARCHAR" property="enterCheckManName" />
    <result column="ENTER_CHECK_TIME" jdbcType="TIMESTAMP" property="enterCheckTime" />
    <result column="LEAVE_CHECK_MAN_NO" jdbcType="VARCHAR" property="leaveCheckManNo" />
    <result column="LEAVE_CHECK_MAN_NAME" jdbcType="VARCHAR" property="leaveCheckManName" />
    <result column="LEAVE_CHECK_TIME" jdbcType="TIMESTAMP" property="leaveCheckTime" />
    <result column="CHECK_RESULT" jdbcType="VARCHAR" property="checkResult" />
    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
    <result column="VALUE_FLAG" jdbcType="VARCHAR" property="valueFlag" />
  </resultMap>
  <sql id="columns">
    PK_NO, PREDICTION_NO, CAR_NO, MNEMONIC_CODE, DRIVER_NAME, ID_NUM, TEL_NUM, CUSTOMER_SUPPLIER_NO, 
    CUSTOMER_SUPPLIER_NAME, TRANSPORT_CHEMICAL, LIMIT_WEIGHT, TOTE, WATER_BOX_IS_EMPTY, 
    ENTER_CHECK_MAN_NO, ENTER_CHECK_MAN_NAME, ENTER_CHECK_TIME, LEAVE_CHECK_MAN_NO, LEAVE_CHECK_MAN_NAME, 
    LEAVE_CHECK_TIME, CHECK_RESULT, MEMO, VALUE_FLAG
  </sql>
  <sql id="columns_alias">
    t.PK_NO, t.PREDICTION_NO, t.CAR_NO, t.MNEMONIC_CODE, t.DRIVER_NAME, t.ID_NUM, t.TEL_NUM, 
    t.CUSTOMER_SUPPLIER_NO, t.CUSTOMER_SUPPLIER_NAME, t.TRANSPORT_CHEMICAL, t.LIMIT_WEIGHT, 
    t.TOTE, t.WATER_BOX_IS_EMPTY, t.ENTER_CHECK_MAN_NO, t.ENTER_CHECK_MAN_NAME, t.ENTER_CHECK_TIME, 
    t.LEAVE_CHECK_MAN_NO, t.LEAVE_CHECK_MAN_NAME, t.LEAVE_CHECK_TIME, t.CHECK_RESULT, 
    t.MEMO, t.VALUE_FLAG
  </sql>
  <sql id="select">
    SELECT <include refid="columns" /> FROM METER_WORK_CAR_CHECK
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias" /> FROM METER_WORK_CAR_CHECK t
  </sql>
  <sql id="where">
    <where> 
      <if test="pkNo != null and pkNo != ''">
        and PK_NO = #{pkNo}
      </if>
      <if test="predictionNo != null and predictionNo != ''">
        and PREDICTION_NO = #{predictionNo}
      </if>
      <if test="carNo != null and carNo != ''">
        and CAR_NO = #{carNo}
      </if>
      <if test="mnemonicCode != null and mnemonicCode != ''">
        and MNEMONIC_CODE = #{mnemonicCode}
      </if>
      <if test="driverName != null and driverName != ''">
        and DRIVER_NAME = #{driverName}
      </if>
      <if test="idNum != null and idNum != ''">
        and ID_NUM = #{idNum}
      </if>
      <if test="telNum != null and telNum != ''">
        and TEL_NUM = #{telNum}
      </if>
      <if test="customerSupplierNo != null and customerSupplierNo != ''">
        and CUSTOMER_SUPPLIER_NO = #{customerSupplierNo}
      </if>
      <if test="customerSupplierName != null and customerSupplierName != ''">
        and CUSTOMER_SUPPLIER_NAME = #{customerSupplierName}
      </if>
      <if test="transportChemical != null and transportChemical != ''">
        and TRANSPORT_CHEMICAL = #{transportChemical}
      </if>
      <if test="limitWeight != null">
        and LIMIT_WEIGHT = #{limitWeight}
      </if>
      <if test="tote != null and tote != ''">
        and TOTE = #{tote}
      </if>
      <if test="waterBoxIsEmpty != null and waterBoxIsEmpty != ''">
        and WATER_BOX_IS_EMPTY = #{waterBoxIsEmpty}
      </if>
      <if test="enterCheckManNo != null and enterCheckManNo != ''">
        and ENTER_CHECK_MAN_NO = #{enterCheckManNo}
      </if>
      <if test="enterCheckManName != null and enterCheckManName != ''">
        and ENTER_CHECK_MAN_NAME = #{enterCheckManName}
      </if>
      <if test="enterCheckTime != null">
        and TO_CHAR(ENTER_CHECK_TIME,'yyyy-MM-dd') = #{enterCheckTime}
      </if>
      <if test="leaveCheckManNo != null and leaveCheckManNo != ''">
        and LEAVE_CHECK_MAN_NO = #{leaveCheckManNo}
      </if>
      <if test="leaveCheckManName != null and leaveCheckManName != ''">
        and LEAVE_CHECK_MAN_NAME = #{leaveCheckManName}
      </if>
      <if test="leaveCheckTime != null">
        and TO_CHAR(LEAVE_CHECK_TIME,'yyyy-MM-dd') = #{leaveCheckTime}
      </if>
      <if test="checkResult != null and checkResult != ''">
        and CHECK_RESULT = #{checkResult}
      </if>
      <if test="memo != null and memo != ''">
        and MEMO = #{memo}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        and VALUE_FLAG = #{valueFlag}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where> 
      <if test="pkNo != null and pkNo != ''">
        and PK_NO LIKE '%${pkNo}%'
      </if>
      <if test="predictionNo != null and predictionNo != ''">
        and PREDICTION_NO LIKE '%${predictionNo}%'
      </if>
      <if test="carNo != null and carNo != ''">
        and CAR_NO LIKE '%${carNo}%'
      </if>
      <if test="mnemonicCode != null and mnemonicCode != ''">
        and MNEMONIC_CODE LIKE '%${mnemonicCode}%'
      </if>
      <if test="driverName != null and driverName != ''">
        and DRIVER_NAME LIKE '%${driverName}%'
      </if>
      <if test="idNum != null and idNum != ''">
        and ID_NUM LIKE '%${idNum}%'
      </if>
      <if test="telNum != null and telNum != ''">
        and TEL_NUM LIKE '%${telNum}%'
      </if>
      <if test="customerSupplierNo != null and customerSupplierNo != ''">
        and CUSTOMER_SUPPLIER_NO LIKE '%${customerSupplierNo}%'
      </if>
      <if test="customerSupplierName != null and customerSupplierName != ''">
        and CUSTOMER_SUPPLIER_NAME LIKE '%${customerSupplierName}%'
      </if>
      <if test="transportChemical != null and transportChemical != ''">
        and TRANSPORT_CHEMICAL LIKE '%${transportChemical}%'
      </if>
      <if test="limitWeight != null">
        and LIMIT_WEIGHT = #{limitWeight}
      </if>
      <if test="tote != null and tote != ''">
        and TOTE LIKE '%${tote}%'
      </if>
      <if test="waterBoxIsEmpty != null and waterBoxIsEmpty != ''">
        and WATER_BOX_IS_EMPTY LIKE '%${waterBoxIsEmpty}%'
      </if>
      <if test="enterCheckManNo != null and enterCheckManNo != ''">
        and ENTER_CHECK_MAN_NO LIKE '%${enterCheckManNo}%'
      </if>
      <if test="enterCheckManName != null and enterCheckManName != ''">
        and ENTER_CHECK_MAN_NAME LIKE '%${enterCheckManName}%'
      </if>
      <if test="enterCheckTime != null">
        and TO_CHAR(ENTER_CHECK_TIME,'yyyy-MM-dd') = #{enterCheckTime}
      </if>
      <if test="leaveCheckManNo != null and leaveCheckManNo != ''">
        and LEAVE_CHECK_MAN_NO LIKE '%${leaveCheckManNo}%'
      </if>
      <if test="leaveCheckManName != null and leaveCheckManName != ''">
        and LEAVE_CHECK_MAN_NAME LIKE '%${leaveCheckManName}%'
      </if>
      <if test="leaveCheckTime != null">
        and TO_CHAR(LEAVE_CHECK_TIME,'yyyy-MM-dd') = #{leaveCheckTime}
      </if>
      <if test="checkResult != null and checkResult != ''">
        and CHECK_RESULT LIKE '%${checkResult}%'
      </if>
      <if test="memo != null and memo != ''">
        and MEMO LIKE '%${memo}%'
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        and VALUE_FLAG LIKE '%${valueFlag}%'
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_WORK_CAR_CHECK
    where PK_NO = #{pkNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_WORK_CAR_CHECK
    where 1!=1 
      <if test="predictionNo != null and predictionNo != ''">
        or PREDICTION_NO = #{predictionNo}
      </if>
      <if test="carNo != null and carNo != ''">
        or CAR_NO = #{carNo}
      </if>
      <if test="mnemonicCode != null and mnemonicCode != ''">
        or MNEMONIC_CODE = #{mnemonicCode}
      </if>
      <if test="driverName != null and driverName != ''">
        or DRIVER_NAME = #{driverName}
      </if>
      <if test="idNum != null and idNum != ''">
        or ID_NUM = #{idNum}
      </if>
      <if test="telNum != null and telNum != ''">
        or TEL_NUM = #{telNum}
      </if>
      <if test="customerSupplierNo != null and customerSupplierNo != ''">
        or CUSTOMER_SUPPLIER_NO = #{customerSupplierNo}
      </if>
      <if test="customerSupplierName != null and customerSupplierName != ''">
        or CUSTOMER_SUPPLIER_NAME = #{customerSupplierName}
      </if>
      <if test="transportChemical != null and transportChemical != ''">
        or TRANSPORT_CHEMICAL = #{transportChemical}
      </if>
      <if test="limitWeight != null">
        or LIMIT_WEIGHT = #{limitWeight}
      </if>
      <if test="tote != null and tote != ''">
        or TOTE = #{tote}
      </if>
      <if test="waterBoxIsEmpty != null and waterBoxIsEmpty != ''">
        or WATER_BOX_IS_EMPTY = #{waterBoxIsEmpty}
      </if>
      <if test="enterCheckManNo != null and enterCheckManNo != ''">
        or ENTER_CHECK_MAN_NO = #{enterCheckManNo}
      </if>
      <if test="enterCheckManName != null and enterCheckManName != ''">
        or ENTER_CHECK_MAN_NAME = #{enterCheckManName}
      </if>
      <if test="enterCheckTime != null">
        or TO_CHAR(ENTER_CHECK_TIME,'yyyy-MM-dd') = '#{enterCheckTime}'
      </if>
      <if test="leaveCheckManNo != null and leaveCheckManNo != ''">
        or LEAVE_CHECK_MAN_NO = #{leaveCheckManNo}
      </if>
      <if test="leaveCheckManName != null and leaveCheckManName != ''">
        or LEAVE_CHECK_MAN_NAME = #{leaveCheckManName}
      </if>
      <if test="leaveCheckTime != null">
        or TO_CHAR(LEAVE_CHECK_TIME,'yyyy-MM-dd') = '#{leaveCheckTime}'
      </if>
      <if test="checkResult != null and checkResult != ''">
        or CHECK_RESULT = #{checkResult}
      </if>
      <if test="memo != null and memo != ''">
        or MEMO = #{memo}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        or VALUE_FLAG = #{valueFlag}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.meterwork.meterworkcarcheck.model.MeterWorkCarCheck">
    insert into METER_WORK_CAR_CHECK (PK_NO, PREDICTION_NO, CAR_NO, 
      MNEMONIC_CODE, DRIVER_NAME, ID_NUM, 
      TEL_NUM, CUSTOMER_SUPPLIER_NO, CUSTOMER_SUPPLIER_NAME, 
      TRANSPORT_CHEMICAL, LIMIT_WEIGHT, TOTE, 
      WATER_BOX_IS_EMPTY, ENTER_CHECK_MAN_NO, ENTER_CHECK_MAN_NAME, 
      ENTER_CHECK_TIME, LEAVE_CHECK_MAN_NO, LEAVE_CHECK_MAN_NAME, 
      LEAVE_CHECK_TIME, CHECK_RESULT, MEMO, 
      VALUE_FLAG)
    values (#{pkNo,jdbcType=VARCHAR}, #{predictionNo,jdbcType=VARCHAR}, #{carNo,jdbcType=VARCHAR}, 
      #{mnemonicCode,jdbcType=VARCHAR}, #{driverName,jdbcType=VARCHAR}, #{idNum,jdbcType=VARCHAR}, 
      #{telNum,jdbcType=VARCHAR}, #{customerSupplierNo,jdbcType=VARCHAR}, #{customerSupplierName,jdbcType=VARCHAR}, 
      #{transportChemical,jdbcType=VARCHAR}, #{limitWeight,jdbcType=DECIMAL}, #{tote,jdbcType=VARCHAR}, 
      #{waterBoxIsEmpty,jdbcType=VARCHAR}, #{enterCheckManNo,jdbcType=VARCHAR}, #{enterCheckManName,jdbcType=VARCHAR}, 
      #{enterCheckTime,jdbcType=TIMESTAMP}, #{leaveCheckManNo,jdbcType=VARCHAR}, #{leaveCheckManName,jdbcType=VARCHAR}, 
      #{leaveCheckTime,jdbcType=TIMESTAMP}, #{checkResult,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, 
      #{valueFlag,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkcarcheck.model.MeterWorkCarCheck">
    insert into METER_WORK_CAR_CHECK
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="pkNo != null">
        PK_NO,
      </if>
      <if test="predictionNo != null">
        PREDICTION_NO,
      </if>
      <if test="carNo != null">
        CAR_NO,
      </if>
      <if test="mnemonicCode != null">
        MNEMONIC_CODE,
      </if>
      <if test="driverName != null">
        DRIVER_NAME,
      </if>
      <if test="idNum != null">
        ID_NUM,
      </if>
      <if test="telNum != null">
        TEL_NUM,
      </if>
      <if test="customerSupplierNo != null">
        CUSTOMER_SUPPLIER_NO,
      </if>
      <if test="customerSupplierName != null">
        CUSTOMER_SUPPLIER_NAME,
      </if>
      <if test="transportChemical != null">
        TRANSPORT_CHEMICAL,
      </if>
      <if test="limitWeight != null">
        LIMIT_WEIGHT,
      </if>
      <if test="tote != null">
        TOTE,
      </if>
      <if test="waterBoxIsEmpty != null">
        WATER_BOX_IS_EMPTY,
      </if>
      <if test="enterCheckManNo != null">
        ENTER_CHECK_MAN_NO,
      </if>
      <if test="enterCheckManName != null">
        ENTER_CHECK_MAN_NAME,
      </if>
      <if test="enterCheckTime != null">
        ENTER_CHECK_TIME,
      </if>
      <if test="leaveCheckManNo != null">
        LEAVE_CHECK_MAN_NO,
      </if>
      <if test="leaveCheckManName != null">
        LEAVE_CHECK_MAN_NAME,
      </if>
      <if test="leaveCheckTime != null">
        LEAVE_CHECK_TIME,
      </if>
      <if test="checkResult != null">
        CHECK_RESULT,
      </if>
      <if test="memo != null">
        MEMO,
      </if>
      <if test="valueFlag != null">
        VALUE_FLAG,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="pkNo != null">
        #{pkNo,jdbcType=VARCHAR},
      </if>
      <if test="predictionNo != null">
        #{predictionNo,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="mnemonicCode != null">
        #{mnemonicCode,jdbcType=VARCHAR},
      </if>
      <if test="driverName != null">
        #{driverName,jdbcType=VARCHAR},
      </if>
      <if test="idNum != null">
        #{idNum,jdbcType=VARCHAR},
      </if>
      <if test="telNum != null">
        #{telNum,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierNo != null">
        #{customerSupplierNo,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierName != null">
        #{customerSupplierName,jdbcType=VARCHAR},
      </if>
      <if test="transportChemical != null">
        #{transportChemical,jdbcType=VARCHAR},
      </if>
      <if test="limitWeight != null">
        #{limitWeight,jdbcType=DECIMAL},
      </if>
      <if test="tote != null">
        #{tote,jdbcType=VARCHAR},
      </if>
      <if test="waterBoxIsEmpty != null">
        #{waterBoxIsEmpty,jdbcType=VARCHAR},
      </if>
      <if test="enterCheckManNo != null">
        #{enterCheckManNo,jdbcType=VARCHAR},
      </if>
      <if test="enterCheckManName != null">
        #{enterCheckManName,jdbcType=VARCHAR},
      </if>
      <if test="enterCheckTime != null">
        #{enterCheckTime,jdbcType=TIMESTAMP},
      </if>
      <if test="leaveCheckManNo != null">
        #{leaveCheckManNo,jdbcType=VARCHAR},
      </if>
      <if test="leaveCheckManName != null">
        #{leaveCheckManName,jdbcType=VARCHAR},
      </if>
      <if test="leaveCheckTime != null">
        #{leaveCheckTime,jdbcType=TIMESTAMP},
      </if>
      <if test="checkResult != null">
        #{checkResult,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        #{memo,jdbcType=VARCHAR},
      </if>
      <if test="valueFlag != null">
        #{valueFlag,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.meterwork.meterworkcarcheck.model.MeterWorkCarCheck">
    update METER_WORK_CAR_CHECK
    set PREDICTION_NO = #{predictionNo,jdbcType=VARCHAR},
      CAR_NO = #{carNo,jdbcType=VARCHAR},
      MNEMONIC_CODE = #{mnemonicCode,jdbcType=VARCHAR},
      DRIVER_NAME = #{driverName,jdbcType=VARCHAR},
      ID_NUM = #{idNum,jdbcType=VARCHAR},
      TEL_NUM = #{telNum,jdbcType=VARCHAR},
      CUSTOMER_SUPPLIER_NO = #{customerSupplierNo,jdbcType=VARCHAR},
      CUSTOMER_SUPPLIER_NAME = #{customerSupplierName,jdbcType=VARCHAR},
      TRANSPORT_CHEMICAL = #{transportChemical,jdbcType=VARCHAR},
      LIMIT_WEIGHT = #{limitWeight,jdbcType=DECIMAL},
      TOTE = #{tote,jdbcType=VARCHAR},
      WATER_BOX_IS_EMPTY = #{waterBoxIsEmpty,jdbcType=VARCHAR},
      ENTER_CHECK_MAN_NO = #{enterCheckManNo,jdbcType=VARCHAR},
      ENTER_CHECK_MAN_NAME = #{enterCheckManName,jdbcType=VARCHAR},
      ENTER_CHECK_TIME = #{enterCheckTime,jdbcType=TIMESTAMP},
      LEAVE_CHECK_MAN_NO = #{leaveCheckManNo,jdbcType=VARCHAR},
      LEAVE_CHECK_MAN_NAME = #{leaveCheckManName,jdbcType=VARCHAR},
      LEAVE_CHECK_TIME = #{leaveCheckTime,jdbcType=TIMESTAMP},
      CHECK_RESULT = #{checkResult,jdbcType=VARCHAR},
      MEMO = #{memo,jdbcType=VARCHAR},
      VALUE_FLAG = #{valueFlag,jdbcType=VARCHAR}
    where PK_NO = #{pkNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.meterwork.meterworkcarcheck.model.MeterWorkCarCheck">
    update METER_WORK_CAR_CHECK
    <set>
      <if test="predictionNo != null">
        PREDICTION_NO = #{predictionNo,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        CAR_NO = #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="mnemonicCode != null">
        MNEMONIC_CODE = #{mnemonicCode,jdbcType=VARCHAR},
      </if>
      <if test="driverName != null">
        DRIVER_NAME = #{driverName,jdbcType=VARCHAR},
      </if>
      <if test="idNum != null">
        ID_NUM = #{idNum,jdbcType=VARCHAR},
      </if>
      <if test="telNum != null">
        TEL_NUM = #{telNum,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierNo != null">
        CUSTOMER_SUPPLIER_NO = #{customerSupplierNo,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierName != null">
        CUSTOMER_SUPPLIER_NAME = #{customerSupplierName,jdbcType=VARCHAR},
      </if>
      <if test="transportChemical != null">
        TRANSPORT_CHEMICAL = #{transportChemical,jdbcType=VARCHAR},
      </if>
      <if test="limitWeight != null">
        LIMIT_WEIGHT = #{limitWeight,jdbcType=DECIMAL},
      </if>
      <if test="tote != null">
        TOTE = #{tote,jdbcType=VARCHAR},
      </if>
      <if test="waterBoxIsEmpty != null">
        WATER_BOX_IS_EMPTY = #{waterBoxIsEmpty,jdbcType=VARCHAR},
      </if>
      <if test="enterCheckManNo != null">
        ENTER_CHECK_MAN_NO = #{enterCheckManNo,jdbcType=VARCHAR},
      </if>
      <if test="enterCheckManName != null">
        ENTER_CHECK_MAN_NAME = #{enterCheckManName,jdbcType=VARCHAR},
      </if>
      <if test="enterCheckTime != null">
        ENTER_CHECK_TIME = #{enterCheckTime,jdbcType=TIMESTAMP},
      </if>
      <if test="leaveCheckManNo != null">
        LEAVE_CHECK_MAN_NO = #{leaveCheckManNo,jdbcType=VARCHAR},
      </if>
      <if test="leaveCheckManName != null">
        LEAVE_CHECK_MAN_NAME = #{leaveCheckManName,jdbcType=VARCHAR},
      </if>
      <if test="leaveCheckTime != null">
        LEAVE_CHECK_TIME = #{leaveCheckTime,jdbcType=TIMESTAMP},
      </if>
      <if test="checkResult != null">
        CHECK_RESULT = #{checkResult,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        MEMO = #{memo,jdbcType=VARCHAR},
      </if>
      <if test="valueFlag != null">
        VALUE_FLAG = #{valueFlag,jdbcType=VARCHAR},
      </if>
    </set>
    where PK_NO = #{pkNo,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select" />
    where PK_NO = #{pkNo,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select" />
    <include refid="where" />
    order by  LEAVE_CHECK_TIME desc
  </select>
  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select" />
    <include refid="whereLike" />
    order by  LEAVE_CHECK_TIME desc
  </select>
  <insert id="batchInsert" parameterType="java.util.List">
    insert into METER_WORK_CAR_CHECK 
      (PK_NO, 
      PREDICTION_NO, CAR_NO, MNEMONIC_CODE, 
      DRIVER_NAME, ID_NUM, TEL_NUM, 
      CUSTOMER_SUPPLIER_NO, CUSTOMER_SUPPLIER_NAME, 
      TRANSPORT_CHEMICAL, LIMIT_WEIGHT, 
      TOTE, WATER_BOX_IS_EMPTY, ENTER_CHECK_MAN_NO, 
      ENTER_CHECK_MAN_NAME, ENTER_CHECK_TIME, 
      LEAVE_CHECK_MAN_NO, LEAVE_CHECK_MAN_NAME, 
      LEAVE_CHECK_TIME, CHECK_RESULT, 
      MEMO, VALUE_FLAG)
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.pkNo,jdbcType=VARCHAR}, 
      #{item.predictionNo,jdbcType=VARCHAR}, #{item.carNo,jdbcType=VARCHAR}, #{item.mnemonicCode,jdbcType=VARCHAR}, 
      #{item.driverName,jdbcType=VARCHAR}, #{item.idNum,jdbcType=VARCHAR}, #{item.telNum,jdbcType=VARCHAR}, 
      #{item.customerSupplierNo,jdbcType=VARCHAR}, #{item.customerSupplierName,jdbcType=VARCHAR}, 
      #{item.transportChemical,jdbcType=VARCHAR}, #{item.limitWeight,jdbcType=DECIMAL}, 
      #{item.tote,jdbcType=VARCHAR}, #{item.waterBoxIsEmpty,jdbcType=VARCHAR}, #{item.enterCheckManNo,jdbcType=VARCHAR}, 
      #{item.enterCheckManName,jdbcType=VARCHAR}, #{item.enterCheckTime,jdbcType=TIMESTAMP}, 
      #{item.leaveCheckManNo,jdbcType=VARCHAR}, #{item.leaveCheckManName,jdbcType=VARCHAR}, 
      #{item.leaveCheckTime,jdbcType=TIMESTAMP}, #{item.checkResult,jdbcType=VARCHAR}, 
      #{item.memo,jdbcType=VARCHAR}, #{item.valueFlag,jdbcType=VARCHAR} from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update METER_WORK_CAR_CHECK
     set
       PK_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.pkNo,jdbcType=VARCHAR}
       </foreach>
       ,PREDICTION_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.predictionNo,jdbcType=VARCHAR}
       </foreach>
       ,CAR_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.carNo,jdbcType=VARCHAR}
       </foreach>
       ,MNEMONIC_CODE=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.mnemonicCode,jdbcType=VARCHAR}
       </foreach>
       ,DRIVER_NAME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.driverName,jdbcType=VARCHAR}
       </foreach>
       ,ID_NUM=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.idNum,jdbcType=VARCHAR}
       </foreach>
       ,TEL_NUM=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.telNum,jdbcType=VARCHAR}
       </foreach>
       ,CUSTOMER_SUPPLIER_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.customerSupplierNo,jdbcType=VARCHAR}
       </foreach>
       ,CUSTOMER_SUPPLIER_NAME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.customerSupplierName,jdbcType=VARCHAR}
       </foreach>
       ,TRANSPORT_CHEMICAL=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.transportChemical,jdbcType=VARCHAR}
       </foreach>
       ,LIMIT_WEIGHT=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.limitWeight,jdbcType=DECIMAL}
       </foreach>
       ,TOTE=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.tote,jdbcType=VARCHAR}
       </foreach>
       ,WATER_BOX_IS_EMPTY=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.waterBoxIsEmpty,jdbcType=VARCHAR}
       </foreach>
       ,ENTER_CHECK_MAN_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.enterCheckManNo,jdbcType=VARCHAR}
       </foreach>
       ,ENTER_CHECK_MAN_NAME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.enterCheckManName,jdbcType=VARCHAR}
       </foreach>
       ,ENTER_CHECK_TIME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.enterCheckTime,jdbcType=TIMESTAMP}
       </foreach>
       ,LEAVE_CHECK_MAN_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.leaveCheckManNo,jdbcType=VARCHAR}
       </foreach>
       ,LEAVE_CHECK_MAN_NAME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.leaveCheckManName,jdbcType=VARCHAR}
       </foreach>
       ,LEAVE_CHECK_TIME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.leaveCheckTime,jdbcType=TIMESTAMP}
       </foreach>
       ,CHECK_RESULT=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.checkResult,jdbcType=VARCHAR}
       </foreach>
       ,MEMO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
       </foreach>
       ,VALUE_FLAG=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.valueFlag,jdbcType=VARCHAR}
       </foreach>
     where PK_NO in 
     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
    #{item.pkNo,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_WORK_CAR_CHECK
    where PK_NO in 
    <foreach close=")" collection="list" item="id" open="(" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->

  <select id="getNewID" parameterType="java.lang.String" resultType="java.lang.String">
    SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(PK_NO, LENGTH(PK_NO) - 3))),0) + 1,4,'0') PK_NO
    FROM METER_WORK_CAR_CHECK where instr(PK_NO,#{afl,jdbcType=VARCHAR})>0
  </select>

  <select id="reSelectIn"  parameterType="java.util.HashMap" resultMap="BaseResultMap">
    select  '' PK_NO,
          t.prediction_no PREDICTION_NO,
          t.car_no CAR_NO,
          t.trailer_no MNEMONIC_CODE,
          t.customer_supplier_no CUSTOMER_SUPPLIER_NO,
          t.customer_supplier_name CUSTOMER_SUPPLIER_NAME,
          '' DRIVER_NAME,
          '' ID_NUM,
          '' TEL_NUM,
          '' TRANSPORT_CHEMICAL,
          null LIMIT_WEIGHT,
          '' TOTE,
          '' WATER_BOX_IS_EMPTY,
          '' ENTER_CHECK_MAN_NO,
          '' ENTER_CHECK_MAN_NAME,
          null ENTER_CHECK_TIME,
          '' LEAVE_CHECK_MAN_NO,
          '' LEAVE_CHECK_MAN_NAME,
          null LEAVE_CHECK_TIME,
          '' CHECK_RESULT,
          '' MEMO,
          '' VALUE_FLAG
    from PRE_TRACK_SCALE t,(select distinct（t.PREDICTION_NO）
                              from METER_WORK_PRE_LINK t,(select t1.seq_no seq_no, t1.prediction_no prediction_no
                                                            from METER_WORK_PRE_LINK t1
                                                            where t1.link_code = #{linkCode}
                                                            and t1.link_name = #{linkName}
                                                            and t1.value_flag = '0') t2
                              where t.value_flag = '1'
                              and t.seq_no = t2.seq_no - 1
                              and t.prediction_no = t2.prediction_no) t1
    <where>
      t.value_flag in ('1','2','4')
      and t1.prediction_no = t.prediction_no
      <if test="carNo != null and carNo != ''">
        and t.CAR_NO = #{carNo}
      </if>
    </where>
    union all
    SELECT  PK_NO,
            PREDICTION_NO,
            CAR_NO,
            MNEMONIC_CODE,
            CUSTOMER_SUPPLIER_NO,
            CUSTOMER_SUPPLIER_NAME,
            DRIVER_NAME,
            ID_NUM,
            TEL_NUM,
            TRANSPORT_CHEMICAL,
            LIMIT_WEIGHT,
            TOTE,
            WATER_BOX_IS_EMPTY,
            ENTER_CHECK_MAN_NO,
            ENTER_CHECK_MAN_NAME,
            ENTER_CHECK_TIME,
            LEAVE_CHECK_MAN_NO,
            LEAVE_CHECK_MAN_NAME,
            LEAVE_CHECK_TIME,
            CHECK_RESULT,
            MEMO,
            VALUE_FLAG
    FROM METER_WORK_CAR_CHECK
    <include refid="where"/>
  </select>

  <select id="reSelectOut"  parameterType="java.util.HashMap" resultMap="BaseResultMap">
    select  t.prediction_no PREDICTION_NO,
            t.car_no CAR_NO,
            t.trailer_no MNEMONIC_CODE,
            t.customer_supplier_no CUSTOMER_SUPPLIER_NO,
            t.customer_supplier_name CUSTOMER_SUPPLIER_NAME
    from PRE_TRACK_SCALE t,(select distinct（t.PREDICTION_NO）
                              from METER_WORK_PRE_LINK t,(select t1.seq_no seq_no, t1.prediction_no prediction_no
                                                            from METER_WORK_PRE_LINK t1
                                                            where t1.link_code = #{linkCode}
                                                            and t1.link_name = #{linkName}
                                                            and t1.value_flag = '0') t2
                              where t.value_flag = '1'
                              and t.seq_no = t2.seq_no - 1
                              and t.prediction_no = t2.prediction_no) t1
    <where>
       t.value_flag in ('1','2','4')
      and t1.prediction_no = t.prediction_no
      <if test="carNo != null and carNo != ''">
        and t.CAR_NO = #{carNo}
      </if>
    </where>
  </select>
  <select id="GetNewID1" parameterType="java.lang.String" resultType="java.lang.String">
    SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(PREDICTION_NO, LENGTH(PREDICTION_NO) - 4))),0) + 1,5,'0') PREDICTION_NO
    FROM METER_WORK_CAR_CHECK
  </select>


</mapper>