<?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.baseinfo.meterbasecalibrationnum.mapper.MeterBaseCalibrationNumMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.baseinfo.meterbasecalibrationnum.model.MeterBaseCalibrationNum">
    <id column="CALIBRATION_NUM_NO" jdbcType="VARCHAR" property="calibrationNumNo" />
    <result column="SPOT_TYPE_NO" jdbcType="VARCHAR" property="spotTypeNo" />
    <result column="SPOT_TYPE_NAME" jdbcType="VARCHAR" property="spotTypeName" />
    <result column="CALIBRATION_NUM" jdbcType="DECIMAL" property="calibrationNum" />
    <result column="CALIBRATION_TYPE_NO" jdbcType="VARCHAR" property="calibrationTypeNo" />
    <result column="CALIBRATION_TYPE_NAME" jdbcType="VARCHAR" property="calibrationTypeName" />
    <result column="VALID_FLAG" jdbcType="VARCHAR" property="validFlag" />
    <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="UP_WEIGHT" jdbcType="DECIMAL" property="upWeight" />
    <result column="IS_METER" jdbcType="VARCHAR" property="isMeter" />
    <result column="MUTUAL_STRATEGY_NO" jdbcType="VARCHAR" property="mutualStrategyNo" />
    <result column="MUTUAL_STRATEGY_NAME" jdbcType="VARCHAR" property="mutualStrategyName" />
    <result column="STATE_FLAG" jdbcType="VARCHAR" property="stateFlag" />
  </resultMap>
  <sql id="columns">
    CALIBRATION_NUM_NO, SPOT_TYPE_NO, SPOT_TYPE_NAME, CALIBRATION_NUM, CALIBRATION_TYPE_NO,
    CALIBRATION_TYPE_NAME, VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO,
    UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME, UP_WEIGHT,
    IS_METER, MUTUAL_STRATEGY_NO, MUTUAL_STRATEGY_NAME, STATE_FLAG
  </sql>
  <sql id="columns_alias">
    t.CALIBRATION_NUM_NO, t.SPOT_TYPE_NO, t.SPOT_TYPE_NAME, t.CALIBRATION_NUM, t.CALIBRATION_TYPE_NO,
    t.CALIBRATION_TYPE_NAME, t.VALID_FLAG, 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.UP_WEIGHT, t.IS_METER, t.MUTUAL_STRATEGY_NO, t.MUTUAL_STRATEGY_NAME,
    t.STATE_FLAG
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_BASE_CALIBRATION_NUM
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_BASE_CALIBRATION_NUM t
  </sql>
  <sql id="where">
    <where>
      <if test="calibrationNumNo != null and calibrationNumNo != ''">
        and CALIBRATION_NUM_NO = #{calibrationNumNo}
      </if>
      <if test="spotTypeNo != null and spotTypeNo != ''">
        and SPOT_TYPE_NO = #{spotTypeNo}
      </if>
      <if test="spotTypeName != null and spotTypeName != ''">
        and SPOT_TYPE_NAME = #{spotTypeName}
      </if>
      <if test="calibrationNum != null">
        and CALIBRATION_NUM = #{calibrationNum}
      </if>
      <if test="calibrationTypeNo != null and calibrationTypeNo != ''">
        and CALIBRATION_TYPE_NO = #{calibrationTypeNo}
      </if>
      <if test="calibrationTypeName != null and calibrationTypeName != ''">
        and CALIBRATION_TYPE_NAME = #{calibrationTypeName}
      </if>
      <if test="validFlag != null and validFlag != ''">
        and VALID_FLAG = #{validFlag}
      </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="upWeight != null">
        and UP_WEIGHT = #{upWeight}
      </if>
      <if test="isMeter != null and isMeter != ''">
        and IS_METER = #{isMeter}
      </if>
      <if test="mutualStrategyNo != null and mutualStrategyNo != ''">
        and MUTUAL_STRATEGY_NO = #{mutualStrategyNo}
      </if>
      <if test="mutualStrategyName != null and mutualStrategyName != ''">
        and MUTUAL_STRATEGY_NAME = #{mutualStrategyName}
      </if>
      <if test="stateFlag != null and stateFlag != ''">
        and STATE_FLAG = #{stateFlag}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where>
      <if test="calibrationNumNo != null and calibrationNumNo != ''">
        and CALIBRATION_NUM_NO LIKE '%${calibrationNumNo}%'
      </if>
      <if test="spotTypeNo != null and spotTypeNo != ''">
        and SPOT_TYPE_NO LIKE '%${spotTypeNo}%'
      </if>
      <if test="spotTypeName != null and spotTypeName != ''">
        and SPOT_TYPE_NAME LIKE '%${spotTypeName}%'
      </if>
      <if test="calibrationNum != null">
        and CALIBRATION_NUM = #{calibrationNum}
      </if>
      <if test="calibrationTypeNo != null and calibrationTypeNo != ''">
        and CALIBRATION_TYPE_NO LIKE '%${calibrationTypeNo}%'
      </if>
      <if test="calibrationTypeName != null and calibrationTypeName != ''">
        and CALIBRATION_TYPE_NAME LIKE '%${calibrationTypeName}%'
      </if>
      <if test="validFlag != null and validFlag != ''">
        and VALID_FLAG LIKE '%${validFlag}%'
      </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="upWeight != null">
        and UP_WEIGHT = #{upWeight}
      </if>
      <if test="isMeter != null and isMeter != ''">
        and IS_METER LIKE '%${isMeter}%'
      </if>
      <if test="mutualStrategyNo != null and mutualStrategyNo != ''">
        and MUTUAL_STRATEGY_NO LIKE '%${mutualStrategyNo}%'
      </if>
      <if test="mutualStrategyName != null and mutualStrategyName != ''">
        and MUTUAL_STRATEGY_NAME LIKE '%${mutualStrategyName}%'
      </if>
      <if test="stateFlag != null and stateFlag != ''">
        and STATE_FLAG LIKE '%${stateFlag}%'
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_BASE_CALIBRATION_NUM
    where CALIBRATION_NUM_NO = #{calibrationNumNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_BASE_CALIBRATION_NUM
    where 1!=1
    <if test="spotTypeNo != null and spotTypeNo != ''">
      or SPOT_TYPE_NO = #{spotTypeNo}
    </if>
    <if test="spotTypeName != null and spotTypeName != ''">
      or SPOT_TYPE_NAME = #{spotTypeName}
    </if>
    <if test="calibrationNum != null">
      or CALIBRATION_NUM = #{calibrationNum}
    </if>
    <if test="calibrationTypeNo != null and calibrationTypeNo != ''">
      or CALIBRATION_TYPE_NO = #{calibrationTypeNo}
    </if>
    <if test="calibrationTypeName != null and calibrationTypeName != ''">
      or CALIBRATION_TYPE_NAME = #{calibrationTypeName}
    </if>
    <if test="validFlag != null and validFlag != ''">
      or VALID_FLAG = #{validFlag}
    </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="upWeight != null">
      or UP_WEIGHT = #{upWeight}
    </if>
    <if test="isMeter != null and isMeter != ''">
      or IS_METER = #{isMeter}
    </if>
    <if test="mutualStrategyNo != null and mutualStrategyNo != ''">
      or MUTUAL_STRATEGY_NO = #{mutualStrategyNo}
    </if>
    <if test="mutualStrategyName != null and mutualStrategyName != ''">
      or MUTUAL_STRATEGY_NAME = #{mutualStrategyName}
    </if>
    <if test="stateFlag != null and stateFlag != ''">
      or STATE_FLAG = #{stateFlag}
    </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.baseinfo.meterbasecalibrationnum.model.MeterBaseCalibrationNum">
    insert into METER_BASE_CALIBRATION_NUM (CALIBRATION_NUM_NO, SPOT_TYPE_NO, SPOT_TYPE_NAME,
      CALIBRATION_NUM, CALIBRATION_TYPE_NO, CALIBRATION_TYPE_NAME,
      VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
      CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME,
      UPDATE_TIME, DELETE_MAN_NO, DELETE_MAN_NAME,
      DELETE_TIME, UP_WEIGHT, IS_METER,
      MUTUAL_STRATEGY_NO, MUTUAL_STRATEGY_NAME, STATE_FLAG
      )
    values (#{calibrationNumNo,jdbcType=VARCHAR}, #{spotTypeNo,jdbcType=VARCHAR}, #{spotTypeName,jdbcType=VARCHAR},
      #{calibrationNum,jdbcType=DECIMAL}, #{calibrationTypeNo,jdbcType=VARCHAR}, #{calibrationTypeName,jdbcType=VARCHAR},
      #{validFlag,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}, #{upWeight,jdbcType=DECIMAL}, #{isMeter,jdbcType=VARCHAR},
      #{mutualStrategyNo,jdbcType=VARCHAR}, #{mutualStrategyName,jdbcType=VARCHAR}, #{stateFlag,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbasecalibrationnum.model.MeterBaseCalibrationNum">
    insert into METER_BASE_CALIBRATION_NUM
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="calibrationNumNo != null">
        CALIBRATION_NUM_NO,
      </if>
      <if test="spotTypeNo != null">
        SPOT_TYPE_NO,
      </if>
      <if test="spotTypeName != null">
        SPOT_TYPE_NAME,
      </if>
      <if test="calibrationNum != null">
        CALIBRATION_NUM,
      </if>
      <if test="calibrationTypeNo != null">
        CALIBRATION_TYPE_NO,
      </if>
      <if test="calibrationTypeName != null">
        CALIBRATION_TYPE_NAME,
      </if>
      <if test="validFlag != null">
        VALID_FLAG,
      </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="upWeight != null">
        UP_WEIGHT,
      </if>
      <if test="isMeter != null">
        IS_METER,
      </if>
      <if test="mutualStrategyNo != null">
        MUTUAL_STRATEGY_NO,
      </if>
      <if test="mutualStrategyName != null">
        MUTUAL_STRATEGY_NAME,
      </if>
      <if test="stateFlag != null">
        STATE_FLAG,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="calibrationNumNo != null">
        #{calibrationNumNo,jdbcType=VARCHAR},
      </if>
      <if test="spotTypeNo != null">
        #{spotTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="spotTypeName != null">
        #{spotTypeName,jdbcType=VARCHAR},
      </if>
      <if test="calibrationNum != null">
        #{calibrationNum,jdbcType=DECIMAL},
      </if>
      <if test="calibrationTypeNo != null">
        #{calibrationTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="calibrationTypeName != null">
        #{calibrationTypeName,jdbcType=VARCHAR},
      </if>
      <if test="validFlag != null">
        #{validFlag,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="upWeight != null">
        #{upWeight,jdbcType=DECIMAL},
      </if>
      <if test="isMeter != null">
        #{isMeter,jdbcType=VARCHAR},
      </if>
      <if test="mutualStrategyNo != null">
        #{mutualStrategyNo,jdbcType=VARCHAR},
      </if>
      <if test="mutualStrategyName != null">
        #{mutualStrategyName,jdbcType=VARCHAR},
      </if>
      <if test="stateFlag != null">
        #{stateFlag,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbasecalibrationnum.model.MeterBaseCalibrationNum">
    update METER_BASE_CALIBRATION_NUM
    set SPOT_TYPE_NO = #{spotTypeNo,jdbcType=VARCHAR},
      SPOT_TYPE_NAME = #{spotTypeName,jdbcType=VARCHAR},
      CALIBRATION_NUM = #{calibrationNum,jdbcType=DECIMAL},
      CALIBRATION_TYPE_NO = #{calibrationTypeNo,jdbcType=VARCHAR},
      CALIBRATION_TYPE_NAME = #{calibrationTypeName,jdbcType=VARCHAR},
      VALID_FLAG = #{validFlag,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},
      UP_WEIGHT = #{upWeight,jdbcType=DECIMAL},
      IS_METER = #{isMeter,jdbcType=VARCHAR},
      MUTUAL_STRATEGY_NO = #{mutualStrategyNo,jdbcType=VARCHAR},
      MUTUAL_STRATEGY_NAME = #{mutualStrategyName,jdbcType=VARCHAR},
      STATE_FLAG = #{stateFlag,jdbcType=VARCHAR}
    where CALIBRATION_NUM_NO = #{calibrationNumNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasecalibrationnum.model.MeterBaseCalibrationNum">
    update METER_BASE_CALIBRATION_NUM
    <set>
      <if test="spotTypeNo != null">
        SPOT_TYPE_NO = #{spotTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="spotTypeName != null">
        SPOT_TYPE_NAME = #{spotTypeName,jdbcType=VARCHAR},
      </if>
      <if test="calibrationNum != null">
        CALIBRATION_NUM = #{calibrationNum,jdbcType=DECIMAL},
      </if>
      <if test="calibrationTypeNo != null">
        CALIBRATION_TYPE_NO = #{calibrationTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="calibrationTypeName != null">
        CALIBRATION_TYPE_NAME = #{calibrationTypeName,jdbcType=VARCHAR},
      </if>
      <if test="validFlag != null">
        VALID_FLAG = #{validFlag,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="upWeight != null">
        UP_WEIGHT = #{upWeight,jdbcType=DECIMAL},
      </if>
      <if test="isMeter != null">
        IS_METER = #{isMeter,jdbcType=VARCHAR},
      </if>
      <if test="mutualStrategyNo != null">
        MUTUAL_STRATEGY_NO = #{mutualStrategyNo,jdbcType=VARCHAR},
      </if>
      <if test="mutualStrategyName != null">
        MUTUAL_STRATEGY_NAME = #{mutualStrategyName,jdbcType=VARCHAR},
      </if>
      <if test="stateFlag != null">
        STATE_FLAG = #{stateFlag,jdbcType=VARCHAR},
      </if>
    </set>
    where CALIBRATION_NUM_NO = #{calibrationNumNo,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where CALIBRATION_NUM_NO = #{calibrationNumNo,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="where"/>
    order by  CALIBRATION_NUM_NO desc
  </select>
  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="whereLike"/>
    order by  CALIBRATION_NUM_NO desc
  </select>
  <insert id="batchInsert" parameterType="java.util.List">
    insert into METER_BASE_CALIBRATION_NUM
    (CALIBRATION_NUM_NO,
    SPOT_TYPE_NO, SPOT_TYPE_NAME, CALIBRATION_NUM,
    CALIBRATION_TYPE_NO, CALIBRATION_TYPE_NAME,
    VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
    CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME,
    UPDATE_TIME, DELETE_MAN_NO, DELETE_MAN_NAME,
    DELETE_TIME, UP_WEIGHT, IS_METER,
    MUTUAL_STRATEGY_NO, MUTUAL_STRATEGY_NAME,
    STATE_FLAG)
    ( <foreach collection="list" item="item" separator="union all">
    select
    #{item.calibrationNumNo,jdbcType=VARCHAR},
    #{item.spotTypeNo,jdbcType=VARCHAR}, #{item.spotTypeName,jdbcType=VARCHAR}, #{item.calibrationNum,jdbcType=DECIMAL},
    #{item.calibrationTypeNo,jdbcType=VARCHAR}, #{item.calibrationTypeName,jdbcType=VARCHAR},
    #{item.validFlag,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.upWeight,jdbcType=DECIMAL}, #{item.isMeter,jdbcType=VARCHAR},
    #{item.mutualStrategyNo,jdbcType=VARCHAR}, #{item.mutualStrategyName,jdbcType=VARCHAR},
    #{item.stateFlag,jdbcType=VARCHAR} from dual
  </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
    update METER_BASE_CALIBRATION_NUM
    set
    CALIBRATION_NUM_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.calibrationNumNo,jdbcType=VARCHAR}
    </foreach>
    ,SPOT_TYPE_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.spotTypeNo,jdbcType=VARCHAR}
    </foreach>
    ,SPOT_TYPE_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.spotTypeName,jdbcType=VARCHAR}
    </foreach>
    ,CALIBRATION_NUM=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.calibrationNum,jdbcType=DECIMAL}
    </foreach>
    ,CALIBRATION_TYPE_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.calibrationTypeNo,jdbcType=VARCHAR}
    </foreach>
    ,CALIBRATION_TYPE_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.calibrationTypeName,jdbcType=VARCHAR}
    </foreach>
    ,VALID_FLAG=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
    </foreach>
    ,CREATE_MAN_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
    </foreach>
    ,CREATE_MAN_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
    </foreach>
    ,CREATE_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
    </foreach>
    ,UPDATE_MAN_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
    </foreach>
    ,UPDATE_MAN_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
    </foreach>
    ,UPDATE_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
    </foreach>
    ,DELETE_MAN_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.deleteManNo,jdbcType=VARCHAR}
    </foreach>
    ,DELETE_MAN_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.deleteManName,jdbcType=VARCHAR}
    </foreach>
    ,DELETE_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.deleteTime,jdbcType=TIMESTAMP}
    </foreach>
    ,UP_WEIGHT=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.upWeight,jdbcType=DECIMAL}
    </foreach>
    ,IS_METER=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.isMeter,jdbcType=VARCHAR}
    </foreach>
    ,MUTUAL_STRATEGY_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.mutualStrategyNo,jdbcType=VARCHAR}
    </foreach>
    ,MUTUAL_STRATEGY_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.mutualStrategyName,jdbcType=VARCHAR}
    </foreach>
    ,STATE_FLAG=
    <foreach collection="list" item="item" index="index" separator=" " open="case CALIBRATION_NUM_NO" close="end">
      when #{item.calibrationNumNo,jdbcType=VARCHAR} then #{item.stateFlag,jdbcType=VARCHAR}
    </foreach>
    where CALIBRATION_NUM_NO in
    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
      #{item.calibrationNumNo,jdbcType=VARCHAR}
    </foreach>
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_BASE_CALIBRATION_NUM
    where CALIBRATION_NUM_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(CALIBRATION_NUM_NO, LENGTH(CALIBRATION_NUM_NO)-4 ))),0) + 1,5,'0') CALIBRATION_NUM_NO
    FROM METER_BASE_CALIBRATION_NUM
  </select>

  <select id="selectForUpdate" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
      <where>
        <if test="calibrationNumNo != null and calibrationNumNo != ''">
          and CALIBRATION_NUM_NO != #{calibrationNumNo}
        </if>
        <if test="spotTypeNo != null and spotTypeNo != ''">
          and SPOT_TYPE_NO = #{spotTypeNo}
        </if>
        <if test="spotTypeName != null and spotTypeName != ''">
          and SPOT_TYPE_NAME = #{spotTypeName}
        </if>
        <if test="calibrationTypeNo != null and calibrationTypeNo != ''">
          and CALIBRATION_TYPE_NO = #{calibrationTypeNo}
        </if>
        <if test="mutualStrategyNo != null and mutualStrategyNo != ''">
          and MUTUAL_STRATEGY_NO = #{mutualStrategyNo}
        </if>
      </where>
  </select>
  <update id="updateStateByPrimaryKey" parameterType="java.lang.String" >
   update METER_BASE_CALIBRATION_NUM t2
         set t2.state_flag = #{stateFlag,jdbcType=VARCHAR}
         where t2.calibration_num_no =  #{calibrationNumNo,jdbcType=VARCHAR}
  </update>
</mapper>