<?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.meterworkstoragesinglewgt.mapper.MeterWorkStorageSingleWgtMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.meterwork.meterworkstoragesinglewgt.model.MeterWorkStorageSingleWgt">
    <id column="SINGLE_WGT_NO" jdbcType="VARCHAR" property="singleWgtNo" />
    <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="SINGLE_WEIGHT" jdbcType="DECIMAL" property="singleWeight" />
    <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="WEIGHT_TYPE" jdbcType="VARCHAR" property="weightType" />
    <result column="WEIGHT_DIFF" jdbcType="DECIMAL" property="weightDiff" />
  </resultMap>
  <sql id="columns">
    SINGLE_WGT_NO, BASE_SPOT_NO, BASE_SPOT_NAME, METER_CLASS, METER_GROUP, GRADE_NO, 
    GRADE_NAME, SPEC_NO, SPEC_NAME, SINGLE_WEIGHT, PRODUCT_DATE, VALUE_FLAG, MEMO, CREATE_MAN_NO, 
    CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, WEIGHT_TYPE, 
    WEIGHT_DIFF
  </sql>
  <sql id="columns_alias">
    t.SINGLE_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.SINGLE_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.WEIGHT_TYPE, t.WEIGHT_DIFF
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_WORK_STORAGE_SINGLE_WGT
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_WORK_STORAGE_SINGLE_WGT t
  </sql>
  <sql id="where">
    <where>
      <if test="singleWgtNo != null and singleWgtNo != ''">
        and SINGLE_WGT_NO = #{singleWgtNo}
      </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="singleWeight != null">
        and SINGLE_WEIGHT = #{singleWeight}
      </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="weightType != null and weightType != ''">
        and WEIGHT_TYPE = #{weightType}
      </if>
      <if test="weightDiff != null">
        and WEIGHT_DIFF = #{weightDiff}
      </if>
      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
        and  PRODUCT_DATE  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and PRODUCT_DATE  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
      </if>
      <if test="createTime1 != null and  createTime2 != null and  createTime1 != '' and createTime2 != ''">
        and  CREATE_TIME  >= TO_DATE(#{createTime1}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{createTime2}, 'yyyy-MM-dd HH24:mi:ss')
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where>
      <if test="singleWgtNo != null and singleWgtNo != ''">
        and SINGLE_WGT_NO LIKE '%${singleWgtNo}%'
      </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="singleWeight != null">
        and SINGLE_WEIGHT = #{singleWeight}
      </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="weightType != null and weightType != ''">
        and WEIGHT_TYPE LIKE '%${weightType}%'
      </if>
      <if test="weightDiff != null">
        and WEIGHT_DIFF = #{weightDiff}
      </if>
      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
        and  PRODUCT_DATE  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and PRODUCT_DATE  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
      </if>
      <if test="startTime != null and  endTime != null and  startTime != '' and endTime != ''">
        and  PRODUCT_DATE  >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and PRODUCT_DATE  &lt;=  TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
      </if>
      <if test="createTime1 != null and  createTime2 != null and  createTime1 != '' and createTime2 != ''">
        and  CREATE_TIME  >= TO_DATE(#{createTime1}, 'yyyy-MM-dd HH24:mi:ss') and CREATE_TIME  &lt;=  TO_DATE(#{createTime2}, 'yyyy-MM-dd HH24:mi:ss')
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_WORK_STORAGE_SINGLE_WGT
    where SINGLE_WGT_NO = #{singleWgtNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_WORK_STORAGE_SINGLE_WGT
    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="singleWeight != null">
      or SINGLE_WEIGHT = #{singleWeight}
    </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="weightType != null and weightType != ''">
      or WEIGHT_TYPE = #{weightType}
    </if>
    <if test="weightDiff != null">
      or WEIGHT_DIFF = #{weightDiff}
    </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.meterwork.meterworkstoragesinglewgt.model.MeterWorkStorageSingleWgt">
    insert into METER_WORK_STORAGE_SINGLE_WGT (SINGLE_WGT_NO, BASE_SPOT_NO, BASE_SPOT_NAME,
                                               METER_CLASS, METER_GROUP, GRADE_NO,
                                               GRADE_NAME, SPEC_NO, SPEC_NAME,
                                               SINGLE_WEIGHT, PRODUCT_DATE, VALUE_FLAG,
                                               MEMO, CREATE_MAN_NO, CREATE_MAN_NAME,
                                               CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME,
                                               UPDATE_TIME, WEIGHT_TYPE, WEIGHT_DIFF
    )
    values (#{singleWgtNo,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},
            #{singleWeight,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}, #{weightType,jdbcType=VARCHAR}, #{weightDiff,jdbcType=DECIMAL}
           )
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkstoragesinglewgt.model.MeterWorkStorageSingleWgt">
    insert into METER_WORK_STORAGE_SINGLE_WGT
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="singleWgtNo != null">
        SINGLE_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="singleWeight != null">
        SINGLE_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="weightType != null">
        WEIGHT_TYPE,
      </if>
      <if test="weightDiff != null">
        WEIGHT_DIFF,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="singleWgtNo != null">
        #{singleWgtNo,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="singleWeight != null">
        #{singleWeight,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="weightType != null">
        #{weightType,jdbcType=VARCHAR},
      </if>
      <if test="weightDiff != null">
        #{weightDiff,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.meterwork.meterworkstoragesinglewgt.model.MeterWorkStorageSingleWgt">
    update METER_WORK_STORAGE_SINGLE_WGT
    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},
        SINGLE_WEIGHT = #{singleWeight,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},
        WEIGHT_TYPE = #{weightType,jdbcType=VARCHAR},
        WEIGHT_DIFF = #{weightDiff,jdbcType=DECIMAL}
    where SINGLE_WGT_NO = #{singleWgtNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.meterwork.meterworkstoragesinglewgt.model.MeterWorkStorageSingleWgt">
    update METER_WORK_STORAGE_SINGLE_WGT
    <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="singleWeight != null">
        SINGLE_WEIGHT = #{singleWeight,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="weightType != null">
        WEIGHT_TYPE = #{weightType,jdbcType=VARCHAR},
      </if>
      <if test="weightDiff != null">
        WEIGHT_DIFF = #{weightDiff,jdbcType=DECIMAL},
      </if>
    </set>
    where SINGLE_WGT_NO = #{singleWgtNo,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where SINGLE_WGT_NO = #{singleWgtNo,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_SINGLE_WGT
    (SINGLE_WGT_NO,
    BASE_SPOT_NO, BASE_SPOT_NAME, METER_CLASS,
    METER_GROUP, GRADE_NO, GRADE_NAME,
    SPEC_NO, SPEC_NAME, SINGLE_WEIGHT,
    PRODUCT_DATE, VALUE_FLAG, MEMO,
    CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME,
    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME,
    WEIGHT_TYPE, WEIGHT_DIFF)
    ( <foreach collection="list" item="item" separator="union all">
    select
    #{item.singleWgtNo,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.singleWeight,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.weightType,jdbcType=VARCHAR}, #{item.weightDiff,jdbcType=DECIMAL} from dual
  </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
    update METER_WORK_STORAGE_SINGLE_WGT
    set
    SINGLE_WGT_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.singleWgtNo,jdbcType=VARCHAR}
    </foreach>
    ,BASE_SPOT_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
    </foreach>
    ,BASE_SPOT_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
    </foreach>
    ,METER_CLASS=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.meterClass,jdbcType=VARCHAR}
    </foreach>
    ,METER_GROUP=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.meterGroup,jdbcType=VARCHAR}
    </foreach>
    ,GRADE_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.gradeNo,jdbcType=VARCHAR}
    </foreach>
    ,GRADE_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.gradeName,jdbcType=VARCHAR}
    </foreach>
    ,SPEC_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.specNo,jdbcType=VARCHAR}
    </foreach>
    ,SPEC_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.specName,jdbcType=VARCHAR}
    </foreach>
    ,SINGLE_WEIGHT=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.singleWeight,jdbcType=DECIMAL}
    </foreach>
    ,PRODUCT_DATE=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.productDate,jdbcType=TIMESTAMP}
    </foreach>
    ,VALUE_FLAG=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.valueFlag,jdbcType=VARCHAR}
    </foreach>
    ,MEMO=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
    </foreach>
    ,CREATE_MAN_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
    </foreach>
    ,CREATE_MAN_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
    </foreach>
    ,CREATE_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
    </foreach>
    ,UPDATE_MAN_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
    </foreach>
    ,UPDATE_MAN_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
    </foreach>
    ,UPDATE_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
    </foreach>
    ,WEIGHT_TYPE=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.weightType,jdbcType=VARCHAR}
    </foreach>
    ,WEIGHT_DIFF=
    <foreach collection="list" item="item" index="index" separator=" " open="case SINGLE_WGT_NO" close="end">
      when #{item.singleWgtNo,jdbcType=VARCHAR} then #{item.weightDiff,jdbcType=DECIMAL}
    </foreach>
    where SINGLE_WGT_NO in
    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
      #{item.singleWgtNo,jdbcType=VARCHAR}
    </foreach>
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_WORK_STORAGE_SINGLE_WGT
    where SINGLE_WGT_NO in
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->

</mapper>