<?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.pretrack.prebeltscale.mapper.PreBeltScaleMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.pretrack.prebeltscale.model.PreBeltScale">
    <id column="PREDICTION_NO" jdbcType="VARCHAR" property="predictionNo" />
    <result column="NOTICE_NO" jdbcType="VARCHAR" property="noticeNo" />
    <result column="BATCH_NO" jdbcType="VARCHAR" property="batchNo" />
    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
    <result column="VALUE_FLAG" jdbcType="VARCHAR" property="valueFlag" />
    <result column="PRODUCT_NO" jdbcType="VARCHAR" property="productNo" />
    <result column="PRODUCT_NAME" jdbcType="VARCHAR" property="productName" />
    <result column="GRADE_NO" jdbcType="VARCHAR" property="gradeNo" />
    <result column="GRADE_NAME" jdbcType="VARCHAR" property="gradeName" />
    <result column="STANDARD_NO" jdbcType="VARCHAR" property="standardNo" />
    <result column="STANDARD_NAME" jdbcType="VARCHAR" property="standardName" />
    <result column="PACKAGE_NO" jdbcType="VARCHAR" property="packageNo" />
    <result column="BLOCK_NUM" jdbcType="VARCHAR" property="blockNum" />
    <result column="PRODUCT_DATE" jdbcType="TIMESTAMP" property="productDate" />
    <result column="SEAL_NO" jdbcType="VARCHAR" property="sealNo" />
    <result column="BUCKET_NO" jdbcType="VARCHAR" property="bucketNo" />
    <result column="CUSTOMER_SUPPLIER_NO" jdbcType="VARCHAR" property="customerSupplierNo" />
    <result column="CUSTOMER_SUPPLIER_NAME" jdbcType="VARCHAR" property="customerSupplierName" />
    <result column="FORWARDING_UNIT_NO" jdbcType="VARCHAR" property="forwardingUnitNo" />
    <result column="FORWARDING_UNIT_NAME" jdbcType="VARCHAR" property="forwardingUnitName" />
    <result column="RECEIVING_UINT_NO" jdbcType="VARCHAR" property="receivingUintNo" />
    <result column="RECEIVING_UINT_NAME" jdbcType="VARCHAR" property="receivingUintName" />
    <result column="SPEC_NO" jdbcType="VARCHAR" property="specNo" />
    <result column="SPEC_NAME" jdbcType="VARCHAR" property="specName" />
    <result column="CREATE_MAN_NO" jdbcType="VARCHAR" property="createManNo" />
    <result column="CREATE_MAN_NAME" jdbcType="VARCHAR" property="createManName" />
    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
    <result column="UPDATE_MAN_NO" jdbcType="VARCHAR" property="updateManNo" />
    <result column="UPDATE_MAN_NAME" jdbcType="VARCHAR" property="updateManName" />
    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="DELETE_MAN_NO" jdbcType="VARCHAR" property="deleteManNo" />
    <result column="DELETE_MAN_NAME" jdbcType="VARCHAR" property="deleteManName" />
    <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
    <result column="HEAT_NO" jdbcType="VARCHAR" property="heatNo" />
    <result column="HEAT_NO_MES" jdbcType="VARCHAR" property="heatNoMes" />
    <result column="HEAT_NO_SEQ" jdbcType="VARCHAR" property="heatNoSeq" />
    <result column="BASE_SPOT_NO" jdbcType="VARCHAR" property="baseSpotNo" />
    <result column="BASE_SPOT_NAME" jdbcType="VARCHAR" property="baseSpotName" />
    <result column="METER_CLASS" jdbcType="VARCHAR" property="meterClass" />
    <result column="METER_GROUP" jdbcType="VARCHAR" property="meterGroup" />
    <result column="THEORETICAL_WEIGHT" jdbcType="DECIMAL" property="theoreticalWeight" />
    <result column="WEIGHT_DIFF" jdbcType="DECIMAL" property="weightDiff" />
    <result column="UNLOAD_WHARF" jdbcType="VARCHAR" property="unloadWharf" />
    <result column="START_TIME" jdbcType="TIMESTAMP" property="startTime" />
    <result column="OVERSTOCK" jdbcType="TIMESTAMP" property="overstock" />
    <result column="UNLOAD_SITE" jdbcType="VARCHAR" property="unloadSite" />
    <result column="FORWARDING_WEIGHT" jdbcType="DECIMAL" property="forwardingWeight" />
    <result column="SHIP_NO" jdbcType="VARCHAR" property="shipNo" />
    <result column="ORDER_NO" jdbcType="VARCHAR" property="orderNo" />
    <result column="new_mat_name" jdbcType="VARCHAR" property="newMatName" />
    <result column="new_gg" jdbcType="VARCHAR" property="newGg" />
    <result column="new_hlh" jdbcType="VARCHAR" property="newHlh" />
    <result column="new_supplier" jdbcType="VARCHAR" property="newSupplier" />
  </resultMap>

  <sql id="columns">
    PREDICTION_NO, NOTICE_NO, BATCH_NO, MEMO, VALUE_FLAG, PRODUCT_NO, PRODUCT_NAME, GRADE_NO, 
    GRADE_NAME, STANDARD_NO, STANDARD_NAME, PACKAGE_NO, BLOCK_NUM, PRODUCT_DATE, SEAL_NO, 
    BUCKET_NO, CUSTOMER_SUPPLIER_NO, CUSTOMER_SUPPLIER_NAME, FORWARDING_UNIT_NO, FORWARDING_UNIT_NAME, 
    RECEIVING_UINT_NO, RECEIVING_UINT_NAME, SPEC_NO, SPEC_NAME, CREATE_MAN_NO, CREATE_MAN_NAME, 
    CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO, DELETE_MAN_NAME, 
    DELETE_TIME, HEAT_NO, HEAT_NO_MES, HEAT_NO_SEQ, BASE_SPOT_NO, BASE_SPOT_NAME, METER_CLASS, 
    METER_GROUP, THEORETICAL_WEIGHT, WEIGHT_DIFF, UNLOAD_WHARF, START_TIME, OVERSTOCK, 
    UNLOAD_SITE, FORWARDING_WEIGHT, SHIP_NO,ORDER_NO,new_mat_name,new_gg,new_hlh,new_supplier
  </sql>
  <sql id="columns_alias">
    t.PREDICTION_NO, t.NOTICE_NO, t.BATCH_NO, t.MEMO, t.VALUE_FLAG, t.PRODUCT_NO, t.PRODUCT_NAME, 
    t.GRADE_NO, t.GRADE_NAME, t.STANDARD_NO, t.STANDARD_NAME, t.PACKAGE_NO, t.BLOCK_NUM, 
    t.PRODUCT_DATE, t.SEAL_NO, t.BUCKET_NO, t.CUSTOMER_SUPPLIER_NO, t.CUSTOMER_SUPPLIER_NAME, 
    t.FORWARDING_UNIT_NO, t.FORWARDING_UNIT_NAME, t.RECEIVING_UINT_NO, t.RECEIVING_UINT_NAME, 
    t.SPEC_NO, t.SPEC_NAME, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, 
    t.UPDATE_MAN_NAME, t.UPDATE_TIME, t.DELETE_MAN_NO, t.DELETE_MAN_NAME, t.DELETE_TIME, 
    t.HEAT_NO, t.HEAT_NO_MES, t.HEAT_NO_SEQ, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.METER_CLASS, 
    t.METER_GROUP, t.THEORETICAL_WEIGHT, t.WEIGHT_DIFF, t.UNLOAD_WHARF, t.START_TIME, 
    t.OVERSTOCK, t.UNLOAD_SITE, t.FORWARDING_WEIGHT, t.SHIP_NO,t.ORDER_NO,t.new_mat_name,t.new_gg,t.new_hlh,t.new_supplier
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM PRE_BELT_SCALE
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM PRE_BELT_SCALE t
  </sql>
  <sql id="where">
    <where> 
      <if test="predictionNo != null and predictionNo != ''">
        and PREDICTION_NO = #{predictionNo}
      </if>
      <if test="noticeNo != null and noticeNo != ''">
        and NOTICE_NO = #{noticeNo}
      </if>
      <if test="batchNo != null and batchNo != ''">
        and BATCH_NO = #{batchNo}
      </if>
      <if test="memo != null and memo != ''">
        and MEMO = #{memo}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        and VALUE_FLAG = #{valueFlag}
      </if>
      <if test="productNo != null and productNo != ''">
        and PRODUCT_NO = #{productNo}
      </if>
      <if test="productName != null and productName != ''">
        and PRODUCT_NAME = #{productName}
      </if>
      <if test="gradeNo != null and gradeNo != ''">
        and GRADE_NO = #{gradeNo}
      </if>
      <if test="gradeName != null and gradeName != ''">
        and GRADE_NAME = #{gradeName}
      </if>
      <if test="standardNo != null and standardNo != ''">
        and STANDARD_NO = #{standardNo}
      </if>
      <if test="standardName != null and standardName != ''">
        and STANDARD_NAME = #{standardName}
      </if>
      <if test="packageNo != null and packageNo != ''">
        and PACKAGE_NO = #{packageNo}
      </if>
      <if test="blockNum != null and blockNum != ''">
        and BLOCK_NUM = #{blockNum}
      </if>
      <if test="productDate != null">
        and TO_CHAR(PRODUCT_DATE,'yyyy-MM-dd') = #{productDate}
      </if>
      <if test="sealNo != null and sealNo != ''">
        and SEAL_NO = #{sealNo}
      </if>
      <if test="bucketNo != null and bucketNo != ''">
        and BUCKET_NO = #{bucketNo}
      </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="forwardingUnitNo != null and forwardingUnitNo != ''">
        and FORWARDING_UNIT_NO = #{forwardingUnitNo}
      </if>
      <if test="forwardingUnitName != null and forwardingUnitName != ''">
        and FORWARDING_UNIT_NAME = #{forwardingUnitName}
      </if>
      <if test="receivingUintNo != null and receivingUintNo != ''">
        and RECEIVING_UINT_NO = #{receivingUintNo}
      </if>
      <if test="receivingUintName != null and receivingUintName != ''">
        and RECEIVING_UINT_NAME = #{receivingUintName}
      </if>
      <if test="specNo != null and specNo != ''">
        and SPEC_NO = #{specNo}
      </if>
      <if test="specName != null and specName != ''">
        and SPEC_NAME = #{specName}
      </if>
      <if test="createManNo != null and createManNo != ''">
        and CREATE_MAN_NO = #{createManNo}
      </if>
      <if test="createManName != null and createManName != ''">
        and CREATE_MAN_NAME = #{createManName}
      </if>
      <if test="createTime != null">
        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        and UPDATE_MAN_NO = #{updateManNo}
      </if>
      <if test="updateManName != null and updateManName != ''">
        and UPDATE_MAN_NAME = #{updateManName}
      </if>
      <if test="updateTime != null">
        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
      </if>
      <if test="deleteManNo != null and deleteManNo != ''">
        and DELETE_MAN_NO = #{deleteManNo}
      </if>
      <if test="deleteManName != null and deleteManName != ''">
        and DELETE_MAN_NAME = #{deleteManName}
      </if>
      <if test="deleteTime != null">
        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
      </if>
      <if test="heatNo != null and heatNo != ''">
        and HEAT_NO = #{heatNo}
      </if>
      <if test="heatNoMes != null and heatNoMes != ''">
        and HEAT_NO_MES = #{heatNoMes}
      </if>
      <if test="heatNoSeq != null and heatNoSeq != ''">
        and HEAT_NO_SEQ = #{heatNoSeq}
      </if>
      <if test="baseSpotNo != null and baseSpotNo != ''">
        and BASE_SPOT_NO = #{baseSpotNo}
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        and BASE_SPOT_NAME = #{baseSpotName}
      </if>
      <if test="meterClass != null and meterClass != ''">
        and METER_CLASS = #{meterClass}
      </if>
      <if test="meterGroup != null and meterGroup != ''">
        and METER_GROUP = #{meterGroup}
      </if>
      <if test="theoreticalWeight != null">
        and THEORETICAL_WEIGHT = #{theoreticalWeight}
      </if>
      <if test="weightDiff != null">
        and WEIGHT_DIFF = #{weightDiff}
      </if>
      <if test="unloadWharf != null and unloadWharf != ''">
        and UNLOAD_WHARF = #{unloadWharf}
      </if>
      <if test="startTime != null">
        and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
      </if>
      <if test="overstock != null">
        and TO_CHAR(OVERSTOCK,'yyyy-MM-dd') = #{overstock}
      </if>
      <if test="unloadSite != null and unloadSite != ''">
        and UNLOAD_SITE = #{unloadSite}
      </if>
      <if test="forwardingWeight != null">
        and FORWARDING_WEIGHT = #{forwardingWeight}
      </if>
      <if test="shipNo != null and shipNo != ''">
        and SHIP_NO = #{shipNo}
      </if>
      <if test="orderNo != null and orderNo != ''">
        and ORDER_NO = #{orderNo}
      </if>
      <if test="newMatName != null and newMatName != ''">
        and new_mat_name = #{newMatName}
      </if>
      <if test="newGg != null and newGg != ''">
        and new_gg = #{newGg}
      </if>
      <if test="newHlh != null and newHlh != ''">
        and new_hlh = #{newHlh}
      </if>
      <if test="newSupplier != null and newSupplier != ''">
        and new_supplier = #{newSupplier}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where> 
      <if test="predictionNo != null and predictionNo != ''">
        and PREDICTION_NO LIKE '%${predictionNo}%'
      </if>
      <if test="noticeNo != null and noticeNo != ''">
        and NOTICE_NO LIKE '%${noticeNo}%'
      </if>
      <if test="batchNo != null and batchNo != ''">
        and BATCH_NO LIKE '%${batchNo}%'
      </if>
      <if test="memo != null and memo != ''">
        and MEMO LIKE '%${memo}%'
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        and VALUE_FLAG LIKE '%${valueFlag}%'
      </if>
      <if test="productNo != null and productNo != ''">
        and PRODUCT_NO LIKE '%${productNo}%'
      </if>
      <if test="productName != null and productName != ''">
        and PRODUCT_NAME LIKE '%${productName}%'
      </if>
      <if test="gradeNo != null and gradeNo != ''">
        and GRADE_NO LIKE '%${gradeNo}%'
      </if>
      <if test="gradeName != null and gradeName != ''">
        and GRADE_NAME LIKE '%${gradeName}%'
      </if>
      <if test="standardNo != null and standardNo != ''">
        and STANDARD_NO LIKE '%${standardNo}%'
      </if>
      <if test="standardName != null and standardName != ''">
        and STANDARD_NAME LIKE '%${standardName}%'
      </if>
      <if test="packageNo != null and packageNo != ''">
        and PACKAGE_NO LIKE '%${packageNo}%'
      </if>
      <if test="blockNum != null and blockNum != ''">
        and BLOCK_NUM LIKE '%${blockNum}%'
      </if>
      <if test="productDate != null">
        and TO_CHAR(PRODUCT_DATE,'yyyy-MM-dd') = #{productDate}
      </if>
      <if test="sealNo != null and sealNo != ''">
        and SEAL_NO LIKE '%${sealNo}%'
      </if>
      <if test="bucketNo != null and bucketNo != ''">
        and BUCKET_NO LIKE '%${bucketNo}%'
      </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="forwardingUnitNo != null and forwardingUnitNo != ''">
        and FORWARDING_UNIT_NO LIKE '%${forwardingUnitNo}%'
      </if>
      <if test="forwardingUnitName != null and forwardingUnitName != ''">
        and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
      </if>
      <if test="receivingUintNo != null and receivingUintNo != ''">
        and RECEIVING_UINT_NO LIKE '%${receivingUintNo}%'
      </if>
      <if test="receivingUintName != null and receivingUintName != ''">
        and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
      </if>
      <if test="specNo != null and specNo != ''">
        and SPEC_NO LIKE '%${specNo}%'
      </if>
      <if test="specName != null and specName != ''">
        and SPEC_NAME LIKE '%${specName}%'
      </if>
      <if test="createManNo != null and createManNo != ''">
        and CREATE_MAN_NO LIKE '%${createManNo}%'
      </if>
      <if test="createManName != null and createManName != ''">
        and CREATE_MAN_NAME LIKE '%${createManName}%'
      </if>
      <if test="createTime != null">
        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        and UPDATE_MAN_NO LIKE '%${updateManNo}%'
      </if>
      <if test="updateManName != null and updateManName != ''">
        and UPDATE_MAN_NAME LIKE '%${updateManName}%'
      </if>
      <if test="updateTime != null">
        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
      </if>
      <if test="deleteManNo != null and deleteManNo != ''">
        and DELETE_MAN_NO LIKE '%${deleteManNo}%'
      </if>
      <if test="deleteManName != null and deleteManName != ''">
        and DELETE_MAN_NAME LIKE '%${deleteManName}%'
      </if>
      <if test="deleteTime != null">
        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
      </if>
      <if test="heatNo != null and heatNo != ''">
        and HEAT_NO LIKE '%${heatNo}%'
      </if>
      <if test="heatNoMes != null and heatNoMes != ''">
        and HEAT_NO_MES LIKE '%${heatNoMes}%'
      </if>
      <if test="heatNoSeq != null and heatNoSeq != ''">
        and HEAT_NO_SEQ LIKE '%${heatNoSeq}%'
      </if>
      <if test="baseSpotNo != null and baseSpotNo != ''">
        and BASE_SPOT_NO LIKE '%${baseSpotNo}%'
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        and BASE_SPOT_NAME LIKE '%${baseSpotName}%'
      </if>
      <if test="meterClass != null and meterClass != ''">
        and METER_CLASS LIKE '%${meterClass}%'
      </if>
      <if test="meterGroup != null and meterGroup != ''">
        and METER_GROUP LIKE '%${meterGroup}%'
      </if>
      <if test="theoreticalWeight != null">
        and THEORETICAL_WEIGHT = #{theoreticalWeight}
      </if>
      <if test="weightDiff != null">
        and WEIGHT_DIFF = #{weightDiff}
      </if>
      <if test="unloadWharf != null and unloadWharf != ''">
        and UNLOAD_WHARF LIKE '%${unloadWharf}%'
      </if>
      <if test="startTime != null">
        and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
      </if>
      <if test="overstock != null">
        and TO_CHAR(OVERSTOCK,'yyyy-MM-dd') = #{overstock}
      </if>
      <if test="unloadSite != null and unloadSite != ''">
        and UNLOAD_SITE LIKE '%${unloadSite}%'
      </if>
      <if test="forwardingWeight != null">
        and FORWARDING_WEIGHT = #{forwardingWeight}
      </if>
      <if test="shipNo != null and shipNo != ''">
        and SHIP_NO LIKE '%${shipNo}%'
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from PRE_BELT_SCALE
    where PREDICTION_NO = #{predictionNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from PRE_BELT_SCALE
    where 1!=1 
      <if test="noticeNo != null and noticeNo != ''">
        or NOTICE_NO = #{noticeNo}
      </if>
      <if test="batchNo != null and batchNo != ''">
        or BATCH_NO = #{batchNo}
      </if>
      <if test="memo != null and memo != ''">
        or MEMO = #{memo}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        or VALUE_FLAG = #{valueFlag}
      </if>
      <if test="productNo != null and productNo != ''">
        or PRODUCT_NO = #{productNo}
      </if>
      <if test="productName != null and productName != ''">
        or PRODUCT_NAME = #{productName}
      </if>
      <if test="gradeNo != null and gradeNo != ''">
        or GRADE_NO = #{gradeNo}
      </if>
      <if test="gradeName != null and gradeName != ''">
        or GRADE_NAME = #{gradeName}
      </if>
      <if test="standardNo != null and standardNo != ''">
        or STANDARD_NO = #{standardNo}
      </if>
      <if test="standardName != null and standardName != ''">
        or STANDARD_NAME = #{standardName}
      </if>
      <if test="packageNo != null and packageNo != ''">
        or PACKAGE_NO = #{packageNo}
      </if>
      <if test="blockNum != null and blockNum != ''">
        or BLOCK_NUM = #{blockNum}
      </if>
      <if test="productDate != null">
        or TO_CHAR(PRODUCT_DATE,'yyyy-MM-dd') = '#{productDate}'
      </if>
      <if test="sealNo != null and sealNo != ''">
        or SEAL_NO = #{sealNo}
      </if>
      <if test="bucketNo != null and bucketNo != ''">
        or BUCKET_NO = #{bucketNo}
      </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="forwardingUnitNo != null and forwardingUnitNo != ''">
        or FORWARDING_UNIT_NO = #{forwardingUnitNo}
      </if>
      <if test="forwardingUnitName != null and forwardingUnitName != ''">
        or FORWARDING_UNIT_NAME = #{forwardingUnitName}
      </if>
      <if test="receivingUintNo != null and receivingUintNo != ''">
        or RECEIVING_UINT_NO = #{receivingUintNo}
      </if>
      <if test="receivingUintName != null and receivingUintName != ''">
        or RECEIVING_UINT_NAME = #{receivingUintName}
      </if>
      <if test="specNo != null and specNo != ''">
        or SPEC_NO = #{specNo}
      </if>
      <if test="specName != null and specName != ''">
        or SPEC_NAME = #{specName}
      </if>
      <if test="createManNo != null and createManNo != ''">
        or CREATE_MAN_NO = #{createManNo}
      </if>
      <if test="createManName != null and createManName != ''">
        or CREATE_MAN_NAME = #{createManName}
      </if>
      <if test="createTime != null">
        or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        or UPDATE_MAN_NO = #{updateManNo}
      </if>
      <if test="updateManName != null and updateManName != ''">
        or UPDATE_MAN_NAME = #{updateManName}
      </if>
      <if test="updateTime != null">
        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
      </if>
      <if test="deleteManNo != null and deleteManNo != ''">
        or DELETE_MAN_NO = #{deleteManNo}
      </if>
      <if test="deleteManName != null and deleteManName != ''">
        or DELETE_MAN_NAME = #{deleteManName}
      </if>
      <if test="deleteTime != null">
        or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
      </if>
      <if test="heatNo != null and heatNo != ''">
        or HEAT_NO = #{heatNo}
      </if>
      <if test="heatNoMes != null and heatNoMes != ''">
        or HEAT_NO_MES = #{heatNoMes}
      </if>
      <if test="heatNoSeq != null and heatNoSeq != ''">
        or HEAT_NO_SEQ = #{heatNoSeq}
      </if>
      <if test="baseSpotNo != null and baseSpotNo != ''">
        or BASE_SPOT_NO = #{baseSpotNo}
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        or BASE_SPOT_NAME = #{baseSpotName}
      </if>
      <if test="meterClass != null and meterClass != ''">
        or METER_CLASS = #{meterClass}
      </if>
      <if test="meterGroup != null and meterGroup != ''">
        or METER_GROUP = #{meterGroup}
      </if>
      <if test="theoreticalWeight != null">
        or THEORETICAL_WEIGHT = #{theoreticalWeight}
      </if>
      <if test="weightDiff != null">
        or WEIGHT_DIFF = #{weightDiff}
      </if>
      <if test="unloadWharf != null and unloadWharf != ''">
        or UNLOAD_WHARF = #{unloadWharf}
      </if>
      <if test="startTime != null">
        or TO_CHAR(START_TIME,'yyyy-MM-dd') = '#{startTime}'
      </if>
      <if test="overstock != null">
        or TO_CHAR(OVERSTOCK,'yyyy-MM-dd') = '#{overstock}'
      </if>
      <if test="unloadSite != null and unloadSite != ''">
        or UNLOAD_SITE = #{unloadSite}
      </if>
      <if test="forwardingWeight != null">
        or FORWARDING_WEIGHT = #{forwardingWeight}
      </if>
      <if test="shipNo != null and shipNo != ''">
        or SHIP_NO = #{shipNo}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.pretrack.prebeltscale.model.PreBeltScale">
    insert into PRE_BELT_SCALE (PREDICTION_NO, NOTICE_NO, BATCH_NO, 
      MEMO, VALUE_FLAG, PRODUCT_NO, 
      PRODUCT_NAME, GRADE_NO, GRADE_NAME, 
      STANDARD_NO, STANDARD_NAME, PACKAGE_NO, 
      BLOCK_NUM, PRODUCT_DATE, SEAL_NO, 
      BUCKET_NO, CUSTOMER_SUPPLIER_NO, CUSTOMER_SUPPLIER_NAME, 
      FORWARDING_UNIT_NO, FORWARDING_UNIT_NAME, RECEIVING_UINT_NO, 
      RECEIVING_UINT_NAME, SPEC_NO, SPEC_NAME, 
      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
      DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME, 
      HEAT_NO, HEAT_NO_MES, HEAT_NO_SEQ, 
      BASE_SPOT_NO, BASE_SPOT_NAME, METER_CLASS, 
      METER_GROUP, THEORETICAL_WEIGHT, WEIGHT_DIFF, 
      UNLOAD_WHARF, START_TIME, OVERSTOCK, 
      UNLOAD_SITE, FORWARDING_WEIGHT, SHIP_NO
      )
    values (#{predictionNo,jdbcType=VARCHAR}, #{noticeNo,jdbcType=VARCHAR}, #{batchNo,jdbcType=VARCHAR}, 
      #{memo,jdbcType=VARCHAR}, #{valueFlag,jdbcType=VARCHAR}, #{productNo,jdbcType=VARCHAR}, 
      #{productName,jdbcType=VARCHAR}, #{gradeNo,jdbcType=VARCHAR}, #{gradeName,jdbcType=VARCHAR}, 
      #{standardNo,jdbcType=VARCHAR}, #{standardName,jdbcType=VARCHAR}, #{packageNo,jdbcType=VARCHAR}, 
      #{blockNum,jdbcType=VARCHAR}, #{productDate,jdbcType=TIMESTAMP}, #{sealNo,jdbcType=VARCHAR}, 
      #{bucketNo,jdbcType=VARCHAR}, #{customerSupplierNo,jdbcType=VARCHAR}, #{customerSupplierName,jdbcType=VARCHAR}, 
      #{forwardingUnitNo,jdbcType=VARCHAR}, #{forwardingUnitName,jdbcType=VARCHAR}, #{receivingUintNo,jdbcType=VARCHAR}, 
      #{receivingUintName,jdbcType=VARCHAR}, #{specNo,jdbcType=VARCHAR}, #{specName,jdbcType=VARCHAR}, 
      #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{deleteManNo,jdbcType=VARCHAR}, #{deleteManName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, 
      #{heatNo,jdbcType=VARCHAR}, #{heatNoMes,jdbcType=VARCHAR}, #{heatNoSeq,jdbcType=VARCHAR}, 
      #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR}, #{meterClass,jdbcType=VARCHAR}, 
      #{meterGroup,jdbcType=VARCHAR}, #{theoreticalWeight,jdbcType=DECIMAL}, #{weightDiff,jdbcType=DECIMAL}, 
      #{unloadWharf,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{overstock,jdbcType=TIMESTAMP}, 
      #{unloadSite,jdbcType=VARCHAR}, #{forwardingWeight,jdbcType=DECIMAL}, #{shipNo,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.pretrack.prebeltscale.model.PreBeltScale">
    insert into PRE_BELT_SCALE
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="predictionNo != null">
        PREDICTION_NO,
      </if>
      <if test="noticeNo != null">
        NOTICE_NO,
      </if>
      <if test="batchNo != null">
        BATCH_NO,
      </if>
      <if test="memo != null">
        MEMO,
      </if>
      <if test="valueFlag != null">
        VALUE_FLAG,
      </if>
      <if test="productNo != null">
        PRODUCT_NO,
      </if>
      <if test="productName != null">
        PRODUCT_NAME,
      </if>
      <if test="gradeNo != null">
        GRADE_NO,
      </if>
      <if test="gradeName != null">
        GRADE_NAME,
      </if>
      <if test="standardNo != null">
        STANDARD_NO,
      </if>
      <if test="standardName != null">
        STANDARD_NAME,
      </if>
      <if test="packageNo != null">
        PACKAGE_NO,
      </if>
      <if test="blockNum != null">
        BLOCK_NUM,
      </if>
      <if test="productDate != null">
        PRODUCT_DATE,
      </if>
      <if test="sealNo != null">
        SEAL_NO,
      </if>
      <if test="bucketNo != null">
        BUCKET_NO,
      </if>
      <if test="customerSupplierNo != null">
        CUSTOMER_SUPPLIER_NO,
      </if>
      <if test="customerSupplierName != null">
        CUSTOMER_SUPPLIER_NAME,
      </if>
      <if test="forwardingUnitNo != null">
        FORWARDING_UNIT_NO,
      </if>
      <if test="forwardingUnitName != null">
        FORWARDING_UNIT_NAME,
      </if>
      <if test="receivingUintNo != null">
        RECEIVING_UINT_NO,
      </if>
      <if test="receivingUintName != null">
        RECEIVING_UINT_NAME,
      </if>
      <if test="specNo != null">
        SPEC_NO,
      </if>
      <if test="specName != null">
        SPEC_NAME,
      </if>
      <if test="createManNo != null">
        CREATE_MAN_NO,
      </if>
      <if test="createManName != null">
        CREATE_MAN_NAME,
      </if>
      <if test="createTime != null">
        CREATE_TIME,
      </if>
      <if test="updateManNo != null">
        UPDATE_MAN_NO,
      </if>
      <if test="updateManName != null">
        UPDATE_MAN_NAME,
      </if>
      <if test="updateTime != null">
        UPDATE_TIME,
      </if>
      <if test="deleteManNo != null">
        DELETE_MAN_NO,
      </if>
      <if test="deleteManName != null">
        DELETE_MAN_NAME,
      </if>
      <if test="deleteTime != null">
        DELETE_TIME,
      </if>
      <if test="heatNo != null">
        HEAT_NO,
      </if>
      <if test="heatNoMes != null">
        HEAT_NO_MES,
      </if>
      <if test="heatNoSeq != null">
        HEAT_NO_SEQ,
      </if>
      <if test="baseSpotNo != null">
        BASE_SPOT_NO,
      </if>
      <if test="baseSpotName != null">
        BASE_SPOT_NAME,
      </if>
      <if test="meterClass != null">
        METER_CLASS,
      </if>
      <if test="meterGroup != null">
        METER_GROUP,
      </if>
      <if test="theoreticalWeight != null">
        THEORETICAL_WEIGHT,
      </if>
      <if test="weightDiff != null">
        WEIGHT_DIFF,
      </if>
      <if test="unloadWharf != null">
        UNLOAD_WHARF,
      </if>
      <if test="startTime != null">
        START_TIME,
      </if>
      <if test="overstock != null">
        OVERSTOCK,
      </if>
      <if test="unloadSite != null">
        UNLOAD_SITE,
      </if>
      <if test="forwardingWeight != null">
        FORWARDING_WEIGHT,
      </if>
      <if test="shipNo != null">
        SHIP_NO,
      </if>
      <if test="orderNo != null">
        ORDER_NO,
      </if>
      <if test="orderNo != null">
        ORDER_NO,
      </if>
      <if test="newMatName != null">
        new_mat_name,
      </if>
      <if test="newGg != null">
        new_gg,
      </if>
      <if test="newHlh != null">
        new_hlh,
      </if>
      <if test="newSupplier != null">
        new_supplier,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="predictionNo != null">
        #{predictionNo,jdbcType=VARCHAR},
      </if>
      <if test="noticeNo != null">
        #{noticeNo,jdbcType=VARCHAR},
      </if>
      <if test="batchNo != null">
        #{batchNo,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        #{memo,jdbcType=VARCHAR},
      </if>
      <if test="valueFlag != null">
        #{valueFlag,jdbcType=VARCHAR},
      </if>
      <if test="productNo != null">
        #{productNo,jdbcType=VARCHAR},
      </if>
      <if test="productName != null">
        #{productName,jdbcType=VARCHAR},
      </if>
      <if test="gradeNo != null">
        #{gradeNo,jdbcType=VARCHAR},
      </if>
      <if test="gradeName != null">
        #{gradeName,jdbcType=VARCHAR},
      </if>
      <if test="standardNo != null">
        #{standardNo,jdbcType=VARCHAR},
      </if>
      <if test="standardName != null">
        #{standardName,jdbcType=VARCHAR},
      </if>
      <if test="packageNo != null">
        #{packageNo,jdbcType=VARCHAR},
      </if>
      <if test="blockNum != null">
        #{blockNum,jdbcType=VARCHAR},
      </if>
      <if test="productDate != null">
        #{productDate,jdbcType=TIMESTAMP},
      </if>
      <if test="sealNo != null">
        #{sealNo,jdbcType=VARCHAR},
      </if>
      <if test="bucketNo != null">
        #{bucketNo,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierNo != null">
        #{customerSupplierNo,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierName != null">
        #{customerSupplierName,jdbcType=VARCHAR},
      </if>
      <if test="forwardingUnitNo != null">
        #{forwardingUnitNo,jdbcType=VARCHAR},
      </if>
      <if test="forwardingUnitName != null">
        #{forwardingUnitName,jdbcType=VARCHAR},
      </if>
      <if test="receivingUintNo != null">
        #{receivingUintNo,jdbcType=VARCHAR},
      </if>
      <if test="receivingUintName != null">
        #{receivingUintName,jdbcType=VARCHAR},
      </if>
      <if test="specNo != null">
        #{specNo,jdbcType=VARCHAR},
      </if>
      <if test="specName != null">
        #{specName,jdbcType=VARCHAR},
      </if>
      <if test="createManNo != null">
        #{createManNo,jdbcType=VARCHAR},
      </if>
      <if test="createManName != null">
        #{createManName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateManNo != null">
        #{updateManNo,jdbcType=VARCHAR},
      </if>
      <if test="updateManName != null">
        #{updateManName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteManNo != null">
        #{deleteManNo,jdbcType=VARCHAR},
      </if>
      <if test="deleteManName != null">
        #{deleteManName,jdbcType=VARCHAR},
      </if>
      <if test="deleteTime != null">
        #{deleteTime,jdbcType=TIMESTAMP},
      </if>
      <if test="heatNo != null">
        #{heatNo,jdbcType=VARCHAR},
      </if>
      <if test="heatNoMes != null">
        #{heatNoMes,jdbcType=VARCHAR},
      </if>
      <if test="heatNoSeq != null">
        #{heatNoSeq,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotNo != null">
        #{baseSpotNo,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotName != null">
        #{baseSpotName,jdbcType=VARCHAR},
      </if>
      <if test="meterClass != null">
        #{meterClass,jdbcType=VARCHAR},
      </if>
      <if test="meterGroup != null">
        #{meterGroup,jdbcType=VARCHAR},
      </if>
      <if test="theoreticalWeight != null">
        #{theoreticalWeight,jdbcType=DECIMAL},
      </if>
      <if test="weightDiff != null">
        #{weightDiff,jdbcType=DECIMAL},
      </if>
      <if test="unloadWharf != null">
        #{unloadWharf,jdbcType=VARCHAR},
      </if>
      <if test="startTime != null">
        #{startTime,jdbcType=TIMESTAMP},
      </if>
      <if test="overstock != null">
        #{overstock,jdbcType=TIMESTAMP},
      </if>
      <if test="unloadSite != null">
        #{unloadSite,jdbcType=VARCHAR},
      </if>
      <if test="forwardingWeight != null">
        #{forwardingWeight,jdbcType=DECIMAL},
      </if>
      <if test="shipNo != null">
        #{shipNo,jdbcType=VARCHAR},
      </if>
      <if test="orderNo != null">
        #{orderNo,jdbcType=VARCHAR},
      </if>
      <if test="newMatName != null">
      #{newMatName,jdbcType=VARCHAR},
      </if>
      <if test="newGg != null">
        #{newGg,jdbcType=VARCHAR},
      </if>
      <if test="newHlh != null">
        #{newHlh,jdbcType=VARCHAR},
      </if>
      <if test="newSupplier != null">
        #{newSupplier,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.pretrack.prebeltscale.model.PreBeltScale">
    update PRE_BELT_SCALE
    set NOTICE_NO = #{noticeNo,jdbcType=VARCHAR},
      BATCH_NO = #{batchNo,jdbcType=VARCHAR},
      MEMO = #{memo,jdbcType=VARCHAR},
      VALUE_FLAG = #{valueFlag,jdbcType=VARCHAR},
      PRODUCT_NO = #{productNo,jdbcType=VARCHAR},
      PRODUCT_NAME = #{productName,jdbcType=VARCHAR},
      GRADE_NO = #{gradeNo,jdbcType=VARCHAR},
      GRADE_NAME = #{gradeName,jdbcType=VARCHAR},
      STANDARD_NO = #{standardNo,jdbcType=VARCHAR},
      STANDARD_NAME = #{standardName,jdbcType=VARCHAR},
      PACKAGE_NO = #{packageNo,jdbcType=VARCHAR},
      BLOCK_NUM = #{blockNum,jdbcType=VARCHAR},
      PRODUCT_DATE = #{productDate,jdbcType=TIMESTAMP},
      SEAL_NO = #{sealNo,jdbcType=VARCHAR},
      BUCKET_NO = #{bucketNo,jdbcType=VARCHAR},
      CUSTOMER_SUPPLIER_NO = #{customerSupplierNo,jdbcType=VARCHAR},
      CUSTOMER_SUPPLIER_NAME = #{customerSupplierName,jdbcType=VARCHAR},
      FORWARDING_UNIT_NO = #{forwardingUnitNo,jdbcType=VARCHAR},
      FORWARDING_UNIT_NAME = #{forwardingUnitName,jdbcType=VARCHAR},
      RECEIVING_UINT_NO = #{receivingUintNo,jdbcType=VARCHAR},
      RECEIVING_UINT_NAME = #{receivingUintName,jdbcType=VARCHAR},
      SPEC_NO = #{specNo,jdbcType=VARCHAR},
      SPEC_NAME = #{specName,jdbcType=VARCHAR},
      CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
      CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
      UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      DELETE_MAN_NO = #{deleteManNo,jdbcType=VARCHAR},
      DELETE_MAN_NAME = #{deleteManName,jdbcType=VARCHAR},
      DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
      HEAT_NO = #{heatNo,jdbcType=VARCHAR},
      HEAT_NO_MES = #{heatNoMes,jdbcType=VARCHAR},
      HEAT_NO_SEQ = #{heatNoSeq,jdbcType=VARCHAR},
      BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
      BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
      METER_CLASS = #{meterClass,jdbcType=VARCHAR},
      METER_GROUP = #{meterGroup,jdbcType=VARCHAR},
      THEORETICAL_WEIGHT = #{theoreticalWeight,jdbcType=DECIMAL},
      WEIGHT_DIFF = #{weightDiff,jdbcType=DECIMAL},
      UNLOAD_WHARF = #{unloadWharf,jdbcType=VARCHAR},
      START_TIME = #{startTime,jdbcType=TIMESTAMP},
      OVERSTOCK = #{overstock,jdbcType=TIMESTAMP},
      UNLOAD_SITE = #{unloadSite,jdbcType=VARCHAR},
      FORWARDING_WEIGHT = #{forwardingWeight,jdbcType=DECIMAL},
      SHIP_NO = #{shipNo,jdbcType=VARCHAR}
    where PREDICTION_NO = #{predictionNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.pretrack.prebeltscale.model.PreBeltScale">
    update PRE_BELT_SCALE
    <set>
      <if test="noticeNo != null">
        NOTICE_NO = #{noticeNo,jdbcType=VARCHAR},
      </if>
      <if test="batchNo != null">
        BATCH_NO = #{batchNo,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        MEMO = #{memo,jdbcType=VARCHAR},
      </if>
      <if test="valueFlag != null">
        VALUE_FLAG = #{valueFlag,jdbcType=VARCHAR},
      </if>
      <if test="productNo != null">
        PRODUCT_NO = #{productNo,jdbcType=VARCHAR},
      </if>
      <if test="productName != null">
        PRODUCT_NAME = #{productName,jdbcType=VARCHAR},
      </if>
      <if test="gradeNo != null">
        GRADE_NO = #{gradeNo,jdbcType=VARCHAR},
      </if>
      <if test="gradeName != null">
        GRADE_NAME = #{gradeName,jdbcType=VARCHAR},
      </if>
      <if test="standardNo != null">
        STANDARD_NO = #{standardNo,jdbcType=VARCHAR},
      </if>
      <if test="standardName != null">
        STANDARD_NAME = #{standardName,jdbcType=VARCHAR},
      </if>
      <if test="packageNo != null">
        PACKAGE_NO = #{packageNo,jdbcType=VARCHAR},
      </if>
      <if test="blockNum != null">
        BLOCK_NUM = #{blockNum,jdbcType=VARCHAR},
      </if>
      <if test="productDate != null">
        PRODUCT_DATE = #{productDate,jdbcType=TIMESTAMP},
      </if>
      <if test="sealNo != null">
        SEAL_NO = #{sealNo,jdbcType=VARCHAR},
      </if>
      <if test="bucketNo != null">
        BUCKET_NO = #{bucketNo,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="forwardingUnitNo != null">
        FORWARDING_UNIT_NO = #{forwardingUnitNo,jdbcType=VARCHAR},
      </if>
      <if test="forwardingUnitName != null">
        FORWARDING_UNIT_NAME = #{forwardingUnitName,jdbcType=VARCHAR},
      </if>
      <if test="receivingUintNo != null">
        RECEIVING_UINT_NO = #{receivingUintNo,jdbcType=VARCHAR},
      </if>
      <if test="receivingUintName != null">
        RECEIVING_UINT_NAME = #{receivingUintName,jdbcType=VARCHAR},
      </if>
      <if test="specNo != null">
        SPEC_NO = #{specNo,jdbcType=VARCHAR},
      </if>
      <if test="specName != null">
        SPEC_NAME = #{specName,jdbcType=VARCHAR},
      </if>
      <if test="createManNo != null">
        CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
      </if>
      <if test="createManName != null">
        CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateManNo != null">
        UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
      </if>
      <if test="updateManName != null">
        UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteManNo != null">
        DELETE_MAN_NO = #{deleteManNo,jdbcType=VARCHAR},
      </if>
      <if test="deleteManName != null">
        DELETE_MAN_NAME = #{deleteManName,jdbcType=VARCHAR},
      </if>
      <if test="deleteTime != null">
        DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
      </if>
      <if test="heatNo != null">
        HEAT_NO = #{heatNo,jdbcType=VARCHAR},
      </if>
      <if test="heatNoMes != null">
        HEAT_NO_MES = #{heatNoMes,jdbcType=VARCHAR},
      </if>
      <if test="heatNoSeq != null">
        HEAT_NO_SEQ = #{heatNoSeq,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotNo != null">
        BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotName != null">
        BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
      </if>
      <if test="meterClass != null">
        METER_CLASS = #{meterClass,jdbcType=VARCHAR},
      </if>
      <if test="meterGroup != null">
        METER_GROUP = #{meterGroup,jdbcType=VARCHAR},
      </if>
      <if test="theoreticalWeight != null">
        THEORETICAL_WEIGHT = #{theoreticalWeight,jdbcType=DECIMAL},
      </if>
      <if test="weightDiff != null">
        WEIGHT_DIFF = #{weightDiff,jdbcType=DECIMAL},
      </if>
      <if test="unloadWharf != null">
        UNLOAD_WHARF = #{unloadWharf,jdbcType=VARCHAR},
      </if>
      <if test="startTime != null">
        START_TIME = #{startTime,jdbcType=TIMESTAMP},
      </if>
      <if test="overstock != null">
        OVERSTOCK = #{overstock,jdbcType=TIMESTAMP},
      </if>
      <if test="unloadSite != null">
        UNLOAD_SITE = #{unloadSite,jdbcType=VARCHAR},
      </if>
      <if test="forwardingWeight != null">
        FORWARDING_WEIGHT = #{forwardingWeight,jdbcType=DECIMAL},
      </if>
      <if test="shipNo != null">
        SHIP_NO = #{shipNo,jdbcType=VARCHAR},
      </if>
      <if test="orderNo != null">
        ORDER_NO = #{orderNo,jdbcType=VARCHAR},
      </if>
      <if test="newMatName != null">
        new_mat_name = #{newMatName,jdbcType=VARCHAR},
      </if>
      <if test="newGg != null">
        new_gg = #{newGg,jdbcType=VARCHAR},
      </if>
      <if test="newHlh != null">
        new_hlh =#{newHlh,jdbcType=VARCHAR},
      </if>
      <if test="newSupplier != null">
        new_supplier =#{newSupplier,jdbcType=VARCHAR},
      </if>
    </set>
    where PREDICTION_NO = #{predictionNo,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where PREDICTION_NO = #{predictionNo,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="where"/>
  </select>
  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="whereLike"/>
  </select>
  <insert id="batchInsert" parameterType="java.util.List">
    insert into PRE_BELT_SCALE 
      (PREDICTION_NO, 
      NOTICE_NO, BATCH_NO, MEMO, 
      VALUE_FLAG, PRODUCT_NO, PRODUCT_NAME, 
      GRADE_NO, GRADE_NAME, STANDARD_NO, 
      STANDARD_NAME, PACKAGE_NO, BLOCK_NUM, 
      PRODUCT_DATE, SEAL_NO, BUCKET_NO, 
      CUSTOMER_SUPPLIER_NO, CUSTOMER_SUPPLIER_NAME, 
      FORWARDING_UNIT_NO, FORWARDING_UNIT_NAME, 
      RECEIVING_UINT_NO, RECEIVING_UINT_NAME, 
      SPEC_NO, SPEC_NAME, CREATE_MAN_NO, 
      CREATE_MAN_NAME, CREATE_TIME, 
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
      DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME, 
      HEAT_NO, HEAT_NO_MES, HEAT_NO_SEQ, 
      BASE_SPOT_NO, BASE_SPOT_NAME, METER_CLASS, 
      METER_GROUP, THEORETICAL_WEIGHT, 
      WEIGHT_DIFF, UNLOAD_WHARF, START_TIME, 
      OVERSTOCK, UNLOAD_SITE, FORWARDING_WEIGHT, 
      SHIP_NO)
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.predictionNo,jdbcType=VARCHAR}, 
      #{item.noticeNo,jdbcType=VARCHAR}, #{item.batchNo,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR}, 
      #{item.valueFlag,jdbcType=VARCHAR}, #{item.productNo,jdbcType=VARCHAR}, #{item.productName,jdbcType=VARCHAR}, 
      #{item.gradeNo,jdbcType=VARCHAR}, #{item.gradeName,jdbcType=VARCHAR}, #{item.standardNo,jdbcType=VARCHAR}, 
      #{item.standardName,jdbcType=VARCHAR}, #{item.packageNo,jdbcType=VARCHAR}, #{item.blockNum,jdbcType=VARCHAR}, 
      #{item.productDate,jdbcType=TIMESTAMP}, #{item.sealNo,jdbcType=VARCHAR}, #{item.bucketNo,jdbcType=VARCHAR}, 
      #{item.customerSupplierNo,jdbcType=VARCHAR}, #{item.customerSupplierName,jdbcType=VARCHAR}, 
      #{item.forwardingUnitNo,jdbcType=VARCHAR}, #{item.forwardingUnitName,jdbcType=VARCHAR}, 
      #{item.receivingUintNo,jdbcType=VARCHAR}, #{item.receivingUintName,jdbcType=VARCHAR}, 
      #{item.specNo,jdbcType=VARCHAR}, #{item.specName,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, 
      #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
      #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
      #{item.deleteManNo,jdbcType=VARCHAR}, #{item.deleteManName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP}, 
      #{item.heatNo,jdbcType=VARCHAR}, #{item.heatNoMes,jdbcType=VARCHAR}, #{item.heatNoSeq,jdbcType=VARCHAR}, 
      #{item.baseSpotNo,jdbcType=VARCHAR}, #{item.baseSpotName,jdbcType=VARCHAR}, #{item.meterClass,jdbcType=VARCHAR}, 
      #{item.meterGroup,jdbcType=VARCHAR}, #{item.theoreticalWeight,jdbcType=DECIMAL}, 
      #{item.weightDiff,jdbcType=DECIMAL}, #{item.unloadWharf,jdbcType=VARCHAR}, #{item.startTime,jdbcType=TIMESTAMP}, 
      #{item.overstock,jdbcType=TIMESTAMP}, #{item.unloadSite,jdbcType=VARCHAR}, #{item.forwardingWeight,jdbcType=DECIMAL}, 
      #{item.shipNo,jdbcType=VARCHAR} from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update PRE_BELT_SCALE
     set
       PREDICTION_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.predictionNo,jdbcType=VARCHAR}
       </foreach>
       ,NOTICE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.noticeNo,jdbcType=VARCHAR}
       </foreach>
       ,BATCH_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.batchNo,jdbcType=VARCHAR}
       </foreach>
       ,MEMO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
       </foreach>
       ,VALUE_FLAG=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.valueFlag,jdbcType=VARCHAR}
       </foreach>
       ,PRODUCT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.productNo,jdbcType=VARCHAR}
       </foreach>
       ,PRODUCT_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.productName,jdbcType=VARCHAR}
       </foreach>
       ,GRADE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.gradeNo,jdbcType=VARCHAR}
       </foreach>
       ,GRADE_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.gradeName,jdbcType=VARCHAR}
       </foreach>
       ,STANDARD_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.standardNo,jdbcType=VARCHAR}
       </foreach>
       ,STANDARD_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.standardName,jdbcType=VARCHAR}
       </foreach>
       ,PACKAGE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.packageNo,jdbcType=VARCHAR}
       </foreach>
       ,BLOCK_NUM=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.blockNum,jdbcType=VARCHAR}
       </foreach>
       ,PRODUCT_DATE=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.productDate,jdbcType=TIMESTAMP}
       </foreach>
       ,SEAL_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.sealNo,jdbcType=VARCHAR}
       </foreach>
       ,BUCKET_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.bucketNo,jdbcType=VARCHAR}
       </foreach>
       ,CUSTOMER_SUPPLIER_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.customerSupplierNo,jdbcType=VARCHAR}
       </foreach>
       ,CUSTOMER_SUPPLIER_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.customerSupplierName,jdbcType=VARCHAR}
       </foreach>
       ,FORWARDING_UNIT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.forwardingUnitNo,jdbcType=VARCHAR}
       </foreach>
       ,FORWARDING_UNIT_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.forwardingUnitName,jdbcType=VARCHAR}
       </foreach>
       ,RECEIVING_UINT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.receivingUintNo,jdbcType=VARCHAR}
       </foreach>
       ,RECEIVING_UINT_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.receivingUintName,jdbcType=VARCHAR}
       </foreach>
       ,SPEC_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.specNo,jdbcType=VARCHAR}
       </foreach>
       ,SPEC_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.specName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
       </foreach>
       ,UPDATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
       </foreach>
       ,DELETE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.deleteManNo,jdbcType=VARCHAR}
       </foreach>
       ,DELETE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.deleteManName,jdbcType=VARCHAR}
       </foreach>
       ,DELETE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.deleteTime,jdbcType=TIMESTAMP}
       </foreach>
       ,HEAT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.heatNo,jdbcType=VARCHAR}
       </foreach>
       ,HEAT_NO_MES=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.heatNoMes,jdbcType=VARCHAR}
       </foreach>
       ,HEAT_NO_SEQ=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.heatNoSeq,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
       </foreach>
       ,METER_CLASS=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.meterClass,jdbcType=VARCHAR}
       </foreach>
       ,METER_GROUP=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.meterGroup,jdbcType=VARCHAR}
       </foreach>
       ,THEORETICAL_WEIGHT=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.theoreticalWeight,jdbcType=DECIMAL}
       </foreach>
       ,WEIGHT_DIFF=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.weightDiff,jdbcType=DECIMAL}
       </foreach>
       ,UNLOAD_WHARF=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.unloadWharf,jdbcType=VARCHAR}
       </foreach>
       ,START_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.startTime,jdbcType=TIMESTAMP}
       </foreach>
       ,OVERSTOCK=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.overstock,jdbcType=TIMESTAMP}
       </foreach>
       ,UNLOAD_SITE=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.unloadSite,jdbcType=VARCHAR}
       </foreach>
       ,FORWARDING_WEIGHT=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.forwardingWeight,jdbcType=DECIMAL}
       </foreach>
       ,SHIP_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PREDICTION_NO" close="end">
          when #{item.predictionNo,jdbcType=VARCHAR} then #{item.shipNo,jdbcType=VARCHAR}
       </foreach>
     where PREDICTION_NO in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.predictionNo,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from PRE_BELT_SCALE
    where PREDICTION_NO in 
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->


  <select id="doQueryLikeInfo" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    SELECT <include refid="columns"/> from PRE_BELT_SCALE
    <where>
      <if test="startTime != null and startTime != ''">
        and CREATE_TIME between TO_DATE(#{startTime},'yyyy-MM-dd HH24:mi:ss') and TO_DATE(#{endTime},'yyyy-MM-dd HH24:mi:ss')
      </if>
      <if test="predictionNo != null and predictionNo != ''">
        and PREDICTION_NO = #{predictionNo}
      </if>
      <if test="noticeNo != null and noticeNo != ''">
        and NOTICE_NO = #{noticeNo}
      </if>
      <if test="batchNo != null and batchNo != ''">
        and BATCH_NO = #{batchNo}
      </if>
      <if test="memo != null and memo != ''">
        and MEMO = #{memo}
      </if>
      <if test="valueFlag != null and valueFlag != '' and valueFlag !='9'.toString() and valueFlag !='8'.toString()">
        and VALUE_FLAG = #{valueFlag}
      </if>
      <if test="valueFlag != null and valueFlag != '' and valueFlag =='9'.toString()">
        and VALUE_FLAG in ('1','2','3')
      </if>
      <if test="valueFlag != null and valueFlag != '' and valueFlag =='8'.toString()">
        and VALUE_FLAG in ('1','2')
      </if>
      <if test="productNo != null and productNo != ''">
        and PRODUCT_NO = #{productNo}
      </if>
      <if test="productName != null and productName != ''">
        and PRODUCT_NAME = #{productName}
      </if>
      <if test="gradeNo != null and gradeNo != ''">
        and GRADE_NO = #{gradeNo}
      </if>
      <if test="gradeName != null and gradeName != ''">
        and GRADE_NAME = #{gradeName}
      </if>
      <if test="standardNo != null and standardNo != ''">
        and STANDARD_NO = #{standardNo}
      </if>
      <if test="standardName != null and standardName != ''">
        and STANDARD_NAME = #{standardName}
      </if>
      <if test="packageNo != null and packageNo != ''">
        and PACKAGE_NO = #{packageNo}
      </if>
      <if test="blockNum != null and blockNum != ''">
        and BLOCK_NUM = #{blockNum}
      </if>
      <if test="productDate != null">
        and TO_CHAR(PRODUCT_DATE,'yyyy-MM-dd') = #{productDate}
      </if>
      <if test="sealNo != null and sealNo != ''">
        and SEAL_NO = #{sealNo}
      </if>
      <if test="bucketNo != null and bucketNo != ''">
        and BUCKET_NO = #{bucketNo}
      </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="forwardingUnitNo != null and forwardingUnitNo != ''">
        and FORWARDING_UNIT_NO = #{forwardingUnitNo}
      </if>
      <if test="forwardingUnitName != null and forwardingUnitName != ''">
        and FORWARDING_UNIT_NAME = #{forwardingUnitName}
      </if>
      <if test="receivingUintNo != null and receivingUintNo != ''">
        and RECEIVING_UINT_NO = #{receivingUintNo}
      </if>
      <if test="receivingUintName != null and receivingUintName != ''">
        and RECEIVING_UINT_NAME = #{receivingUintName}
      </if>
      <if test="specNo != null and specNo != ''">
        and SPEC_NO = #{specNo}
      </if>
      <if test="specName != null and specName != ''">
        and SPEC_NAME = #{specName}
      </if>
      <if test="createManNo != null and createManNo != ''">
        and CREATE_MAN_NO = #{createManNo}
      </if>
      <if test="createManName != null and createManName != ''">
        and CREATE_MAN_NAME = #{createManName}
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        and UPDATE_MAN_NO = #{updateManNo}
      </if>
      <if test="updateManName != null and updateManName != ''">
        and UPDATE_MAN_NAME = #{updateManName}
      </if>
      <if test="updateTime != null">
        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
      </if>
      <if test="deleteManNo != null and deleteManNo != ''">
        and DELETE_MAN_NO = #{deleteManNo}
      </if>
      <if test="deleteManName != null and deleteManName != ''">
        and DELETE_MAN_NAME = #{deleteManName}
      </if>
      <if test="deleteTime != null">
        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
      </if>
      <if test="heatNo != null and heatNo != ''">
        and HEAT_NO = #{heatNo}
      </if>
      <if test="heatNoMes != null and heatNoMes != ''">
        and HEAT_NO_MES = #{heatNoMes}
      </if>
      <if test="heatNoSeq != null and heatNoSeq != ''">
        and HEAT_NO_SEQ = #{heatNoSeq}
      </if>
      <if test="baseSpotNo != null and baseSpotNo != ''">
        and BASE_SPOT_NO = #{baseSpotNo}
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        and BASE_SPOT_NAME = #{baseSpotName}
      </if>
      <if test="meterClass != null and meterClass != ''">
        and METER_CLASS = #{meterClass}
      </if>
      <if test="meterGroup != null and meterGroup != ''">
        and METER_GROUP = #{meterGroup}
      </if>
      <if test="theoreticalWeight != null">
        and THEORETICAL_WEIGHT = #{theoreticalWeight}
      </if>
      <if test="weightDiff != null">
        and WEIGHT_DIFF = #{weightDiff}
      </if>
      <if test="unloadWharf != null and unloadWharf != ''">
        and UNLOAD_WHARF = #{unloadWharf}
      </if>
      <if test="orderNo != null and orderNo != ''">
        and ORDER_NO = #{orderNo,jdbcType=VARCHAR}
      </if>
      <if test="newMatName != null and newMatName != ''">
        and new_mat_name = #{newMatName,jdbcType=VARCHAR}
      </if>
      <if test="newGg != null and newGg != ''">
        and new_gg = #{newGg,jdbcType=VARCHAR}
      </if>
      <if test="newHlh != null and newHlh != ''">
        and new_hlh =#{newHlh,jdbcType=VARCHAR}
      </if>
      <if test="newSupplier != null and newSupplier != ''">
        and new_supplier =#{newSupplier,jdbcType=VARCHAR}
      </if>
    </where>
    order by CREATE_TIME desc
  </select>


  <select id="doQuerylike" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    SELECT <include refid="columns"/> from PRE_BELT_SCALE
    where  1=1
    <if test="startTime != null and startTime != ''">
      and CREATE_TIME between TO_DATE(#{startTime},'yyyy-MM-dd HH24:mi:ss') and TO_DATE(#{endTime},'yyyy-MM-dd HH24:mi:ss')
    </if>
    <if test="baseSpotName != null and baseSpotName != ''">
      and BASE_SPOT_NAME = #{baseSpotName}
    </if>
    <if test="valueFlag != null and valueFlag != ''">
      and VALUE_FLAG = #{valueFlag}
    </if>
    <if test="scaleName != null and scaleName != ''">
      and SCALE_NAME = #{scaleName}
    </if>
    <if test="productName != null and productName != ''">
      and PRODUCT_NAME LIKE '%${productName}%'
    </if>
    <if test="forwardingUnitName != null and forwardingUnitName != ''">
      and FORWARDING_UNIT_NAME LIKE '%${forwardingUnitName}%'
    </if>
    <if test="receivingUintName != null and receivingUintName != ''">
      and RECEIVING_UINT_NAME LIKE '%${receivingUintName}%'
    </if>
    <if test="shipNo != null and shipNo != ''">
      and SHIP_NO LIKE '%${shipNo}%'
    </if>
    <if test="orderNo != null and orderNo != ''">
      and ORDER_NO LIKE '%${orderNo}%'
    </if>
    <if test="newMatName != null and newMatName != ''">
      and new_mat_name LIKE '%${newMatName}%'
    </if>
    <if test="newGg != null and newGg != ''">
      and new_gg LIKE '%${newGg}%'
    </if>
    <if test="newHlh != null and newHlh != ''">
      and new_hlh LIKE '%${newHlh}%'
    </if>
    <if test="newSupplier != null and newSupplier != ''">
      and new_supplier LIKE '%${newSupplier}%'
    </if>
    order by CREATE_TIME desc
  </select>


  <update id="doUpdateFlags_0" parameterType="java.util.List">
    update  PRE_BELT_SCALE
    set VALUE_FLAG = '0'
    where PREDICTION_NO in
    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
      #{item.predictionNo,jdbcType=VARCHAR}
    </foreach>
  </update>
  <update id="doUpdateFlags_1" parameterType="java.util.List">
    update  PRE_BELT_SCALE
    set VALUE_FLAG = '1'
    where PREDICTION_NO in
    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
      #{item.predictionNo,jdbcType=VARCHAR}
    </foreach>
  </update>

  <!--迁移至定时服务-->
  <select id="PreScaleByMes" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    select t.plan_no PREDICTION_NO,
      t.factory RECEIVING_UINT_NAME,
      t.mat_name PRODUCT_NAME,
      t.supplier FORWARDING_UNIT_NAME,
      t.ship_no SHIP_NO,
      t.weight FORWARDING_WEIGHT,
      t.arrive_time OVERSTOCK,
      t.pier_no BASE_SPOT_NAME,
      t.discharge_time START_TIME,
      t.operator CREATE_MAN_NAME,
      t.operat_time CREATE_TIME,
      t.addtime UPDATE_TIME,
      t.note MEMO
      from JGWEIGHT_USER.CMM_STRAPPLAN t
      where t.send_flag ='1' and t.del_flag='0'
    <if test="startTime1 != null and startTime1 != ''">
      and t.operat_time between TO_DATE(#{startTime1},'yyyy-MM-dd HH24:mi:ss') and TO_DATE(#{endTime1},'yyyy-MM-dd HH24:mi:ss')
    </if>
    order by t.operat_time desc

  </select>

  <select id="doQueryByPredictionNo" parameterType="String" resultType="String">
    SELECT PREDICTION_NO from PRE_BELT_SCALE
    <where>
    <if test="predictionNo != null and predictionNo != ''">
      and PREDICTION_NO = #{predictionNo}
    </if>
    </where>
  </select>




  
</mapper>