<?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.meterbasethread.mapper.MeterBaseThreadMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.baseinfo.meterbasethread.model.MeterBaseThread">
    <id column="THREAD_NO" jdbcType="VARCHAR" property="threadNo" />
    <result column="THREAD_NAME" jdbcType="VARCHAR" property="threadName" />
    <result column="THREAD_EDITION" jdbcType="FLOAT" property="threadEdition" />
    <result column="THREAD_BELONG" jdbcType="VARCHAR" property="threadBelong" />
    <result column="THREAD_EFFECT" jdbcType="VARCHAR" property="threadEffect" />
    <result column="REFRESH_RATE" jdbcType="DECIMAL" property="refreshRate" />
    <result column="VALUE_FLAG" jdbcType="VARCHAR" property="valueFlag" />
    <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">
    THREAD_NO, THREAD_NAME, THREAD_EDITION, THREAD_BELONG, THREAD_EFFECT, REFRESH_RATE, 
    VALUE_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
  </sql>
  <sql id="columns_alias">
    t.THREAD_NO, t.THREAD_NAME, t.THREAD_EDITION, t.THREAD_BELONG, t.THREAD_EFFECT, t.REFRESH_RATE, 
    t.VALUE_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
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_BASE_THREAD
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_BASE_THREAD t
  </sql>
  <sql id="where">
    <where>
      <if test="threadNo != null and threadNo != ''">
        and THREAD_NO = #{threadNo}
      </if>
      <if test="threadName != null and threadName != ''">
        and THREAD_NAME = #{threadName}
      </if>
      <if test="threadEdition != null">
        and THREAD_EDITION = #{threadEdition}
      </if>
      <if test="threadBelong != null and threadBelong != ''">
        and THREAD_BELONG = #{threadBelong}
      </if>
      <if test="threadEffect != null and threadEffect != ''">
        and THREAD_EFFECT = #{threadEffect}
      </if>
      <if test="refreshRate != null">
        and REFRESH_RATE = #{refreshRate}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        and VALUE_FLAG = #{valueFlag}
      </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="threadNo != null and threadNo != ''">
        and THREAD_NO LIKE '%${threadNo}%'
      </if>
      <if test="threadName != null and threadName != ''">
        and THREAD_NAME LIKE '%${threadName}%'
      </if>
      <if test="threadEdition != null">
        and THREAD_EDITION = #{threadEdition}
      </if>
      <if test="threadBelong != null and threadBelong != ''">
        and THREAD_BELONG LIKE '%${threadBelong}%'
      </if>
      <if test="threadEffect != null and threadEffect != ''">
        and THREAD_EFFECT LIKE '%${threadEffect}%'
      </if>
      <if test="refreshRate != null">
        and REFRESH_RATE = #{refreshRate}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        and VALUE_FLAG LIKE '%${valueFlag}%'
      </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_BASE_THREAD
    where THREAD_NO = #{threadNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_BASE_THREAD
    where 1!=1 
      <if test="threadName != null and threadName != ''">
        or THREAD_NAME = #{threadName}
      </if>
      <if test="threadEdition != null">
        or THREAD_EDITION = #{threadEdition}
      </if>
      <if test="threadBelong != null and threadBelong != ''">
        or THREAD_BELONG = #{threadBelong}
      </if>
      <if test="threadEffect != null and threadEffect != ''">
        or THREAD_EFFECT = #{threadEffect}
      </if>
      <if test="refreshRate != null">
        or REFRESH_RATE = #{refreshRate}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        or VALUE_FLAG = #{valueFlag}
      </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.baseinfo.meterbasethread.model.MeterBaseThread">
    insert into METER_BASE_THREAD (THREAD_NO, THREAD_NAME, THREAD_EDITION, 
      THREAD_BELONG, THREAD_EFFECT, REFRESH_RATE, 
      VALUE_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)
    values (#{threadNo,jdbcType=VARCHAR}, #{threadName,jdbcType=VARCHAR}, #{threadEdition,jdbcType=DECIMAL}, 
      #{threadBelong,jdbcType=VARCHAR}, #{threadEffect,jdbcType=VARCHAR}, #{refreshRate,jdbcType=DECIMAL}, 
      #{valueFlag,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.baseinfo.meterbasethread.model.MeterBaseThread">
    insert into METER_BASE_THREAD
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="threadNo != null">
        THREAD_NO,
      </if>
      <if test="threadName != null">
        THREAD_NAME,
      </if>
      <if test="threadEdition != null">
        THREAD_EDITION,
      </if>
      <if test="threadBelong != null">
        THREAD_BELONG,
      </if>
      <if test="threadEffect != null">
        THREAD_EFFECT,
      </if>
      <if test="refreshRate != null">
        REFRESH_RATE,
      </if>
      <if test="valueFlag != null">
        VALUE_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>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="threadNo != null">
        #{threadNo,jdbcType=VARCHAR},
      </if>
      <if test="threadName != null">
        #{threadName,jdbcType=VARCHAR},
      </if>
      <if test="threadEdition != null">
        #{threadEdition,jdbcType=DECIMAL},
      </if>
      <if test="threadBelong != null">
        #{threadBelong,jdbcType=VARCHAR},
      </if>
      <if test="threadEffect != null">
        #{threadEffect,jdbcType=VARCHAR},
      </if>
      <if test="refreshRate != null">
        #{refreshRate,jdbcType=DECIMAL},
      </if>
      <if test="valueFlag != null">
        #{valueFlag,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.baseinfo.meterbasethread.model.MeterBaseThread">
    update METER_BASE_THREAD
    set THREAD_NAME = #{threadName,jdbcType=VARCHAR},
      THREAD_EDITION = #{threadEdition,jdbcType=DECIMAL},
      THREAD_BELONG = #{threadBelong,jdbcType=VARCHAR},
      THREAD_EFFECT = #{threadEffect,jdbcType=VARCHAR},
      REFRESH_RATE = #{refreshRate,jdbcType=DECIMAL},
      VALUE_FLAG = #{valueFlag,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 THREAD_NO = #{threadNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasethread.model.MeterBaseThread">
    update METER_BASE_THREAD
    <set>
      <if test="threadName != null">
        THREAD_NAME = #{threadName,jdbcType=VARCHAR},
      </if>
      <if test="threadEdition != null">
        THREAD_EDITION = #{threadEdition,jdbcType=DECIMAL},
      </if>
      <if test="threadBelong != null">
        THREAD_BELONG = #{threadBelong,jdbcType=VARCHAR},
      </if>
      <if test="threadEffect != null">
        THREAD_EFFECT = #{threadEffect,jdbcType=VARCHAR},
      </if>
      <if test="refreshRate != null">
        REFRESH_RATE = #{refreshRate,jdbcType=DECIMAL},
      </if>
      <if test="valueFlag != null">
        VALUE_FLAG = #{valueFlag,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 THREAD_NO = #{threadNo,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where THREAD_NO = #{threadNo,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="where"/>
    order by CREATE_TIME  desc
  </select>
  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="whereLike"/>
    order by CREATE_TIME  desc
  </select>
  <insert id="batchInsert" parameterType="java.util.List">
    insert into METER_BASE_THREAD 
      (THREAD_NO, 
      THREAD_NAME, THREAD_EDITION, THREAD_BELONG, 
      THREAD_EFFECT, REFRESH_RATE, VALUE_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
      )
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.threadNo,jdbcType=VARCHAR}, 
      #{item.threadName,jdbcType=VARCHAR}, #{item.threadEdition,jdbcType=DECIMAL}, #{item.threadBelong,jdbcType=VARCHAR}, 
      #{item.threadEffect,jdbcType=VARCHAR}, #{item.refreshRate,jdbcType=DECIMAL}, #{item.valueFlag,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_BASE_THREAD
     set
       THREAD_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.threadNo,jdbcType=VARCHAR}
       </foreach>
       ,THREAD_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.threadName,jdbcType=VARCHAR}
       </foreach>
       ,THREAD_EDITION=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.threadEdition,jdbcType=DECIMAL}
       </foreach>
       ,THREAD_BELONG=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.threadBelong,jdbcType=VARCHAR}
       </foreach>
       ,THREAD_EFFECT=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.threadEffect,jdbcType=VARCHAR}
       </foreach>
       ,REFRESH_RATE=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.refreshRate,jdbcType=DECIMAL}
       </foreach>
       ,VALUE_FLAG=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.valueFlag,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
       </foreach>
       ,UPDATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
       </foreach>
       ,DELETE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.deleteManNo,jdbcType=VARCHAR}
       </foreach>
       ,DELETE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.deleteManName,jdbcType=VARCHAR}
       </foreach>
       ,DELETE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case THREAD_NO" close="end">
          when #{item.threadNo,jdbcType=VARCHAR} then #{item.deleteTime,jdbcType=TIMESTAMP}
       </foreach>
     where THREAD_NO in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.threadNo,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_BASE_THREAD
    where THREAD_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(THREAD_NO, LENGTH(THREAD_NO) -3))),0) + 1,4,'0') THREAD_NO
    FROM METER_BASE_THREAD
  </select>

  <select id="selectForUpdate" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <where>
      <if test="threadNo != null and threadNo != ''">
        and THREAD_NO != #{threadNo}
      </if>
      <if test="threadName != null and threadName != ''">
        and THREAD_NAME = #{threadName}
      </if>
    </where>
  </select>
</mapper>