<?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.metermonitor.metermonitornote.mapper.MeterMonitorNoteMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.metermonitor.metermonitornote.model.MeterMonitorNote">
    <id column="NOTE_NO" jdbcType="VARCHAR" property="noteNo" />
    <result column="BASE_SPOT_NO" jdbcType="VARCHAR" property="baseSpotNo" />
    <result column="BASE_SPOT_NAME" jdbcType="VARCHAR" property="baseSpotName" />
    <result column="OPERATION_CONTENT" jdbcType="VARCHAR" property="operationContent" />
    <result column="OPERATION_TIME" jdbcType="VARCHAR" property="operationTime" />
    <result column="CAR_NO" jdbcType="VARCHAR" property="carNo" />
    <result column="METER_MAN_NO" jdbcType="VARCHAR" property="meterManNo" />
    <result column="METER_MAN_NAME" jdbcType="VARCHAR" property="meterManName" />
    <result column="METER_NOTE_SOURCE" jdbcType="VARCHAR" property="meterNoteSource" />
    <result column="NOTE_TYPE_NO" jdbcType="VARCHAR" property="noteTypeNo" />
    <result column="NOTE_TYPE_NAME" jdbcType="VARCHAR" property="noteTypeName" />
    <result column="PREDICTION_NO" jdbcType="VARCHAR" property="predictionNo" />
    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
    <result column="CREATE_MAN_NO" jdbcType="VARCHAR" property="createManNo" />
    <result column="CREATE_MAN_NAME" jdbcType="VARCHAR" property="createManName" />
    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
    <result column="UPDATE_MAN_NO" jdbcType="VARCHAR" property="updateManNo" />
    <result column="UPDATE_MAN_NAME" jdbcType="VARCHAR" property="updateManName" />
    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="MONITOR_NOTE" jdbcType="VARCHAR" property="monitorNote" />
  </resultMap>
  <sql id="columns">
    NOTE_NO, BASE_SPOT_NO, BASE_SPOT_NAME, OPERATION_CONTENT, OPERATION_TIME, CAR_NO, 
    METER_MAN_NO, METER_MAN_NAME, METER_NOTE_SOURCE, NOTE_TYPE_NO, NOTE_TYPE_NAME, PREDICTION_NO, 
    MEMO, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
    UPDATE_TIME, MONITOR_NOTE
  </sql>
  <sql id="columns_alias">
    t.NOTE_NO, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.OPERATION_CONTENT, t.OPERATION_TIME, 
    t.CAR_NO, t.METER_MAN_NO, t.METER_MAN_NAME, t.METER_NOTE_SOURCE, t.NOTE_TYPE_NO, 
    t.NOTE_TYPE_NAME, t.PREDICTION_NO, t.MEMO, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, 
    t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME, t.MONITOR_NOTE
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_MONITOR_NOTE
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_MONITOR_NOTE t
  </sql>
  <sql id="where">
    <where> 
      <if test="noteNo != null and noteNo != ''">
        and NOTE_NO = #{noteNo}
      </if>
      <if test="baseSpotNo != null and baseSpotNo != ''">
        and BASE_SPOT_NO = #{baseSpotNo}
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        and BASE_SPOT_NAME = #{baseSpotName}
      </if>
      <if test="operationContent != null and operationContent != ''">
        and OPERATION_CONTENT = #{operationContent}
      </if>
      <if test="operationTime != null and operationTime != ''">
        and OPERATION_TIME = #{operationTime}
      </if>
      <if test="carNo != null and carNo != ''">
        and CAR_NO = #{carNo}
      </if>
      <if test="meterManNo != null and meterManNo != ''">
        and METER_MAN_NO = #{meterManNo}
      </if>
      <if test="meterManName != null and meterManName != ''">
        and METER_MAN_NAME = #{meterManName}
      </if>
      <if test="meterNoteSource != null and meterNoteSource != ''">
        and METER_NOTE_SOURCE = #{meterNoteSource}
      </if>
      <if test="noteTypeNo != null and noteTypeNo != ''">
        and NOTE_TYPE_NO = #{noteTypeNo}
      </if>
      <if test="noteTypeName != null and noteTypeName != ''">
        and NOTE_TYPE_NAME = #{noteTypeName}
      </if>
      <if test="predictionNo != null and predictionNo != ''">
        and PREDICTION_NO = #{predictionNo}
      </if>
      <if test="memo != null and memo != ''">
        and MEMO = #{memo}
      </if>
      <if test="createManNo != null and createManNo != ''">
        and CREATE_MAN_NO = #{createManNo}
      </if>
      <if test="createManName != null and createManName != ''">
        and CREATE_MAN_NAME = #{createManName}
      </if>
      <if test="createTime != null">
        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        and UPDATE_MAN_NO = #{updateManNo}
      </if>
      <if test="updateManName != null and updateManName != ''">
        and UPDATE_MAN_NAME = #{updateManName}
      </if>
      <if test="updateTime != null">
        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
      </if>
      <if test="monitorNote != null and monitorNote != ''">
        and MONITOR_NOTE = #{monitorNote}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where> 
      <if test="noteNo != null and noteNo != ''">
        and NOTE_NO LIKE '%${noteNo}%'
      </if>
      <if test="baseSpotNo != null and baseSpotNo != ''">
        and BASE_SPOT_NO LIKE '%${baseSpotNo}%'
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        and BASE_SPOT_NAME LIKE '%${baseSpotName}%'
      </if>
      <if test="operationContent != null and operationContent != ''">
        and OPERATION_CONTENT LIKE '%${operationContent}%'
      </if>
      <if test="operationTime != null and operationTime != ''">
        and OPERATION_TIME LIKE '%${operationTime}%'
      </if>
      <if test="carNo != null and carNo != ''">
        and CAR_NO LIKE '%${carNo}%'
      </if>
      <if test="meterManNo != null and meterManNo != ''">
        and METER_MAN_NO LIKE '%${meterManNo}%'
      </if>
      <if test="meterManName != null and meterManName != ''">
        and METER_MAN_NAME LIKE '%${meterManName}%'
      </if>
      <if test="meterNoteSource != null and meterNoteSource != ''">
        and METER_NOTE_SOURCE LIKE '%${meterNoteSource}%'
      </if>
      <if test="noteTypeNo != null and noteTypeNo != ''">
        and NOTE_TYPE_NO LIKE '%${noteTypeNo}%'
      </if>
      <if test="noteTypeName != null and noteTypeName != ''">
        and NOTE_TYPE_NAME LIKE '%${noteTypeName}%'
      </if>
      <if test="predictionNo != null and predictionNo != ''">
        and PREDICTION_NO LIKE '%${predictionNo}%'
      </if>
      <if test="memo != null and memo != ''">
        and MEMO LIKE '%${memo}%'
      </if>
      <if test="createManNo != null and createManNo != ''">
        and CREATE_MAN_NO LIKE '%${createManNo}%'
      </if>
      <if test="createManName != null and createManName != ''">
        and CREATE_MAN_NAME LIKE '%${createManName}%'
      </if>
      <if test="createTime != null">
        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        and UPDATE_MAN_NO LIKE '%${updateManNo}%'
      </if>
      <if test="updateManName != null and updateManName != ''">
        and UPDATE_MAN_NAME LIKE '%${updateManName}%'
      </if>
      <if test="updateTime != null">
        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
      </if>
      <if test="monitorNote != null and monitorNote != ''">
        and MONITOR_NOTE LIKE '%${monitorNote}%'
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_MONITOR_NOTE
    where NOTE_NO = #{noteNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_MONITOR_NOTE
    where 1!=1 
      <if test="baseSpotNo != null and baseSpotNo != ''">
        or BASE_SPOT_NO = #{baseSpotNo}
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        or BASE_SPOT_NAME = #{baseSpotName}
      </if>
      <if test="operationContent != null and operationContent != ''">
        or OPERATION_CONTENT = #{operationContent}
      </if>
      <if test="operationTime != null and operationTime != ''">
        or OPERATION_TIME = #{operationTime}
      </if>
      <if test="carNo != null and carNo != ''">
        or CAR_NO = #{carNo}
      </if>
      <if test="meterManNo != null and meterManNo != ''">
        or METER_MAN_NO = #{meterManNo}
      </if>
      <if test="meterManName != null and meterManName != ''">
        or METER_MAN_NAME = #{meterManName}
      </if>
      <if test="meterNoteSource != null and meterNoteSource != ''">
        or METER_NOTE_SOURCE = #{meterNoteSource}
      </if>
      <if test="noteTypeNo != null and noteTypeNo != ''">
        or NOTE_TYPE_NO = #{noteTypeNo}
      </if>
      <if test="noteTypeName != null and noteTypeName != ''">
        or NOTE_TYPE_NAME = #{noteTypeName}
      </if>
      <if test="predictionNo != null and predictionNo != ''">
        or PREDICTION_NO = #{predictionNo}
      </if>
      <if test="memo != null and memo != ''">
        or MEMO = #{memo}
      </if>
      <if test="createManNo != null and createManNo != ''">
        or CREATE_MAN_NO = #{createManNo}
      </if>
      <if test="createManName != null and createManName != ''">
        or CREATE_MAN_NAME = #{createManName}
      </if>
      <if test="createTime != null">
        or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        or UPDATE_MAN_NO = #{updateManNo}
      </if>
      <if test="updateManName != null and updateManName != ''">
        or UPDATE_MAN_NAME = #{updateManName}
      </if>
      <if test="updateTime != null">
        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
      </if>
      <if test="monitorNote != null and monitorNote != ''">
        or MONITOR_NOTE = #{monitorNote}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.metermonitor.metermonitornote.model.MeterMonitorNote">
    insert into METER_MONITOR_NOTE (NOTE_NO, BASE_SPOT_NO, BASE_SPOT_NAME, 
      OPERATION_CONTENT, OPERATION_TIME, CAR_NO, 
      METER_MAN_NO, METER_MAN_NAME, METER_NOTE_SOURCE, 
      NOTE_TYPE_NO, NOTE_TYPE_NAME, PREDICTION_NO, 
      MEMO, CREATE_MAN_NO, CREATE_MAN_NAME, 
      CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
      UPDATE_TIME, MONITOR_NOTE)
    values (#{noteNo,jdbcType=VARCHAR}, #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR}, 
      #{operationContent,jdbcType=VARCHAR}, #{operationTime,jdbcType=VARCHAR}, #{carNo,jdbcType=VARCHAR}, 
      #{meterManNo,jdbcType=VARCHAR}, #{meterManName,jdbcType=VARCHAR}, #{meterNoteSource,jdbcType=VARCHAR}, 
      #{noteTypeNo,jdbcType=VARCHAR}, #{noteTypeName,jdbcType=VARCHAR}, #{predictionNo,jdbcType=VARCHAR}, 
      #{memo,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{monitorNote,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.metermonitor.metermonitornote.model.MeterMonitorNote">
    insert into METER_MONITOR_NOTE
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="noteNo != null">
        NOTE_NO,
      </if>
      <if test="baseSpotNo != null">
        BASE_SPOT_NO,
      </if>
      <if test="baseSpotName != null">
        BASE_SPOT_NAME,
      </if>
      <if test="operationContent != null">
        OPERATION_CONTENT,
      </if>
      <if test="operationTime != null">
        OPERATION_TIME,
      </if>
      <if test="carNo != null">
        CAR_NO,
      </if>
      <if test="meterManNo != null">
        METER_MAN_NO,
      </if>
      <if test="meterManName != null">
        METER_MAN_NAME,
      </if>
      <if test="meterNoteSource != null">
        METER_NOTE_SOURCE,
      </if>
      <if test="noteTypeNo != null">
        NOTE_TYPE_NO,
      </if>
      <if test="noteTypeName != null">
        NOTE_TYPE_NAME,
      </if>
      <if test="predictionNo != null">
        PREDICTION_NO,
      </if>
      <if test="memo != null">
        MEMO,
      </if>
      <if test="createManNo != null">
        CREATE_MAN_NO,
      </if>
      <if test="createManName != null">
        CREATE_MAN_NAME,
      </if>
      <if test="createTime != null">
        CREATE_TIME,
      </if>
      <if test="updateManNo != null">
        UPDATE_MAN_NO,
      </if>
      <if test="updateManName != null">
        UPDATE_MAN_NAME,
      </if>
      <if test="updateTime != null">
        UPDATE_TIME,
      </if>
      <if test="monitorNote != null">
        MONITOR_NOTE,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="noteNo != null">
        #{noteNo,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotNo != null">
        #{baseSpotNo,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotName != null">
        #{baseSpotName,jdbcType=VARCHAR},
      </if>
      <if test="operationContent != null">
        #{operationContent,jdbcType=VARCHAR},
      </if>
      <if test="operationTime != null">
        #{operationTime,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="meterManNo != null">
        #{meterManNo,jdbcType=VARCHAR},
      </if>
      <if test="meterManName != null">
        #{meterManName,jdbcType=VARCHAR},
      </if>
      <if test="meterNoteSource != null">
        #{meterNoteSource,jdbcType=VARCHAR},
      </if>
      <if test="noteTypeNo != null">
        #{noteTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="noteTypeName != null">
        #{noteTypeName,jdbcType=VARCHAR},
      </if>
      <if test="predictionNo != null">
        #{predictionNo,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        #{memo,jdbcType=VARCHAR},
      </if>
      <if test="createManNo != null">
        #{createManNo,jdbcType=VARCHAR},
      </if>
      <if test="createManName != null">
        #{createManName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateManNo != null">
        #{updateManNo,jdbcType=VARCHAR},
      </if>
      <if test="updateManName != null">
        #{updateManName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="monitorNote != null">
        #{monitorNote,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.metermonitor.metermonitornote.model.MeterMonitorNote">
    update METER_MONITOR_NOTE
    set BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
      BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
      OPERATION_CONTENT = #{operationContent,jdbcType=VARCHAR},
      OPERATION_TIME = #{operationTime,jdbcType=VARCHAR},
      CAR_NO = #{carNo,jdbcType=VARCHAR},
      METER_MAN_NO = #{meterManNo,jdbcType=VARCHAR},
      METER_MAN_NAME = #{meterManName,jdbcType=VARCHAR},
      METER_NOTE_SOURCE = #{meterNoteSource,jdbcType=VARCHAR},
      NOTE_TYPE_NO = #{noteTypeNo,jdbcType=VARCHAR},
      NOTE_TYPE_NAME = #{noteTypeName,jdbcType=VARCHAR},
      PREDICTION_NO = #{predictionNo,jdbcType=VARCHAR},
      MEMO = #{memo,jdbcType=VARCHAR},
      CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
      CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
      UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      MONITOR_NOTE = #{monitorNote,jdbcType=VARCHAR}
    where NOTE_NO = #{noteNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.metermonitor.metermonitornote.model.MeterMonitorNote">
    update METER_MONITOR_NOTE
    <set>
      <if test="baseSpotNo != null">
        BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotName != null">
        BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
      </if>
      <if test="operationContent != null">
        OPERATION_CONTENT = #{operationContent,jdbcType=VARCHAR},
      </if>
      <if test="operationTime != null">
        OPERATION_TIME = #{operationTime,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        CAR_NO = #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="meterManNo != null">
        METER_MAN_NO = #{meterManNo,jdbcType=VARCHAR},
      </if>
      <if test="meterManName != null">
        METER_MAN_NAME = #{meterManName,jdbcType=VARCHAR},
      </if>
      <if test="meterNoteSource != null">
        METER_NOTE_SOURCE = #{meterNoteSource,jdbcType=VARCHAR},
      </if>
      <if test="noteTypeNo != null">
        NOTE_TYPE_NO = #{noteTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="noteTypeName != null">
        NOTE_TYPE_NAME = #{noteTypeName,jdbcType=VARCHAR},
      </if>
      <if test="predictionNo != null">
        PREDICTION_NO = #{predictionNo,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        MEMO = #{memo,jdbcType=VARCHAR},
      </if>
      <if test="createManNo != null">
        CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
      </if>
      <if test="createManName != null">
        CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateManNo != null">
        UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
      </if>
      <if test="updateManName != null">
        UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="monitorNote != null">
        MONITOR_NOTE = #{monitorNote,jdbcType=VARCHAR},
      </if>
    </set>
    where NOTE_NO = #{noteNo,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where NOTE_NO = #{noteNo,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_MONITOR_NOTE 
      (NOTE_NO, 
      BASE_SPOT_NO, BASE_SPOT_NAME, OPERATION_CONTENT, 
      OPERATION_TIME, CAR_NO, METER_MAN_NO, 
      METER_MAN_NAME, METER_NOTE_SOURCE, 
      NOTE_TYPE_NO, NOTE_TYPE_NAME, PREDICTION_NO, 
      MEMO, CREATE_MAN_NO, CREATE_MAN_NAME, 
      CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
      UPDATE_TIME, MONITOR_NOTE)
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.noteNo,jdbcType=VARCHAR}, 
      #{item.baseSpotNo,jdbcType=VARCHAR}, #{item.baseSpotName,jdbcType=VARCHAR}, #{item.operationContent,jdbcType=VARCHAR}, 
      #{item.operationTime,jdbcType=VARCHAR}, #{item.carNo,jdbcType=VARCHAR}, #{item.meterManNo,jdbcType=VARCHAR}, 
      #{item.meterManName,jdbcType=VARCHAR}, #{item.meterNoteSource,jdbcType=VARCHAR}, 
      #{item.noteTypeNo,jdbcType=VARCHAR}, #{item.noteTypeName,jdbcType=VARCHAR}, #{item.predictionNo,jdbcType=VARCHAR}, 
      #{item.memo,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR}, 
      #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, 
      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.monitorNote,jdbcType=VARCHAR} from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update METER_MONITOR_NOTE
     set
       NOTE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.noteNo,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
       </foreach>
       ,OPERATION_CONTENT=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.operationContent,jdbcType=VARCHAR}
       </foreach>
       ,OPERATION_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.operationTime,jdbcType=VARCHAR}
       </foreach>
       ,CAR_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.carNo,jdbcType=VARCHAR}
       </foreach>
       ,METER_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.meterManNo,jdbcType=VARCHAR}
       </foreach>
       ,METER_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.meterManName,jdbcType=VARCHAR}
       </foreach>
       ,METER_NOTE_SOURCE=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.meterNoteSource,jdbcType=VARCHAR}
       </foreach>
       ,NOTE_TYPE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.noteTypeNo,jdbcType=VARCHAR}
       </foreach>
       ,NOTE_TYPE_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.noteTypeName,jdbcType=VARCHAR}
       </foreach>
       ,PREDICTION_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.predictionNo,jdbcType=VARCHAR}
       </foreach>
       ,MEMO=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
       </foreach>
       ,UPDATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
       </foreach>
       ,MONITOR_NOTE=
       <foreach collection="list" item="item" index="index" separator=" " open="case NOTE_NO" close="end">
          when #{item.noteNo,jdbcType=VARCHAR} then #{item.monitorNote,jdbcType=VARCHAR}
       </foreach>
     where NOTE_NO in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.noteNo,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_MONITOR_NOTE
    where NOTE_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(NOTE_NO, LENGTH(NOTE_NO) - 3))),0) + 1,4,'0') NOTE_NO
    FROM METER_monitor_note where instr(NOTE_NO,#{afl,jdbcType=VARCHAR})>0
  </select>
  <select id="selectView" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    SELECT <include refid="columns"/> from METER_MONITOR_NOTE_VIEW
    <where>
      <if test="baseSpotNo != null and baseSpotNo != ''">
        and BASE_SPOT_NO = #{baseSpotNo}
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        and BASE_SPOT_NAME = #{baseSpotName}
      </if>
      <if test="operationTime1 != null and operationTime1 != ''">
        and OPERATION_TIME >= #{operationTime1}
      </if>
      <if test="operationTime2 != null and operationTime2!= ''">
        and OPERATION_TIME &lt;= #{operationTime2}
      </if>
      <if test="meterNoteSource != null and meterNoteSource != ''">
        and METER_NOTE_SOURCE = #{meterNoteSource}
      </if>
      and base_spot_no in
      (select t1.base_spot_no
      from METER_BASE_SPOT_INFO t1
      where t1.spot_type_no = #{spotTypeNo})
    </where>
    order  by OPERATION_TIME desc
  </select>

  <select id="selectByTime" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    SELECT <include refid="columns"/> from METER_MONITOR_NOTE
    where BASE_SPOT_NO = #{baseSpotNo} and CAR_NO = #{carNo}
    and to_date(OPERATION_TIME ,'yyyy-mm-dd HH24:mi:ss') >= to_date(#{operationTime},'yyyy-mm-dd HH24:mi:ss')-3/24/60
    and to_date(OPERATION_TIME ,'yyyy-mm-dd HH24:mi:ss') &lt;= to_date(#{operationTime},'yyyy-mm-dd HH24:mi:ss') + 1/(24*60)
  </select>

  <select id="selectByType" parameterType="java.lang.String" resultMap="BaseResultMap">
    SELECT <include refid="columns"/> from METER_MONITOR_NOTE
    <where>
      1 = 1
      <if test="meterNoteSource != null and meterNoteSource != ''">
        and METER_NOTE_SOURCE = #{meterNoteSource}
      </if>
      and base_spot_no in
      (select t1.base_spot_no
      from METER_BASE_SPOT_INFO t1
      where t1.spot_type_no = #{spotTypeNo})
    </where>
  </select>

  <select id="queryLikeNoPage" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    select * from (
    <include refid="select" />
    <include refid="where" />
    order by operation_time desc
    )
    where rownum &lt;= 100
  </select>

  <select id="likeByDesc" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="whereLike"/>
    order by operation_time desc
  </select>
</mapper>