<?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.metertolimsold.mapper.MeterToLimsOldMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.meterwork.metertolimsold.model.MeterToLimsOld">
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="XH" jdbcType="VARCHAR" property="xh" />
    <result column="CPFL" jdbcType="VARCHAR" property="cpfl" />
    <result column="CPMC" jdbcType="VARCHAR" property="cpmc" />
    <result column="LY" jdbcType="VARCHAR" property="ly" />
    <result column="QX" jdbcType="VARCHAR" property="qx" />
    <result column="CHH" jdbcType="VARCHAR" property="chh" />
    <result column="RQ" jdbcType="TIMESTAMP" property="rq" />
    <result column="PH" jdbcType="VARCHAR" property="ph" />
    <result column="MZ" jdbcType="DECIMAL" property="mz" />
    <result column="PZ" jdbcType="DECIMAL" property="pz" />
    <result column="JZ" jdbcType="DECIMAL" property="jz" />
    <result column="JLY" jdbcType="VARCHAR" property="jly" />
    <result column="SJ" jdbcType="TIMESTAMP" property="sj" />
    <result column="FJPZ" jdbcType="DECIMAL" property="fjpz" />
    <result column="BZH" jdbcType="VARCHAR" property="bzh" />
    <result column="BZ" jdbcType="VARCHAR" property="bz" />
    <result column="SHL" jdbcType="DECIMAL" property="shl_change" />
    <result column="CPZ" jdbcType="DECIMAL" property="cpz" />
    <result column="SJBZ" jdbcType="VARCHAR" property="sjbz" />
    <result column="EXPORT_NUM" jdbcType="DECIMAL" property="exportNum" />
    <result column="NET_SPOT3_NAME" jdbcType="VARCHAR" property="netSpot3Name" />
    <result column="BASE_SPOT2_NAME" jdbcType="VARCHAR" property="baseSpot2Name" />
    <result column="BASE_SPOT1_NAME" jdbcType="VARCHAR" property="baseSpot1Name" />
    <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" />
  </resultMap>
  <sql id="columns">
    ID, XH, CPFL, CPMC, LY, QX, CHH, RQ, PH, MZ, PZ, JZ, JLY, SJ, FJPZ, BZH, BZ, SHL, 
    CPZ, SJBZ, EXPORT_NUM, NET_SPOT3_NAME, BASE_SPOT2_NAME, BASE_SPOT1_NAME, CREATE_MAN_NO, 
    CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO, 
    DELETE_MAN_NAME, DELETE_TIME
  </sql>
  <sql id="columns_alias">
    t.ID, t.XH, t.CPFL, t.CPMC, t.LY, t.QX, t.CHH, t.RQ, t.PH, t.MZ, t.PZ, t.JZ, t.JLY, 
    t.SJ, t.FJPZ, t.BZH, t.BZ, t.SHL, t.CPZ, t.SJBZ, t.EXPORT_NUM, t.NET_SPOT3_NAME, 
    t.BASE_SPOT2_NAME, t.BASE_SPOT1_NAME, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, 
    t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME, t.DELETE_MAN_NO, t.DELETE_MAN_NAME, 
    t.DELETE_TIME
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_TO_LIMS_OLD
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_TO_LIMS_OLD t
  </sql>
  <sql id="where">
    <where> 
      <if test="id != null and id != ''">
        and ID = #{id}
      </if>
      <if test="xh != null and xh != ''">
        and XH = #{xh}
      </if>
      <if test="cpfl != null and cpfl != ''">
        and CPFL = #{cpfl}
      </if>
      <if test="cpmc != null and cpmc != ''">
        and CPMC = #{cpmc}
      </if>
      <if test="ly != null and ly != ''">
        and LY = #{ly}
      </if>
      <if test="qx != null and qx != ''">
        and QX = #{qx}
      </if>
      <if test="chh != null and chh != ''">
        and CHH = #{chh}
      </if>
      <if test="rq != null">
        and TO_CHAR(RQ,'yyyy-MM-dd') = #{rq}
      </if>
      <if test="ph != null and ph != ''">
        and PH = #{ph}
      </if>
      <if test="mz != null">
        and MZ = #{mz}
      </if>
      <if test="pz != null">
        and PZ = #{pz}
      </if>
      <if test="jz != null">
        and JZ = #{jz}
      </if>
      <if test="jly != null and jly != ''">
        and JLY = #{jly}
      </if>
      <if test="sj != null">
        and TO_CHAR(SJ,'yyyy-MM-dd') = #{sj}
      </if>
      <if test="fjpz != null">
        and FJPZ = #{fjpz}
      </if>
      <if test="bzh != null and bzh != ''">
        and BZH = #{bzh}
      </if>
      <if test="bz != null and bz != ''">
        and BZ = #{bz}
      </if>
      <if test="shl_change != null">
        and SHL = #{shl_change}
      </if>
      <if test="cpz != null">
        and CPZ = #{cpz}
      </if>
      <if test="sjbz != null and sjbz != ''">
        and SJBZ = #{sjbz}
      </if>
      <if test="exportNum != null">
        and EXPORT_NUM = #{exportNum}
      </if>
      <if test="netSpot3Name != null and netSpot3Name != ''">
        and NET_SPOT3_NAME = #{netSpot3Name}
      </if>
      <if test="baseSpot2Name != null and baseSpot2Name != ''">
        and BASE_SPOT2_NAME = #{baseSpot2Name}
      </if>
      <if test="baseSpot1Name != null and baseSpot1Name != ''">
        and BASE_SPOT1_NAME = #{baseSpot1Name}
      </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>
    </where>
  </sql>
  <sql id="whereLike">
    <where> 
      <if test="id != null and id != ''">
        and ID LIKE '%${id}%'
      </if>
      <if test="xh != null and xh != ''">
        and XH LIKE '%${xh}%'
      </if>
      <if test="cpfl != null and cpfl != ''">
        and CPFL LIKE '%${cpfl}%'
      </if>
      <if test="cpmc != null and cpmc != ''">
        and CPMC LIKE '%${cpmc}%'
      </if>
      <if test="ly != null and ly != ''">
        and LY LIKE '%${ly}%'
      </if>
      <if test="qx != null and qx != ''">
        and QX LIKE '%${qx}%'
      </if>
      <if test="chh != null and chh != ''">
        and CHH LIKE '%${chh}%'
      </if>
      <if test="rq != null">
        and TO_CHAR(RQ,'yyyy-MM-dd') = #{rq}
      </if>
      <if test="ph != null and ph != ''">
        and PH LIKE '%${ph}%'
      </if>
      <if test="mz != null">
        and MZ = #{mz}
      </if>
      <if test="pz != null">
        and PZ = #{pz}
      </if>
      <if test="jz != null">
        and JZ = #{jz}
      </if>
      <if test="jly != null and jly != ''">
        and JLY LIKE '%${jly}%'
      </if>
      <if test="sj != null">
        and TO_CHAR(SJ,'yyyy-MM-dd') = #{sj}
      </if>
      <if test="fjpz != null">
        and FJPZ = #{fjpz}
      </if>
      <if test="bzh != null and bzh != ''">
        and BZH LIKE '%${bzh}%'
      </if>
      <if test="bz != null and bz != ''">
        and BZ LIKE '%${bz}%'
      </if>
      <if test="shl_change != null">
        and SHL = #{shl_change}
      </if>
      <if test="cpz != null">
        and CPZ = #{cpz}
      </if>
      <if test="sjbz != null and sjbz != ''">
        and SJBZ LIKE '%${sjbz}%'
      </if>
      <if test="exportNum != null">
        and EXPORT_NUM = #{exportNum}
      </if>
      <if test="netSpot3Name != null and netSpot3Name != ''">
        and NET_SPOT3_NAME LIKE '%${netSpot3Name}%'
      </if>
      <if test="baseSpot2Name != null and baseSpot2Name != ''">
        and BASE_SPOT2_NAME LIKE '%${baseSpot2Name}%'
      </if>
      <if test="baseSpot1Name != null and baseSpot1Name != ''">
        and BASE_SPOT1_NAME LIKE '%${baseSpot1Name}%'
      </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>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_TO_LIMS_OLD
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_TO_LIMS_OLD
    where 1!=1 
      <if test="xh != null and xh != ''">
        or XH = #{xh}
      </if>
      <if test="cpfl != null and cpfl != ''">
        or CPFL = #{cpfl}
      </if>
      <if test="cpmc != null and cpmc != ''">
        or CPMC = #{cpmc}
      </if>
      <if test="ly != null and ly != ''">
        or LY = #{ly}
      </if>
      <if test="qx != null and qx != ''">
        or QX = #{qx}
      </if>
      <if test="chh != null and chh != ''">
        or CHH = #{chh}
      </if>
      <if test="rq != null">
        or TO_CHAR(RQ,'yyyy-MM-dd') = '#{rq}'
      </if>
      <if test="ph != null and ph != ''">
        or PH = #{ph}
      </if>
      <if test="mz != null">
        or MZ = #{mz}
      </if>
      <if test="pz != null">
        or PZ = #{pz}
      </if>
      <if test="jz != null">
        or JZ = #{jz}
      </if>
      <if test="jly != null and jly != ''">
        or JLY = #{jly}
      </if>
      <if test="sj != null">
        or TO_CHAR(SJ,'yyyy-MM-dd') = '#{sj}'
      </if>
      <if test="fjpz != null">
        or FJPZ = #{fjpz}
      </if>
      <if test="bzh != null and bzh != ''">
        or BZH = #{bzh}
      </if>
      <if test="bz != null and bz != ''">
        or BZ = #{bz}
      </if>
      <if test="shl_change != null">
        or SHL = #{shl_change}
      </if>
      <if test="cpz != null">
        or CPZ = #{cpz}
      </if>
      <if test="sjbz != null and sjbz != ''">
        or SJBZ = #{sjbz}
      </if>
      <if test="exportNum != null">
        or EXPORT_NUM = #{exportNum}
      </if>
      <if test="netSpot3Name != null and netSpot3Name != ''">
        or NET_SPOT3_NAME = #{netSpot3Name}
      </if>
      <if test="baseSpot2Name != null and baseSpot2Name != ''">
        or BASE_SPOT2_NAME = #{baseSpot2Name}
      </if>
      <if test="baseSpot1Name != null and baseSpot1Name != ''">
        or BASE_SPOT1_NAME = #{baseSpot1Name}
      </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>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.meterwork.metertolimsold.model.MeterToLimsOld">
    insert into METER_TO_LIMS_OLD (ID, XH, CPFL, 
      CPMC, LY, QX, CHH, 
      RQ, PH, MZ, PZ, 
      JZ, JLY, SJ, FJPZ, 
      BZH, BZ, SHL, CPZ, 
      SJBZ, EXPORT_NUM, NET_SPOT3_NAME, 
      BASE_SPOT2_NAME, BASE_SPOT1_NAME, CREATE_MAN_NO, 
      CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, 
      UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO, 
      DELETE_MAN_NAME, DELETE_TIME)
    values (#{id,jdbcType=VARCHAR}, #{xh,jdbcType=VARCHAR}, #{cpfl,jdbcType=VARCHAR}, 
      #{cpmc,jdbcType=VARCHAR}, #{ly,jdbcType=VARCHAR}, #{qx,jdbcType=VARCHAR}, #{chh,jdbcType=VARCHAR}, 
      #{rq,jdbcType=TIMESTAMP}, #{ph,jdbcType=VARCHAR}, #{mz,jdbcType=DECIMAL}, #{pz,jdbcType=DECIMAL}, 
      #{jz,jdbcType=DECIMAL}, #{jly,jdbcType=VARCHAR}, #{sj,jdbcType=TIMESTAMP}, #{fjpz,jdbcType=DECIMAL}, 
      #{bzh,jdbcType=VARCHAR}, #{bz,jdbcType=VARCHAR}, #{shl_change,jdbcType=DECIMAL}, #{cpz,jdbcType=DECIMAL},
      #{sjbz,jdbcType=VARCHAR}, #{exportNum,jdbcType=DECIMAL}, #{netSpot3Name,jdbcType=VARCHAR}, 
      #{baseSpot2Name,jdbcType=VARCHAR}, #{baseSpot1Name,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})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.meterwork.metertolimsold.model.MeterToLimsOld">
    insert into METER_TO_LIMS_OLD
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="xh != null">
        XH,
      </if>
      <if test="cpfl != null">
        CPFL,
      </if>
      <if test="cpmc != null">
        CPMC,
      </if>
      <if test="ly != null">
        LY,
      </if>
      <if test="qx != null">
        QX,
      </if>
      <if test="chh != null">
        CHH,
      </if>
      <if test="rq != null">
        RQ,
      </if>
      <if test="ph != null">
        PH,
      </if>
      <if test="mz != null">
        MZ,
      </if>
      <if test="pz != null">
        PZ,
      </if>
      <if test="jz != null">
        JZ,
      </if>
      <if test="jly != null">
        JLY,
      </if>
      <if test="sj != null">
        SJ,
      </if>
      <if test="fjpz != null">
        FJPZ,
      </if>
      <if test="bzh != null">
        BZH,
      </if>
      <if test="bz != null">
        BZ,
      </if>
      <if test="shl_change != null">
        SHL,
      </if>
      <if test="cpz != null">
        CPZ,
      </if>
      <if test="sjbz != null">
        SJBZ,
      </if>
      <if test="exportNum != null">
        EXPORT_NUM,
      </if>
      <if test="netSpot3Name != null">
        NET_SPOT3_NAME,
      </if>
      <if test="baseSpot2Name != null">
        BASE_SPOT2_NAME,
      </if>
      <if test="baseSpot1Name != null">
        BASE_SPOT1_NAME,
      </if>
      <if test="createManNo != null">
        CREATE_MAN_NO,
      </if>
      <if test="createManName != null">
        CREATE_MAN_NAME,
      </if>
      <if test="createTime != null">
        CREATE_TIME,
      </if>
      <if test="updateManNo != null">
        UPDATE_MAN_NO,
      </if>
      <if test="updateManName != null">
        UPDATE_MAN_NAME,
      </if>
      <if test="updateTime != null">
        UPDATE_TIME,
      </if>
      <if test="deleteManNo != null">
        DELETE_MAN_NO,
      </if>
      <if test="deleteManName != null">
        DELETE_MAN_NAME,
      </if>
      <if test="deleteTime != null">
        DELETE_TIME,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="xh != null">
        #{xh,jdbcType=VARCHAR},
      </if>
      <if test="cpfl != null">
        #{cpfl,jdbcType=VARCHAR},
      </if>
      <if test="cpmc != null">
        #{cpmc,jdbcType=VARCHAR},
      </if>
      <if test="ly != null">
        #{ly,jdbcType=VARCHAR},
      </if>
      <if test="qx != null">
        #{qx,jdbcType=VARCHAR},
      </if>
      <if test="chh != null">
        #{chh,jdbcType=VARCHAR},
      </if>
      <if test="rq != null">
        #{rq,jdbcType=TIMESTAMP},
      </if>
      <if test="ph != null">
        #{ph,jdbcType=VARCHAR},
      </if>
      <if test="mz != null">
        #{mz,jdbcType=DECIMAL},
      </if>
      <if test="pz != null">
        #{pz,jdbcType=DECIMAL},
      </if>
      <if test="jz != null">
        #{jz,jdbcType=DECIMAL},
      </if>
      <if test="jly != null">
        #{jly,jdbcType=VARCHAR},
      </if>
      <if test="sj != null">
        #{sj,jdbcType=TIMESTAMP},
      </if>
      <if test="fjpz != null">
        #{fjpz,jdbcType=DECIMAL},
      </if>
      <if test="bzh != null">
        #{bzh,jdbcType=VARCHAR},
      </if>
      <if test="bz != null">
        #{bz,jdbcType=VARCHAR},
      </if>
      <if test="shl_change != null">
        #{shl_change,jdbcType=DECIMAL},
      </if>
      <if test="cpz != null">
        #{cpz,jdbcType=DECIMAL},
      </if>
      <if test="sjbz != null">
        #{sjbz,jdbcType=VARCHAR},
      </if>
      <if test="exportNum != null">
        #{exportNum,jdbcType=DECIMAL},
      </if>
      <if test="netSpot3Name != null">
        #{netSpot3Name,jdbcType=VARCHAR},
      </if>
      <if test="baseSpot2Name != null">
        #{baseSpot2Name,jdbcType=VARCHAR},
      </if>
      <if test="baseSpot1Name != null">
        #{baseSpot1Name,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>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.meterwork.metertolimsold.model.MeterToLimsOld">
    update METER_TO_LIMS_OLD
    set XH = #{xh,jdbcType=VARCHAR},
      CPFL = #{cpfl,jdbcType=VARCHAR},
      CPMC = #{cpmc,jdbcType=VARCHAR},
      LY = #{ly,jdbcType=VARCHAR},
      QX = #{qx,jdbcType=VARCHAR},
      CHH = #{chh,jdbcType=VARCHAR},
      RQ = #{rq,jdbcType=TIMESTAMP},
      PH = #{ph,jdbcType=VARCHAR},
      MZ = #{mz,jdbcType=DECIMAL},
      PZ = #{pz,jdbcType=DECIMAL},
      JZ = #{jz,jdbcType=DECIMAL},
      JLY = #{jly,jdbcType=VARCHAR},
      SJ = #{sj,jdbcType=TIMESTAMP},
      FJPZ = #{fjpz,jdbcType=DECIMAL},
      BZH = #{bzh,jdbcType=VARCHAR},
      BZ = #{bz,jdbcType=VARCHAR},
      SHL = #{shl_change,jdbcType=DECIMAL},
      CPZ = #{cpz,jdbcType=DECIMAL},
      SJBZ = #{sjbz,jdbcType=VARCHAR},
      EXPORT_NUM = #{exportNum,jdbcType=DECIMAL},
      NET_SPOT3_NAME = #{netSpot3Name,jdbcType=VARCHAR},
      BASE_SPOT2_NAME = #{baseSpot2Name,jdbcType=VARCHAR},
      BASE_SPOT1_NAME = #{baseSpot1Name,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}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.meterwork.metertolimsold.model.MeterToLimsOld">
    update METER_TO_LIMS_OLD
    <set>
      <if test="xh != null">
        XH = #{xh,jdbcType=VARCHAR},
      </if>
      <if test="cpfl != null">
        CPFL = #{cpfl,jdbcType=VARCHAR},
      </if>
      <if test="cpmc != null">
        CPMC = #{cpmc,jdbcType=VARCHAR},
      </if>
      <if test="ly != null">
        LY = #{ly,jdbcType=VARCHAR},
      </if>
      <if test="qx != null">
        QX = #{qx,jdbcType=VARCHAR},
      </if>
      <if test="chh != null">
        CHH = #{chh,jdbcType=VARCHAR},
      </if>
      <if test="rq != null">
        RQ = #{rq,jdbcType=TIMESTAMP},
      </if>
      <if test="ph != null">
        PH = #{ph,jdbcType=VARCHAR},
      </if>
      <if test="mz != null">
        MZ = #{mz,jdbcType=DECIMAL},
      </if>
      <if test="pz != null">
        PZ = #{pz,jdbcType=DECIMAL},
      </if>
      <if test="jz != null">
        JZ = #{jz,jdbcType=DECIMAL},
      </if>
      <if test="jly != null">
        JLY = #{jly,jdbcType=VARCHAR},
      </if>
      <if test="sj != null">
        SJ = #{sj,jdbcType=TIMESTAMP},
      </if>
      <if test="fjpz != null">
        FJPZ = #{fjpz,jdbcType=DECIMAL},
      </if>
      <if test="bzh != null">
        BZH = #{bzh,jdbcType=VARCHAR},
      </if>
      <if test="bz != null">
        BZ = #{bz,jdbcType=VARCHAR},
      </if>
      <if test="shl_change != null">
        SHL = #{shl_change,jdbcType=DECIMAL},
      </if>
      <if test="cpz != null">
        CPZ = #{cpz,jdbcType=DECIMAL},
      </if>
      <if test="sjbz != null">
        SJBZ = #{sjbz,jdbcType=VARCHAR},
      </if>
      <if test="exportNum != null">
        EXPORT_NUM = #{exportNum,jdbcType=DECIMAL},
      </if>
      <if test="netSpot3Name != null">
        NET_SPOT3_NAME = #{netSpot3Name,jdbcType=VARCHAR},
      </if>
      <if test="baseSpot2Name != null">
        BASE_SPOT2_NAME = #{baseSpot2Name,jdbcType=VARCHAR},
      </if>
      <if test="baseSpot1Name != null">
        BASE_SPOT1_NAME = #{baseSpot1Name,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>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where ID = #{id,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_TO_LIMS_OLD 
      (ID, 
      XH, CPFL, CPMC, 
      LY, QX, CHH, 
      RQ, PH, MZ, 
      PZ, JZ, JLY, 
      SJ, FJPZ, BZH, 
      BZ, SHL, CPZ, 
      SJBZ, EXPORT_NUM, NET_SPOT3_NAME, 
      BASE_SPOT2_NAME, BASE_SPOT1_NAME, 
      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
      DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME
      )
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.id,jdbcType=VARCHAR}, 
      #{item.xh,jdbcType=VARCHAR}, #{item.cpfl,jdbcType=VARCHAR}, #{item.cpmc,jdbcType=VARCHAR}, 
      #{item.ly,jdbcType=VARCHAR}, #{item.qx,jdbcType=VARCHAR}, #{item.chh,jdbcType=VARCHAR}, 
      #{item.rq,jdbcType=TIMESTAMP}, #{item.ph,jdbcType=VARCHAR}, #{item.mz,jdbcType=DECIMAL}, 
      #{item.pz,jdbcType=DECIMAL}, #{item.jz,jdbcType=DECIMAL}, #{item.jly,jdbcType=VARCHAR}, 
      #{item.sj,jdbcType=TIMESTAMP}, #{item.fjpz,jdbcType=DECIMAL}, #{item.bzh,jdbcType=VARCHAR}, 
      #{item.bz,jdbcType=VARCHAR}, #{item.shl_change,jdbcType=DECIMAL}, #{item.cpz,jdbcType=DECIMAL},
      #{item.sjbz,jdbcType=VARCHAR}, #{item.exportNum,jdbcType=DECIMAL}, #{item.netSpot3Name,jdbcType=VARCHAR}, 
      #{item.baseSpot2Name,jdbcType=VARCHAR}, #{item.baseSpot1Name,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}
       from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update METER_TO_LIMS_OLD
     set
       ID=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.id,jdbcType=VARCHAR}
       </foreach>
       ,XH=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.xh,jdbcType=VARCHAR}
       </foreach>
       ,CPFL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.cpfl,jdbcType=VARCHAR}
       </foreach>
       ,CPMC=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.cpmc,jdbcType=VARCHAR}
       </foreach>
       ,LY=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.ly,jdbcType=VARCHAR}
       </foreach>
       ,QX=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.qx,jdbcType=VARCHAR}
       </foreach>
       ,CHH=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.chh,jdbcType=VARCHAR}
       </foreach>
       ,RQ=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.rq,jdbcType=TIMESTAMP}
       </foreach>
       ,PH=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.ph,jdbcType=VARCHAR}
       </foreach>
       ,MZ=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.mz,jdbcType=DECIMAL}
       </foreach>
       ,PZ=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.pz,jdbcType=DECIMAL}
       </foreach>
       ,JZ=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.jz,jdbcType=DECIMAL}
       </foreach>
       ,JLY=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.jly,jdbcType=VARCHAR}
       </foreach>
       ,SJ=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.sj,jdbcType=TIMESTAMP}
       </foreach>
       ,FJPZ=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.fjpz,jdbcType=DECIMAL}
       </foreach>
       ,BZH=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.bzh,jdbcType=VARCHAR}
       </foreach>
       ,BZ=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.bz,jdbcType=VARCHAR}
       </foreach>
       ,SHL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.shl_change,jdbcType=DECIMAL}
       </foreach>
       ,CPZ=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.cpz,jdbcType=DECIMAL}
       </foreach>
       ,SJBZ=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.sjbz,jdbcType=VARCHAR}
       </foreach>
       ,EXPORT_NUM=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.exportNum,jdbcType=DECIMAL}
       </foreach>
       ,NET_SPOT3_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.netSpot3Name,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT2_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.baseSpot2Name,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT1_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.baseSpot1Name,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
       </foreach>
       ,UPDATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
       </foreach>
       ,DELETE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.deleteManNo,jdbcType=VARCHAR}
       </foreach>
       ,DELETE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.deleteManName,jdbcType=VARCHAR}
       </foreach>
       ,DELETE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
          when #{item.id,jdbcType=VARCHAR} then #{item.deleteTime,jdbcType=TIMESTAMP}
       </foreach>
     where ID in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.id,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_TO_LIMS_OLD
    where ID in 
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->
  <select id="QueryData" resultMap="BaseResultMap">
    select ID, XH, CPFL, CPMC, LY, QX, CHH, RQ, PH, decode(MZ,null,0,MZ/1000) MZ, decode(PZ,null,0,PZ/1000) PZ, decode(JZ,null,0,JZ/1000) JZ, JLY, SJ, FJPZ, BZH, BZ, SHL,
    decode(PZ,null,0,PZ/1000) CPZ, SJBZ, EXPORT_NUM, NET_SPOT3_NAME, BASE_SPOT2_NAME, BASE_SPOT1_NAME, CREATE_MAN_NO,
    CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO,
    DELETE_MAN_NAME, DELETE_TIME
    FROM METER_TO_LIMS_OLD
    WHERE sj between to_date(#{startTime},'yyyy-MM-dd HH24:mi:ss') and to_date(#{endTime},'yyyy-MM-dd HH24:mi:ss')
    and delete_man_name = '正常'
    <if test="id != null and id != ''">
      and ID = #{id}
    </if>
    <if test="cpmc != null and cpmc != ''">
      and CPMC like '%${cpmc}%'
    </if>
    <if test="ly != null and ly != ''">
      and LY like '%${ly}%'
    </if>
    <if test="qx != null and qx != ''">
      and QX like '%${qx}%'
    </if>
  </select>
</mapper>