<?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.meterworkgrabactual.mapper.MeterWorkGrabActualMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.meterwork.meterworkgrabactual.model.MeterWorkGrabActual">
    <id column="ACTUAL_NO" jdbcType="VARCHAR" property="actualNo" />
    <result column="DATA_HCH" jdbcType="VARCHAR" property="dataHch" />
    <result column="DATA_TIME" jdbcType="TIMESTAMP" property="dataTime" />
    <result column="DATA_TYPE" jdbcType="VARCHAR" property="dataType" />
    <result column="DATA_AREA" jdbcType="VARCHAR" property="dataArea" />
    <result column="GROSS_WEIGHT" jdbcType="DECIMAL" property="grossWeight" />
    <result column="TARE_WEIGHT" jdbcType="DECIMAL" property="tareWeight" />
    <result column="NET_WEIGHT" jdbcType="DECIMAL" property="netWeight" />
    <result column="METER_CLASS" jdbcType="VARCHAR" property="meterClass" />
    <result column="METER_GROUP" jdbcType="VARCHAR" property="meterGroup" />
    <result column="METER_OPERATOR" jdbcType="VARCHAR" property="meterOperator" />
    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
    <result column="KOZA" jdbcType="DECIMAL" property="koza" />
    <result column="WET_WEIGHT" jdbcType="DECIMAL" property="wetWeight" />
    <result column="WATER" jdbcType="DECIMAL" property="water" />
    <result column="DRY_WEIGHT" jdbcType="DECIMAL" property="dryWeight" />
    <result column="NI_WEIGHT" jdbcType="DECIMAL" property="niWeight" />
    <result column="CO_WEIGHT" jdbcType="DECIMAL" property="coWeight" />
    <result column="CU_WEIGHT" jdbcType="DECIMAL" property="cuWeight" />
    <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="STORE_NAME" jdbcType="VARCHAR" property="storeName" />
    <result column="VALID_FLAG" jdbcType="VARCHAR" property="validFlag" />
  </resultMap>
  <sql id="columns">
    ACTUAL_NO, DATA_HCH, DATA_TIME, DATA_TYPE, DATA_AREA, GROSS_WEIGHT, TARE_WEIGHT, 
    NET_WEIGHT, METER_CLASS, METER_GROUP, METER_OPERATOR, MEMO, KOZA, WET_WEIGHT, WATER, 
    DRY_WEIGHT, NI_WEIGHT, CO_WEIGHT, CU_WEIGHT, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, STORE_NAME, VALID_FLAG
  </sql>
  <sql id="columns_alias">
    t.ACTUAL_NO, t.DATA_HCH, t.DATA_TIME, t.DATA_TYPE, t.DATA_AREA, t.GROSS_WEIGHT, t.TARE_WEIGHT, 
    t.NET_WEIGHT, t.METER_CLASS, t.METER_GROUP, t.METER_OPERATOR, t.MEMO, t.KOZA, t.WET_WEIGHT, 
    t.WATER, t.DRY_WEIGHT, t.NI_WEIGHT, t.CO_WEIGHT, t.CU_WEIGHT, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, 
    t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME, t.STORE_NAME, t.VALID_FLAG
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_WORK_GRAB_ACTUAL
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_WORK_GRAB_ACTUAL t
  </sql>
  <sql id="where">
    <where>
      <if test="actualNo != null and actualNo != ''">
        and ACTUAL_NO = #{actualNo}
      </if>
      <if test="dataHch != null and dataHch != ''">
        and DATA_HCH = #{dataHch}
      </if>
      <if test="dataTime != null">
        and DATA_TIME = to_date(#{dataTime},'yyyy-MM-dd HH24:mi:ss')
      </if>
      <if test="dataType != null and dataType != ''">
        and DATA_TYPE = #{dataType}
      </if>
      <if test="dataArea != null and dataArea != ''">
        and DATA_AREA = #{dataArea}
      </if>
      <if test="grossWeight != null">
        and GROSS_WEIGHT = #{grossWeight}
      </if>
      <if test="tareWeight != null">
        and TARE_WEIGHT = #{tareWeight}
      </if>
      <if test="netWeight != null">
        and NET_WEIGHT = #{netWeight}
      </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="meterOperator != null and meterOperator != ''">
        and METER_OPERATOR = #{meterOperator}
      </if>
      <if test="memo != null and memo != ''">
        and MEMO = #{memo}
      </if>
      <if test="koza != null">
        and KOZA = #{koza}
      </if>
      <if test="wetWeight != null">
        and WET_WEIGHT = #{wetWeight}
      </if>
      <if test="water != null">
        and WATER = #{water}
      </if>
      <if test="dryWeight != null">
        and DRY_WEIGHT = #{dryWeight}
      </if>
      <if test="niWeight != null">
        and NI_WEIGHT = #{niWeight}
      </if>
      <if test="coWeight != null">
        and CO_WEIGHT = #{coWeight}
      </if>
      <if test="cuWeight != null">
        and CU_WEIGHT = #{cuWeight}
      </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="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != ''">
        and  DATA_TIME  >= TO_DATE(#{createTime1}, 'yyyy-MM-dd HH24:mi:ss') and DATA_TIME  &lt;=  TO_DATE(#{createTime2}, 'yyyy-MM-dd HH24:mi:ss')
      </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="storeName != null and storeName != ''">
        and STORE_NAME = #{storeName}
      </if>
      <if test="validFlag != null and validFlag != ''">
        and VALID_FLAG = #{validFlag}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where>
      <if test="actualNo != null and actualNo != ''">
        and ACTUAL_NO LIKE '%${actualNo}%'
      </if>
      <if test="dataHch != null and dataHch != ''">
        and DATA_HCH LIKE '%${dataHch}%'
      </if>
      <if test="dataTime != null">
        and DATA_TIME =  to_date(#{datetime},'yyyy-MM-dd HH24:mi:ss')
      </if>
      <if test="dataType != null and dataType != ''">
        and DATA_TYPE LIKE '%${dataType}%'
      </if>
      <if test="dataArea != null and dataArea != ''">
        and DATA_AREA LIKE '%${dataArea}%'
      </if>
      <if test="grossWeight != null">
        and GROSS_WEIGHT = #{grossWeight}
      </if>
      <if test="tareWeight != null">
        and TARE_WEIGHT = #{tareWeight}
      </if>
      <if test="netWeight != null">
        and NET_WEIGHT = #{netWeight}
      </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="meterOperator != null and meterOperator != ''">
        and METER_OPERATOR LIKE '%${meterOperator}%'
      </if>
      <if test="memo != null and memo != ''">
        and MEMO LIKE '%${memo}%'
      </if>
      <if test="koza != null">
        and KOZA = #{koza}
      </if>
      <if test="wetWeight != null">
        and WET_WEIGHT = #{wetWeight}
      </if>
      <if test="water != null">
        and WATER = #{water}
      </if>
      <if test="dryWeight != null">
        and DRY_WEIGHT = #{dryWeight}
      </if>
      <if test="niWeight != null">
        and NI_WEIGHT = #{niWeight}
      </if>
      <if test="coWeight != null">
        and CO_WEIGHT = #{coWeight}
      </if>
      <if test="cuWeight != null">
        and CU_WEIGHT = #{cuWeight}
      </if>
      <if test="createManNo != null and createManNo != ''">
        and CREATE_MAN_NO LIKE '%${createManNo}%'
      </if>
      <if test="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != ''">
        and  DATA_TIME  >= TO_DATE(#{createTime1}, 'yyyy-MM-dd HH24:mi:ss') and DATA_TIME  &lt;=  TO_DATE(#{createTime2}, 'yyyy-MM-dd HH24:mi:ss')
      </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="storeName != null and storeName != ''">
        and STORE_NAME LIKE '%${storeName}%'
      </if>
      <if test="validFlag != null and validFlag != ''">
        and VALID_FLAG LIKE '%${validFlag}%'
      </if> ORDER BY DATA_TIME DESC
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_WORK_GRAB_ACTUAL
    where ACTUAL_NO = #{actualNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_WORK_GRAB_ACTUAL
    where 1!=1
    <if test="dataHch != null and dataHch != ''">
      or DATA_HCH = #{dataHch}
    </if>
    <if test="dataTime != null">
      or TO_CHAR(DATA_TIME,'yyyy-MM-dd') = '#{dataTime}'
    </if>
    <if test="dataType != null and dataType != ''">
      or DATA_TYPE = #{dataType}
    </if>
    <if test="dataArea != null and dataArea != ''">
      or DATA_AREA = #{dataArea}
    </if>
    <if test="grossWeight != null">
      or GROSS_WEIGHT = #{grossWeight}
    </if>
    <if test="tareWeight != null">
      or TARE_WEIGHT = #{tareWeight}
    </if>
    <if test="netWeight != null">
      or NET_WEIGHT = #{netWeight}
    </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="meterOperator != null and meterOperator != ''">
      or METER_OPERATOR = #{meterOperator}
    </if>
    <if test="memo != null and memo != ''">
      or MEMO = #{memo}
    </if>
    <if test="koza != null">
      or KOZA = #{koza}
    </if>
    <if test="wetWeight != null">
      or WET_WEIGHT = #{wetWeight}
    </if>
    <if test="water != null">
      or WATER = #{water}
    </if>
    <if test="dryWeight != null">
      or DRY_WEIGHT = #{dryWeight}
    </if>
    <if test="niWeight != null">
      or NI_WEIGHT = #{niWeight}
    </if>
    <if test="coWeight != null">
      or CO_WEIGHT = #{coWeight}
    </if>
    <if test="cuWeight != null">
      or CU_WEIGHT = #{cuWeight}
    </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="storeName != null and storeName != ''">
      or STORE_NAME = #{storeName}
    </if>
    <if test="validFlag != null and validFlag != ''">
      or VALID_FLAG = #{validFlag}
    </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.meterwork.meterworkgrabactual.model.MeterWorkGrabActual">
    insert into METER_WORK_GRAB_ACTUAL (ACTUAL_NO, DATA_HCH, DATA_TIME,
                                        DATA_TYPE, DATA_AREA, GROSS_WEIGHT,
                                        TARE_WEIGHT, NET_WEIGHT, METER_CLASS,
                                        METER_GROUP, METER_OPERATOR, MEMO,
                                        KOZA, WET_WEIGHT, WATER,
                                        DRY_WEIGHT, NI_WEIGHT, CO_WEIGHT,
                                        CU_WEIGHT, CREATE_MAN_NO, CREATE_MAN_NAME,
                                        CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME,
                                        UPDATE_TIME, STORE_NAME, VALID_FLAG
    )
    values (#{actualNo,jdbcType=VARCHAR}, #{dataHch,jdbcType=VARCHAR}, #{dataTime,jdbcType=TIMESTAMP},
            #{dataType,jdbcType=VARCHAR}, #{dataArea,jdbcType=VARCHAR}, #{grossWeight,jdbcType=DECIMAL},
            #{tareWeight,jdbcType=DECIMAL}, #{netWeight,jdbcType=DECIMAL}, #{meterClass,jdbcType=VARCHAR},
            #{meterGroup,jdbcType=VARCHAR}, #{meterOperator,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR},
            #{koza,jdbcType=DECIMAL}, #{wetWeight,jdbcType=DECIMAL}, #{water,jdbcType=DECIMAL},
            #{dryWeight,jdbcType=DECIMAL}, #{niWeight,jdbcType=DECIMAL}, #{coWeight,jdbcType=DECIMAL},
            #{cuWeight,jdbcType=DECIMAL}, #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR},
            #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR},
            #{updateTime,jdbcType=TIMESTAMP}, #{storeName,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR}
           )
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkgrabactual.model.MeterWorkGrabActual">
    insert into METER_WORK_GRAB_ACTUAL
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="actualNo != null">
        ACTUAL_NO,
      </if>
      <if test="dataHch != null">
        DATA_HCH,
      </if>
      <if test="dataTime != null">
        DATA_TIME,
      </if>
      <if test="dataType != null">
        DATA_TYPE,
      </if>
      <if test="dataArea != null">
        DATA_AREA,
      </if>
      <if test="grossWeight != null">
        GROSS_WEIGHT,
      </if>
      <if test="tareWeight != null">
        TARE_WEIGHT,
      </if>
      <if test="netWeight != null">
        NET_WEIGHT,
      </if>
      <if test="meterClass != null">
        METER_CLASS,
      </if>
      <if test="meterGroup != null">
        METER_GROUP,
      </if>
      <if test="meterOperator != null">
        METER_OPERATOR,
      </if>
      <if test="memo != null">
        MEMO,
      </if>
      <if test="koza != null">
        KOZA,
      </if>
      <if test="wetWeight != null">
        WET_WEIGHT,
      </if>
      <if test="water != null">
        WATER,
      </if>
      <if test="dryWeight != null">
        DRY_WEIGHT,
      </if>
      <if test="niWeight != null">
        NI_WEIGHT,
      </if>
      <if test="coWeight != null">
        CO_WEIGHT,
      </if>
      <if test="cuWeight != null">
        CU_WEIGHT,
      </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="storeName != null">
        STORE_NAME,
      </if>
      <if test="validFlag != null">
        VALID_FLAG,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="actualNo != null">
        #{actualNo,jdbcType=VARCHAR},
      </if>
      <if test="dataHch != null">
        #{dataHch,jdbcType=VARCHAR},
      </if>
      <if test="dataTime != null">
        #{dataTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dataType != null">
        #{dataType,jdbcType=VARCHAR},
      </if>
      <if test="dataArea != null">
        #{dataArea,jdbcType=VARCHAR},
      </if>
      <if test="grossWeight != null">
        #{grossWeight,jdbcType=DECIMAL},
      </if>
      <if test="tareWeight != null">
        #{tareWeight,jdbcType=DECIMAL},
      </if>
      <if test="netWeight != null">
        #{netWeight,jdbcType=DECIMAL},
      </if>
      <if test="meterClass != null">
        #{meterClass,jdbcType=VARCHAR},
      </if>
      <if test="meterGroup != null">
        #{meterGroup,jdbcType=VARCHAR},
      </if>
      <if test="meterOperator != null">
        #{meterOperator,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        #{memo,jdbcType=VARCHAR},
      </if>
      <if test="koza != null">
        #{koza,jdbcType=DECIMAL},
      </if>
      <if test="wetWeight != null">
        #{wetWeight,jdbcType=DECIMAL},
      </if>
      <if test="water != null">
        #{water,jdbcType=DECIMAL},
      </if>
      <if test="dryWeight != null">
        #{dryWeight,jdbcType=DECIMAL},
      </if>
      <if test="niWeight != null">
        #{niWeight,jdbcType=DECIMAL},
      </if>
      <if test="coWeight != null">
        #{coWeight,jdbcType=DECIMAL},
      </if>
      <if test="cuWeight != null">
        #{cuWeight,jdbcType=DECIMAL},
      </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="storeName != null">
        #{storeName,jdbcType=VARCHAR},
      </if>
      <if test="validFlag != null">
        #{validFlag,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.meterwork.meterworkgrabactual.model.MeterWorkGrabActual">
    update METER_WORK_GRAB_ACTUAL
    set DATA_HCH = #{dataHch,jdbcType=VARCHAR},
        DATA_TIME = #{dataTime,jdbcType=TIMESTAMP},
        DATA_TYPE = #{dataType,jdbcType=VARCHAR},
        DATA_AREA = #{dataArea,jdbcType=VARCHAR},
        GROSS_WEIGHT = #{grossWeight,jdbcType=DECIMAL},
        TARE_WEIGHT = #{tareWeight,jdbcType=DECIMAL},
        NET_WEIGHT = #{netWeight,jdbcType=DECIMAL},
        METER_CLASS = #{meterClass,jdbcType=VARCHAR},
        METER_GROUP = #{meterGroup,jdbcType=VARCHAR},
        METER_OPERATOR = #{meterOperator,jdbcType=VARCHAR},
        MEMO = #{memo,jdbcType=VARCHAR},
        KOZA = #{koza,jdbcType=DECIMAL},
        WET_WEIGHT = #{wetWeight,jdbcType=DECIMAL},
        WATER = #{water,jdbcType=DECIMAL},
        DRY_WEIGHT = #{dryWeight,jdbcType=DECIMAL},
        NI_WEIGHT = #{niWeight,jdbcType=DECIMAL},
        CO_WEIGHT = #{coWeight,jdbcType=DECIMAL},
        CU_WEIGHT = #{cuWeight,jdbcType=DECIMAL},
        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},
        STORE_NAME = #{storeName,jdbcType=VARCHAR},
        VALID_FLAG = #{validFlag,jdbcType=VARCHAR}
    where ACTUAL_NO = #{actualNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.meterwork.meterworkgrabactual.model.MeterWorkGrabActual">
    update METER_WORK_GRAB_ACTUAL
    <set>
      <if test="dataHch != null">
        DATA_HCH = #{dataHch,jdbcType=VARCHAR},
      </if>
      <if test="dataTime != null">
        DATA_TIME = #{dataTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dataType != null">
        DATA_TYPE = #{dataType,jdbcType=VARCHAR},
      </if>
      <if test="dataArea != null">
        DATA_AREA = #{dataArea,jdbcType=VARCHAR},
      </if>
      <if test="grossWeight != null">
        GROSS_WEIGHT = #{grossWeight,jdbcType=DECIMAL},
      </if>
      <if test="tareWeight != null">
        TARE_WEIGHT = #{tareWeight,jdbcType=DECIMAL},
      </if>
      <if test="netWeight != null">
        NET_WEIGHT = #{netWeight,jdbcType=DECIMAL},
      </if>
      <if test="meterClass != null">
        METER_CLASS = #{meterClass,jdbcType=VARCHAR},
      </if>
      <if test="meterGroup != null">
        METER_GROUP = #{meterGroup,jdbcType=VARCHAR},
      </if>
      <if test="meterOperator != null">
        METER_OPERATOR = #{meterOperator,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        MEMO = #{memo,jdbcType=VARCHAR},
      </if>
      <if test="koza != null">
        KOZA = #{koza,jdbcType=DECIMAL},
      </if>
      <if test="wetWeight != null">
        WET_WEIGHT = #{wetWeight,jdbcType=DECIMAL},
      </if>
      <if test="water != null">
        WATER = #{water,jdbcType=DECIMAL},
      </if>
      <if test="dryWeight != null">
        DRY_WEIGHT = #{dryWeight,jdbcType=DECIMAL},
      </if>
      <if test="niWeight != null">
        NI_WEIGHT = #{niWeight,jdbcType=DECIMAL},
      </if>
      <if test="coWeight != null">
        CO_WEIGHT = #{coWeight,jdbcType=DECIMAL},
      </if>
      <if test="cuWeight != null">
        CU_WEIGHT = #{cuWeight,jdbcType=DECIMAL},
      </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="storeName != null">
        STORE_NAME = #{storeName,jdbcType=VARCHAR},
      </if>
      <if test="validFlag != null">
        VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
      </if>
    </set>
    where ACTUAL_NO = #{actualNo,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where ACTUAL_NO = #{actualNo,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 METER_WORK_GRAB_ACTUAL
    (ACTUAL_NO,
    DATA_HCH, DATA_TIME, DATA_TYPE,
    DATA_AREA, GROSS_WEIGHT, TARE_WEIGHT,
    NET_WEIGHT, METER_CLASS, METER_GROUP,
    METER_OPERATOR, MEMO, KOZA,
    WET_WEIGHT, WATER, DRY_WEIGHT,
    NI_WEIGHT, CO_WEIGHT, CU_WEIGHT,
    CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME,
    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME,
    STORE_NAME, VALID_FLAG)
    ( <foreach collection="list" item="item" separator="union all">
    select
    #{item.actualNo,jdbcType=VARCHAR},
    #{item.dataHch,jdbcType=VARCHAR}, #{item.dataTime,jdbcType=TIMESTAMP}, #{item.dataType,jdbcType=VARCHAR},
    #{item.dataArea,jdbcType=VARCHAR}, #{item.grossWeight,jdbcType=DECIMAL}, #{item.tareWeight,jdbcType=DECIMAL},
    #{item.netWeight,jdbcType=DECIMAL}, #{item.meterClass,jdbcType=VARCHAR}, #{item.meterGroup,jdbcType=VARCHAR},
    #{item.meterOperator,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR}, #{item.koza,jdbcType=DECIMAL},
    #{item.wetWeight,jdbcType=DECIMAL}, #{item.water,jdbcType=DECIMAL}, #{item.dryWeight,jdbcType=DECIMAL},
    #{item.niWeight,jdbcType=DECIMAL}, #{item.coWeight,jdbcType=DECIMAL}, #{item.cuWeight,jdbcType=DECIMAL},
    #{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.storeName,jdbcType=VARCHAR}, #{item.validFlag,jdbcType=VARCHAR} from dual
  </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
    update METER_WORK_GRAB_ACTUAL
    set
    ACTUAL_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.actualNo,jdbcType=VARCHAR}
    </foreach>
    ,DATA_HCH=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.dataHch,jdbcType=VARCHAR}
    </foreach>
    ,DATA_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.dataTime,jdbcType=TIMESTAMP}
    </foreach>
    ,DATA_TYPE=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.dataType,jdbcType=VARCHAR}
    </foreach>
    ,DATA_AREA=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.dataArea,jdbcType=VARCHAR}
    </foreach>
    ,GROSS_WEIGHT=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.grossWeight,jdbcType=DECIMAL}
    </foreach>
    ,TARE_WEIGHT=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.tareWeight,jdbcType=DECIMAL}
    </foreach>
    ,NET_WEIGHT=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.netWeight,jdbcType=DECIMAL}
    </foreach>
    ,METER_CLASS=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.meterClass,jdbcType=VARCHAR}
    </foreach>
    ,METER_GROUP=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.meterGroup,jdbcType=VARCHAR}
    </foreach>
    ,METER_OPERATOR=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.meterOperator,jdbcType=VARCHAR}
    </foreach>
    ,MEMO=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
    </foreach>
    ,KOZA=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.koza,jdbcType=DECIMAL}
    </foreach>
    ,WET_WEIGHT=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.wetWeight,jdbcType=DECIMAL}
    </foreach>
    ,WATER=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.water,jdbcType=DECIMAL}
    </foreach>
    ,DRY_WEIGHT=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.dryWeight,jdbcType=DECIMAL}
    </foreach>
    ,NI_WEIGHT=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.niWeight,jdbcType=DECIMAL}
    </foreach>
    ,CO_WEIGHT=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.coWeight,jdbcType=DECIMAL}
    </foreach>
    ,CU_WEIGHT=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.cuWeight,jdbcType=DECIMAL}
    </foreach>
    ,CREATE_MAN_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
    </foreach>
    ,CREATE_MAN_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
    </foreach>
    ,CREATE_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
    </foreach>
    ,UPDATE_MAN_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
    </foreach>
    ,UPDATE_MAN_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
    </foreach>
    ,UPDATE_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
    </foreach>
    ,STORE_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.storeName,jdbcType=VARCHAR}
    </foreach>
    ,VALID_FLAG=
    <foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_NO" close="end">
      when #{item.actualNo,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
    </foreach>
    where ACTUAL_NO in
    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
      #{item.actualNo,jdbcType=VARCHAR}
    </foreach>
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_WORK_GRAB_ACTUAL
    where ACTUAL_NO in
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->

  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->

  <select id="getNewID" parameterType="java.lang.String" resultType="java.lang.String">
    SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(ACTUAL_NO, 9))), 0) + 1, 4, '0') ACTUAL_NO
        FROM METER_WORK_GRAB_ACTUAL
    where instr(ACTUAL_NO, to_char(sysdate, 'yyyyMMdd')) > 0
  </select>


  <select id="getConfigID" parameterType="java.lang.String" resultType="java.lang.String">
    SELECT to_char(sysdate, 'yyyyMMdd') || LPAD(NVL(MAX(TO_NUMBER(SUBSTR(${primaryKey}, 9))), 0) + 1, 4, '0') ${primaryKey}
    FROM ${tablName}
    where instr(${primaryKey}, to_char(sysdate, 'yyyyMMdd')) > 0
  </select>
</mapper>