<?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.meterworkstoragecalibration.mapper.MeterWorkStorageCalibrationMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.meterwork.meterworkstoragecalibration.model.MeterWorkStorageCalibration">
    <id column="WGT_NO" jdbcType="VARCHAR" property="wgtNo" />
    <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="GRADE_NO" jdbcType="VARCHAR" property="gradeNo" />
    <result column="GRADE_NAME" jdbcType="VARCHAR" property="gradeName" />
    <result column="SPEC_NO" jdbcType="VARCHAR" property="specNo" />
    <result column="SPEC_NAME" jdbcType="VARCHAR" property="specName" />
    <result column="ACTUAL_WEIGHT" jdbcType="DECIMAL" property="actualWeight" />
    <result column="PRODUCT_DATE" jdbcType="TIMESTAMP" property="productDate" />
    <result column="VALUE_FLAG" jdbcType="VARCHAR" property="valueFlag" />
    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
    <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="THEORY_WEIGHT" jdbcType="DECIMAL" property="theoryWeight" />
    <result column="THEORY_WEIGHT_DIFF" jdbcType="DECIMAL" property="theoryWeightDiff" />
    <result column="QUALIFIED_FLAG" jdbcType="VARCHAR" property="qualifiedFlag" />
    <result column="ACTUAL_WEIGHT_DIFF" jdbcType="DECIMAL" property="actualWeightDiff" />
  </resultMap>
  <sql id="columns">
    WGT_NO, BASE_SPOT_NO, BASE_SPOT_NAME, METER_CLASS, METER_GROUP, GRADE_NO, GRADE_NAME, 
    SPEC_NO, SPEC_NAME, ACTUAL_WEIGHT, PRODUCT_DATE, VALUE_FLAG, MEMO, CREATE_MAN_NO, 
    CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, THEORY_WEIGHT, 
    THEORY_WEIGHT_DIFF, QUALIFIED_FLAG, ACTUAL_WEIGHT_DIFF
  </sql>
  <sql id="columns_alias">
    t.WGT_NO, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.METER_CLASS, t.METER_GROUP, t.GRADE_NO, 
    t.GRADE_NAME, t.SPEC_NO, t.SPEC_NAME, t.ACTUAL_WEIGHT, t.PRODUCT_DATE, t.VALUE_FLAG, 
    t.MEMO, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, 
    t.UPDATE_TIME, t.THEORY_WEIGHT, t.THEORY_WEIGHT_DIFF, t.QUALIFIED_FLAG, t.ACTUAL_WEIGHT_DIFF
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_WORK_STORAGE_CALIBRATION
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_WORK_STORAGE_CALIBRATION t
  </sql>
  <sql id="where">
    <where> 
      <if test="wgtNo != null and wgtNo != ''">
        and WGT_NO = #{wgtNo}
      </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="gradeNo != null and gradeNo != ''">
        and GRADE_NO = #{gradeNo}
      </if>
      <if test="gradeName != null and gradeName != ''">
        and GRADE_NAME = #{gradeName}
      </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="actualWeight != null">
        and ACTUAL_WEIGHT = #{actualWeight}
      </if>
      <if test="productDate != null">
        and TO_CHAR(PRODUCT_DATE,'yyyy-MM-dd') = #{productDate}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        and VALUE_FLAG = #{valueFlag}
      </if>
      <if test="memo != null and memo != ''">
        and MEMO = #{memo}
      </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="theoryWeight != null">
        and THEORY_WEIGHT = #{theoryWeight}
      </if>
      <if test="theoryWeightDiff != null">
        and THEORY_WEIGHT_DIFF = #{theoryWeightDiff}
      </if>
      <if test="qualifiedFlag != null and qualifiedFlag != ''">
        and QUALIFIED_FLAG = #{qualifiedFlag}
      </if>
      <if test="actualWeightDiff != null">
        and ACTUAL_WEIGHT_DIFF = #{actualWeightDiff}
      </if>
      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
      </if>
    </where>

  </sql>
  <sql id="whereLike">
    <where> 
      <if test="wgtNo != null and wgtNo != ''">
        and WGT_NO LIKE '%${wgtNo}%'
      </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="gradeNo != null and gradeNo != ''">
        and GRADE_NO LIKE '%${gradeNo}%'
      </if>
      <if test="gradeName != null and gradeName != ''">
        and GRADE_NAME LIKE '%${gradeName}%'
      </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="actualWeight != null">
        and ACTUAL_WEIGHT = #{actualWeight}
      </if>
      <if test="productDate != null">
        and TO_CHAR(PRODUCT_DATE,'yyyy-MM-dd') = #{productDate}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        and VALUE_FLAG LIKE '%${valueFlag}%'
      </if>
      <if test="memo != null and memo != ''">
        and MEMO LIKE '%${memo}%'
      </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="theoryWeight != null">
        and THEORY_WEIGHT = #{theoryWeight}
      </if>
      <if test="theoryWeightDiff != null">
        and THEORY_WEIGHT_DIFF = #{theoryWeightDiff}
      </if>
      <if test="qualifiedFlag != null and qualifiedFlag != ''">
        and QUALIFIED_FLAG LIKE '%${qualifiedFlag}%'
      </if>
      <if test="actualWeightDiff != null">
        and ACTUAL_WEIGHT_DIFF = #{actualWeightDiff}
      </if>
      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
        and  CREATE_TIME  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_WORK_STORAGE_CALIBRATION
    where WGT_NO = #{wgtNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_WORK_STORAGE_CALIBRATION
    where 1!=1 
      <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="gradeNo != null and gradeNo != ''">
        or GRADE_NO = #{gradeNo}
      </if>
      <if test="gradeName != null and gradeName != ''">
        or GRADE_NAME = #{gradeName}
      </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="actualWeight != null">
        or ACTUAL_WEIGHT = #{actualWeight}
      </if>
      <if test="productDate != null">
        or TO_CHAR(PRODUCT_DATE,'yyyy-MM-dd') = '#{productDate}'
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        or VALUE_FLAG = #{valueFlag}
      </if>
      <if test="memo != null and memo != ''">
        or MEMO = #{memo}
      </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="theoryWeight != null">
        or THEORY_WEIGHT = #{theoryWeight}
      </if>
      <if test="theoryWeightDiff != null">
        or THEORY_WEIGHT_DIFF = #{theoryWeightDiff}
      </if>
      <if test="qualifiedFlag != null and qualifiedFlag != ''">
        or QUALIFIED_FLAG = #{qualifiedFlag}
      </if>
      <if test="actualWeightDiff != null">
        or ACTUAL_WEIGHT_DIFF = #{actualWeightDiff}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.meterwork.meterworkstoragecalibration.model.MeterWorkStorageCalibration">
    insert into METER_WORK_STORAGE_CALIBRATION (WGT_NO, BASE_SPOT_NO, BASE_SPOT_NAME, 
      METER_CLASS, METER_GROUP, GRADE_NO, 
      GRADE_NAME, SPEC_NO, SPEC_NAME, 
      ACTUAL_WEIGHT, PRODUCT_DATE, VALUE_FLAG, 
      MEMO, CREATE_MAN_NO, CREATE_MAN_NAME, 
      CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
      UPDATE_TIME, THEORY_WEIGHT, THEORY_WEIGHT_DIFF, 
      QUALIFIED_FLAG, ACTUAL_WEIGHT_DIFF)
    values (#{wgtNo,jdbcType=VARCHAR}, #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR}, 
      #{meterClass,jdbcType=VARCHAR}, #{meterGroup,jdbcType=VARCHAR}, #{gradeNo,jdbcType=VARCHAR}, 
      #{gradeName,jdbcType=VARCHAR}, #{specNo,jdbcType=VARCHAR}, #{specName,jdbcType=VARCHAR}, 
      #{actualWeight,jdbcType=DECIMAL}, #{productDate,jdbcType=TIMESTAMP}, #{valueFlag,jdbcType=VARCHAR}, 
      #{memo,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{theoryWeight,jdbcType=DECIMAL}, #{theoryWeightDiff,jdbcType=DECIMAL}, 
      #{qualifiedFlag,jdbcType=VARCHAR}, #{actualWeightDiff,jdbcType=DECIMAL})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkstoragecalibration.model.MeterWorkStorageCalibration">
    insert into METER_WORK_STORAGE_CALIBRATION
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="wgtNo != null">
        WGT_NO,
      </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="gradeNo != null">
        GRADE_NO,
      </if>
      <if test="gradeName != null">
        GRADE_NAME,
      </if>
      <if test="specNo != null">
        SPEC_NO,
      </if>
      <if test="specName != null">
        SPEC_NAME,
      </if>
      <if test="actualWeight != null">
        ACTUAL_WEIGHT,
      </if>
      <if test="productDate != null">
        PRODUCT_DATE,
      </if>
      <if test="valueFlag != null">
        VALUE_FLAG,
      </if>
      <if test="memo != null">
        MEMO,
      </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="theoryWeight != null">
        THEORY_WEIGHT,
      </if>
      <if test="theoryWeightDiff != null">
        THEORY_WEIGHT_DIFF,
      </if>
      <if test="qualifiedFlag != null">
        QUALIFIED_FLAG,
      </if>
      <if test="actualWeightDiff != null">
        ACTUAL_WEIGHT_DIFF,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="wgtNo != null">
        #{wgtNo,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="gradeNo != null">
        #{gradeNo,jdbcType=VARCHAR},
      </if>
      <if test="gradeName != null">
        #{gradeName,jdbcType=VARCHAR},
      </if>
      <if test="specNo != null">
        #{specNo,jdbcType=VARCHAR},
      </if>
      <if test="specName != null">
        #{specName,jdbcType=VARCHAR},
      </if>
      <if test="actualWeight != null">
        #{actualWeight,jdbcType=DECIMAL},
      </if>
      <if test="productDate != null">
        #{productDate,jdbcType=TIMESTAMP},
      </if>
      <if test="valueFlag != null">
        #{valueFlag,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        #{memo,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="theoryWeight != null">
        #{theoryWeight,jdbcType=DECIMAL},
      </if>
      <if test="theoryWeightDiff != null">
        #{theoryWeightDiff,jdbcType=DECIMAL},
      </if>
      <if test="qualifiedFlag != null">
        #{qualifiedFlag,jdbcType=VARCHAR},
      </if>
      <if test="actualWeightDiff != null">
        #{actualWeightDiff,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.meterwork.meterworkstoragecalibration.model.MeterWorkStorageCalibration">
    update METER_WORK_STORAGE_CALIBRATION
    set BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
      BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
      METER_CLASS = #{meterClass,jdbcType=VARCHAR},
      METER_GROUP = #{meterGroup,jdbcType=VARCHAR},
      GRADE_NO = #{gradeNo,jdbcType=VARCHAR},
      GRADE_NAME = #{gradeName,jdbcType=VARCHAR},
      SPEC_NO = #{specNo,jdbcType=VARCHAR},
      SPEC_NAME = #{specName,jdbcType=VARCHAR},
      ACTUAL_WEIGHT = #{actualWeight,jdbcType=DECIMAL},
      PRODUCT_DATE = #{productDate,jdbcType=TIMESTAMP},
      VALUE_FLAG = #{valueFlag,jdbcType=VARCHAR},
      MEMO = #{memo,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},
      THEORY_WEIGHT = #{theoryWeight,jdbcType=DECIMAL},
      THEORY_WEIGHT_DIFF = #{theoryWeightDiff,jdbcType=DECIMAL},
      QUALIFIED_FLAG = #{qualifiedFlag,jdbcType=VARCHAR},
      ACTUAL_WEIGHT_DIFF = #{actualWeightDiff,jdbcType=DECIMAL}
    where WGT_NO = #{wgtNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.meterwork.meterworkstoragecalibration.model.MeterWorkStorageCalibration">
    update METER_WORK_STORAGE_CALIBRATION
    <set>
      <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="gradeNo != null">
        GRADE_NO = #{gradeNo,jdbcType=VARCHAR},
      </if>
      <if test="gradeName != null">
        GRADE_NAME = #{gradeName,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="actualWeight != null">
        ACTUAL_WEIGHT = #{actualWeight,jdbcType=DECIMAL},
      </if>
      <if test="productDate != null">
        PRODUCT_DATE = #{productDate,jdbcType=TIMESTAMP},
      </if>
      <if test="valueFlag != null">
        VALUE_FLAG = #{valueFlag,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        MEMO = #{memo,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="theoryWeight != null">
        THEORY_WEIGHT = #{theoryWeight,jdbcType=DECIMAL},
      </if>
      <if test="theoryWeightDiff != null">
        THEORY_WEIGHT_DIFF = #{theoryWeightDiff,jdbcType=DECIMAL},
      </if>
      <if test="qualifiedFlag != null">
        QUALIFIED_FLAG = #{qualifiedFlag,jdbcType=VARCHAR},
      </if>
      <if test="actualWeightDiff != null">
        ACTUAL_WEIGHT_DIFF = #{actualWeightDiff,jdbcType=DECIMAL},
      </if>
    </set>
    where WGT_NO = #{wgtNo,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where WGT_NO = #{wgtNo,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="where"/>
    order by CREATE_TIME desc
  </select>
  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="whereLike"/>
    order by CREATE_TIME desc
  </select>
  <insert id="batchInsert" parameterType="java.util.List">
    insert into METER_WORK_STORAGE_CALIBRATION 
      (WGT_NO, 
      BASE_SPOT_NO, BASE_SPOT_NAME, METER_CLASS, 
      METER_GROUP, GRADE_NO, GRADE_NAME, 
      SPEC_NO, SPEC_NAME, ACTUAL_WEIGHT, 
      PRODUCT_DATE, VALUE_FLAG, MEMO, 
      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
      THEORY_WEIGHT, THEORY_WEIGHT_DIFF, 
      QUALIFIED_FLAG, ACTUAL_WEIGHT_DIFF
      )
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.wgtNo,jdbcType=VARCHAR}, 
      #{item.baseSpotNo,jdbcType=VARCHAR}, #{item.baseSpotName,jdbcType=VARCHAR}, #{item.meterClass,jdbcType=VARCHAR}, 
      #{item.meterGroup,jdbcType=VARCHAR}, #{item.gradeNo,jdbcType=VARCHAR}, #{item.gradeName,jdbcType=VARCHAR}, 
      #{item.specNo,jdbcType=VARCHAR}, #{item.specName,jdbcType=VARCHAR}, #{item.actualWeight,jdbcType=DECIMAL}, 
      #{item.productDate,jdbcType=TIMESTAMP}, #{item.valueFlag,jdbcType=VARCHAR}, #{item.memo,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.theoryWeight,jdbcType=DECIMAL}, #{item.theoryWeightDiff,jdbcType=DECIMAL}, 
      #{item.qualifiedFlag,jdbcType=VARCHAR}, #{item.actualWeightDiff,jdbcType=DECIMAL}
       from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update METER_WORK_STORAGE_CALIBRATION
     set
       WGT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.wgtNo,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
       </foreach>
       ,METER_CLASS=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.meterClass,jdbcType=VARCHAR}
       </foreach>
       ,METER_GROUP=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.meterGroup,jdbcType=VARCHAR}
       </foreach>
       ,GRADE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.gradeNo,jdbcType=VARCHAR}
       </foreach>
       ,GRADE_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.gradeName,jdbcType=VARCHAR}
       </foreach>
       ,SPEC_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.specNo,jdbcType=VARCHAR}
       </foreach>
       ,SPEC_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.specName,jdbcType=VARCHAR}
       </foreach>
       ,ACTUAL_WEIGHT=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.actualWeight,jdbcType=DECIMAL}
       </foreach>
       ,PRODUCT_DATE=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.productDate,jdbcType=TIMESTAMP}
       </foreach>
       ,VALUE_FLAG=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.valueFlag,jdbcType=VARCHAR}
       </foreach>
       ,MEMO=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
       </foreach>
       ,UPDATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
       </foreach>
       ,THEORY_WEIGHT=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.theoryWeight,jdbcType=DECIMAL}
       </foreach>
       ,THEORY_WEIGHT_DIFF=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.theoryWeightDiff,jdbcType=DECIMAL}
       </foreach>
       ,QUALIFIED_FLAG=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.qualifiedFlag,jdbcType=VARCHAR}
       </foreach>
       ,ACTUAL_WEIGHT_DIFF=
       <foreach collection="list" item="item" index="index" separator=" " open="case WGT_NO" close="end">
          when #{item.wgtNo,jdbcType=VARCHAR} then #{item.actualWeightDiff,jdbcType=DECIMAL}
       </foreach>
     where WGT_NO in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.wgtNo,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_WORK_STORAGE_CALIBRATION
    where WGT_NO in 
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->
  
</mapper>