<?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.meterbasebeltmaterialpm.mapper.MeterBaseBeltMaterialPmMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.baseinfo.meterbasebeltmaterialpm.model.MeterBaseBeltMaterialPm">
    <id column="MATERIAL_PM_CODE" jdbcType="VARCHAR" property="materialPmCode" />
    <result column="MATERIAL_TYPE" jdbcType="VARCHAR" property="materialType" />
    <result column="MATERIAL_TYPE_CODE" jdbcType="VARCHAR" property="materialTypeCode" />
    <result column="BASE_SPOT_NO" jdbcType="VARCHAR" property="baseSpotNo" />
    <result column="BASE_SPOT_NAME" jdbcType="VARCHAR" property="baseSpotName" />
    <result column="SCALE_NAME" jdbcType="VARCHAR" property="scaleName" />
    <result column="MATERIAL_PARAMETER" jdbcType="DECIMAL" property="materialParameter" />
    <result column="MATERIAL_PARAMETER_IMPORT" jdbcType="DECIMAL" property="materialParameterImport" />
    <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="VALID_FLAG" jdbcType="VARCHAR" property="validFlag" />
  </resultMap>
  <sql id="columns">
    MATERIAL_PM_CODE, MATERIAL_TYPE, MATERIAL_TYPE_CODE, BASE_SPOT_NO, BASE_SPOT_NAME,
    SCALE_NAME, MATERIAL_PARAMETER, MATERIAL_PARAMETER_IMPORT, CREATE_MAN_NO, CREATE_MAN_NAME,
    CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO, DELETE_MAN_NAME,
    DELETE_TIME, VALID_FLAG
  </sql>
  <sql id="columns_alias">
    t.MATERIAL_PM_CODE, t.MATERIAL_TYPE, t.MATERIAL_TYPE_CODE, t.BASE_SPOT_NO, t.BASE_SPOT_NAME,
    t.SCALE_NAME, t.MATERIAL_PARAMETER, t.MATERIAL_PARAMETER_IMPORT, 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.VALID_FLAG
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_BASE_BELT_MATERIAL_PM
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_BASE_BELT_MATERIAL_PM t
  </sql>
  <sql id="where">
    <where>
      <if test="materialPmCode != null and materialPmCode != ''">
        and MATERIAL_PM_CODE = #{materialPmCode}
      </if>
      <if test="materialType != null and materialType != ''">
        and MATERIAL_TYPE = #{materialType}
      </if>
      <if test="materialTypeCode != null and materialTypeCode != ''">
        and MATERIAL_TYPE_CODE = #{materialTypeCode}
      </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="scaleName != null and scaleName != ''">
        and SCALE_NAME = #{scaleName}
      </if>
      <if test="materialParameter != null">
        and MATERIAL_PARAMETER = #{materialParameter}
      </if>
      <if test="materialParameterImport != null">
        and MATERIAL_PARAMETER_IMPORT = #{materialParameterImport}
      </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="validFlag != null and validFlag != ''">
        and VALID_FLAG = #{validFlag}
      </if>
    </where>
    order by CREATE_TIME desc
  </sql>
  <sql id="whereLike">
    <where>
      <if test="materialPmCode != null and materialPmCode != ''">
        and MATERIAL_PM_CODE LIKE '%${materialPmCode}%'
      </if>
      <if test="materialType != null and materialType != ''">
        and MATERIAL_TYPE LIKE '%${materialType}%'
      </if>
      <if test="materialTypeCode != null and materialTypeCode != ''">
        and MATERIAL_TYPE_CODE LIKE '%${materialTypeCode}%'
      </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="scaleName != null and scaleName != ''">
        and SCALE_NAME LIKE '%${scaleName}%'
      </if>
      <if test="materialParameter != null">
        and MATERIAL_PARAMETER = #{materialParameter}
      </if>
      <if test="materialParameterImport != null">
        and MATERIAL_PARAMETER_IMPORT = #{materialParameterImport}
      </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="validFlag != null and validFlag != ''">
        and VALID_FLAG LIKE '%${validFlag}%'
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_BASE_BELT_MATERIAL_PM
    where MATERIAL_PM_CODE = #{materialPmCode,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_BASE_BELT_MATERIAL_PM
    where 1!=1
    <if test="materialType != null and materialType != ''">
      or MATERIAL_TYPE = #{materialType}
    </if>
    <if test="materialTypeCode != null and materialTypeCode != ''">
      or MATERIAL_TYPE_CODE = #{materialTypeCode}
    </if>
    <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="scaleName != null and scaleName != ''">
      or SCALE_NAME = #{scaleName}
    </if>
    <if test="materialParameter != null">
      or MATERIAL_PARAMETER = #{materialParameter}
    </if>
    <if test="materialParameterImport != null">
      or MATERIAL_PARAMETER_IMPORT = #{materialParameterImport}
    </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="validFlag != null and validFlag != ''">
      or VALID_FLAG = #{validFlag}
    </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.baseinfo.meterbasebeltmaterialpm.model.MeterBaseBeltMaterialPm">
    insert into METER_BASE_BELT_MATERIAL_PM (MATERIAL_PM_CODE, MATERIAL_TYPE, MATERIAL_TYPE_CODE,
      BASE_SPOT_NO, BASE_SPOT_NAME, SCALE_NAME,
      MATERIAL_PARAMETER, MATERIAL_PARAMETER_IMPORT,
      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME,
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME,
      DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME,
      VALID_FLAG)
    values (#{materialPmCode,jdbcType=VARCHAR}, #{materialType,jdbcType=VARCHAR}, #{materialTypeCode,jdbcType=VARCHAR},
      #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR}, #{scaleName,jdbcType=VARCHAR},
      #{materialParameter,jdbcType=DECIMAL}, #{materialParameterImport,jdbcType=DECIMAL},
      #{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},
      #{validFlag,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbasebeltmaterialpm.model.MeterBaseBeltMaterialPm">
    insert into METER_BASE_BELT_MATERIAL_PM
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="materialPmCode != null">
        MATERIAL_PM_CODE,
      </if>
      <if test="materialType != null">
        MATERIAL_TYPE,
      </if>
      <if test="materialTypeCode != null">
        MATERIAL_TYPE_CODE,
      </if>
      <if test="baseSpotNo != null">
        BASE_SPOT_NO,
      </if>
      <if test="baseSpotName != null">
        BASE_SPOT_NAME,
      </if>
      <if test="scaleName != null">
        SCALE_NAME,
      </if>
      <if test="materialParameter != null">
        MATERIAL_PARAMETER,
      </if>
      <if test="materialParameterImport != null">
        MATERIAL_PARAMETER_IMPORT,
      </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="validFlag != null">
        VALID_FLAG,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="materialPmCode != null">
        #{materialPmCode,jdbcType=VARCHAR},
      </if>
      <if test="materialType != null">
        #{materialType,jdbcType=VARCHAR},
      </if>
      <if test="materialTypeCode != null">
        #{materialTypeCode,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotNo != null">
        #{baseSpotNo,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotName != null">
        #{baseSpotName,jdbcType=VARCHAR},
      </if>
      <if test="scaleName != null">
        #{scaleName,jdbcType=VARCHAR},
      </if>
      <if test="materialParameter != null">
        #{materialParameter,jdbcType=DECIMAL},
      </if>
      <if test="materialParameterImport != null">
        #{materialParameterImport,jdbcType=DECIMAL},
      </if>
      <if test="createManNo != null">
        #{createManNo,jdbcType=VARCHAR},
      </if>
      <if test="createManName != null">
        #{createManName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateManNo != null">
        #{updateManNo,jdbcType=VARCHAR},
      </if>
      <if test="updateManName != null">
        #{updateManName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteManNo != null">
        #{deleteManNo,jdbcType=VARCHAR},
      </if>
      <if test="deleteManName != null">
        #{deleteManName,jdbcType=VARCHAR},
      </if>
      <if test="deleteTime != null">
        #{deleteTime,jdbcType=TIMESTAMP},
      </if>
      <if test="validFlag != null">
        #{validFlag,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbasebeltmaterialpm.model.MeterBaseBeltMaterialPm">
    update METER_BASE_BELT_MATERIAL_PM
    set MATERIAL_TYPE = #{materialType,jdbcType=VARCHAR},
      MATERIAL_TYPE_CODE = #{materialTypeCode,jdbcType=VARCHAR},
      BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
      BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
      SCALE_NAME = #{scaleName,jdbcType=VARCHAR},
      MATERIAL_PARAMETER = #{materialParameter,jdbcType=DECIMAL},
      MATERIAL_PARAMETER_IMPORT = #{materialParameterImport,jdbcType=DECIMAL},
      CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
      CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
      UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      DELETE_MAN_NO = #{deleteManNo,jdbcType=VARCHAR},
      DELETE_MAN_NAME = #{deleteManName,jdbcType=VARCHAR},
      DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
      VALID_FLAG = #{validFlag,jdbcType=VARCHAR}
    where MATERIAL_PM_CODE = #{materialPmCode,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasebeltmaterialpm.model.MeterBaseBeltMaterialPm">
    update METER_BASE_BELT_MATERIAL_PM
    <set>
      <if test="materialType != null">
        MATERIAL_TYPE = #{materialType,jdbcType=VARCHAR},
      </if>
      <if test="materialTypeCode != null">
        MATERIAL_TYPE_CODE = #{materialTypeCode,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotNo != null">
        BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotName != null">
        BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
      </if>
      <if test="scaleName != null">
        SCALE_NAME = #{scaleName,jdbcType=VARCHAR},
      </if>
      <if test="materialParameter != null">
        MATERIAL_PARAMETER = #{materialParameter,jdbcType=DECIMAL},
      </if>
      <if test="materialParameterImport != null">
        MATERIAL_PARAMETER_IMPORT = #{materialParameterImport,jdbcType=DECIMAL},
      </if>
      <if test="createManNo != null">
        CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
      </if>
      <if test="createManName != null">
        CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateManNo != null">
        UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
      </if>
      <if test="updateManName != null">
        UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="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="validFlag != null">
        VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
      </if>
    </set>
    where MATERIAL_PM_CODE = #{materialPmCode,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where MATERIAL_PM_CODE = #{materialPmCode,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_BASE_BELT_MATERIAL_PM
    (MATERIAL_PM_CODE,
    MATERIAL_TYPE, MATERIAL_TYPE_CODE,
    BASE_SPOT_NO, BASE_SPOT_NAME, SCALE_NAME,
    MATERIAL_PARAMETER, MATERIAL_PARAMETER_IMPORT,
    CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME,
    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME,
    DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME,
    VALID_FLAG)
    ( <foreach collection="list" item="item" separator="union all">
    select
    #{item.materialPmCode,jdbcType=VARCHAR},
    #{item.materialType,jdbcType=VARCHAR}, #{item.materialTypeCode,jdbcType=VARCHAR},
    #{item.baseSpotNo,jdbcType=VARCHAR}, #{item.baseSpotName,jdbcType=VARCHAR}, #{item.scaleName,jdbcType=VARCHAR},
    #{item.materialParameter,jdbcType=DECIMAL}, #{item.materialParameterImport,jdbcType=DECIMAL},
    #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
    #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
    #{item.deleteManNo,jdbcType=VARCHAR}, #{item.deleteManName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP},
    #{item.validFlag,jdbcType=VARCHAR} from dual
  </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
    update METER_BASE_BELT_MATERIAL_PM
    set
    MATERIAL_PM_CODE=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.materialPmCode,jdbcType=VARCHAR}
    </foreach>
    ,MATERIAL_TYPE=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.materialType,jdbcType=VARCHAR}
    </foreach>
    ,MATERIAL_TYPE_CODE=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.materialTypeCode,jdbcType=VARCHAR}
    </foreach>
    ,BASE_SPOT_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
    </foreach>
    ,BASE_SPOT_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
    </foreach>
    ,SCALE_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.scaleName,jdbcType=VARCHAR}
    </foreach>
    ,MATERIAL_PARAMETER=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.materialParameter,jdbcType=DECIMAL}
    </foreach>
    ,MATERIAL_PARAMETER_IMPORT=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.materialParameterImport,jdbcType=DECIMAL}
    </foreach>
    ,CREATE_MAN_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
    </foreach>
    ,CREATE_MAN_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
    </foreach>
    ,CREATE_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
    </foreach>
    ,UPDATE_MAN_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
    </foreach>
    ,UPDATE_MAN_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
    </foreach>
    ,UPDATE_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
    </foreach>
    ,DELETE_MAN_NO=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.deleteManNo,jdbcType=VARCHAR}
    </foreach>
    ,DELETE_MAN_NAME=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.deleteManName,jdbcType=VARCHAR}
    </foreach>
    ,DELETE_TIME=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.deleteTime,jdbcType=TIMESTAMP}
    </foreach>
    ,VALID_FLAG=
    <foreach collection="list" item="item" index="index" separator=" " open="case MATERIAL_PM_CODE" close="end">
      when #{item.materialPmCode,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
    </foreach>
    where MATERIAL_PM_CODE in
    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
      #{item.materialPmCode,jdbcType=VARCHAR}
    </foreach>
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_BASE_BELT_MATERIAL_PM
    where MATERIAL_PM_CODE in
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->


  <update id="doUpdateFlags_0" parameterType="java.util.List">
    update  METER_BASE_BELT_MATERIAL_PM
    set VALID_FLAG = '0'
    where MATERIAL_PM_CODE in
    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
      #{item.materialPmCode,jdbcType=VARCHAR}
    </foreach>
  </update>
  <update id="doUpdateFlags_1" parameterType="java.util.List">
    update  METER_BASE_BELT_MATERIAL_PM
    set VALID_FLAG = '1'
    where MATERIAL_PM_CODE in
    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
      #{item.materialPmCode,jdbcType=VARCHAR}
    </foreach>
  </update>

  <select id="doQueryByBeltType" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    select pm.material_parameter,pm.material_parameter_import from METER_BASE_BELT_MATERIAL_PM pm where
     pm.material_type_code =
    (select t.belt_type_code from METER_BASE_MATTER_INFO t where t.matter_no =#{matterNo})
    and pm.scale_name=#{scaleName} and pm.base_spot_no= #{baseSpotNo}
  </select>

</mapper>