<?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.huaheng.pc.config.zoneCapacity.mapper.ZoneCapacityMapperAuto">
  <select id="selectListEntityByLike" resultType="com.huaheng.pc.config.zoneCapacity.domain.ZoneCapacity">
   SELECT id, code, name, materialId, materialType, zoneId, uphAlarm, uph, lphAlarm, lph, created, createdBy, lastUpdated, lastUpdatedBy, enable, deleted, userDef1, userDef2, userDef3, userDef4, userDef5  
   FROM zone_capacity
  <where>
    <if test="id != null "> 
        AND id = #{id}
    </if>
    <if test="code != null and code != ''"> 
        <bind name="codePattern" value="'%' + code + '%'" />
        AND code like #{codePattern}
    </if>
    <if test="name != null and name != ''"> 
        <bind name="namePattern" value="'%' + name + '%'" />
        AND name like #{namePattern}
    </if>
    <if test="materialId != null "> 
        AND materialId = #{materialId}
    </if>
    <if test="materialType != null and materialType != ''"> 
        <bind name="materialTypePattern" value="'%' + materialType + '%'" />
        AND materialType like #{materialTypePattern}
    </if>
    <if test="zoneId != null and zoneId != ''"> 
        <bind name="zoneIdPattern" value="'%' + zoneId + '%'" />
        AND zoneId like #{zoneIdPattern}
    </if>
    <if test="uphAlarm != null "> 
        AND uphAlarm = #{uphAlarm}
    </if>
    <if test="uph != null "> 
        AND uph = #{uph}
    </if>
    <if test="lphAlarm != null "> 
        AND lphAlarm = #{lphAlarm}
    </if>
    <if test="lph != null "> 
        AND lph = #{lph}
    </if>
    <if test="params != null and params.createdBegin != null and params.createdBegin != ''"> 
        AND created &gt;= #{params.createdBegin}
    </if>
    <if test="params != null and params.createdEnd != null and params.createdEnd != ''"> 
        AND created &lt;= #{params.createdEnd}
    </if>
    <if test="createdBy != null and createdBy != ''"> 
        <bind name="createdByPattern" value="'%' + createdBy + '%'" />
        AND createdBy like #{createdByPattern}
    </if>
    <if test="params != null and params.lastUpdatedBegin != null and params.lastUpdatedBegin != ''"> 
        AND lastUpdated &gt;= #{params.lastUpdatedBegin}
    </if>
    <if test="params != null and params.lastUpdatedEnd != null and params.lastUpdatedEnd != ''"> 
        AND lastUpdated &lt;= #{params.lastUpdatedEnd}
    </if>
    <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> 
        <bind name="lastUpdatedByPattern" value="'%' + lastUpdatedBy + '%'" />
        AND lastUpdatedBy like #{lastUpdatedByPattern}
    </if>
    <if test="enable != null "> 
        AND enable = #{enable}
    </if>
    <if test="deleted != null "> 
        AND deleted = #{deleted}
    </if>
    <if test="userDef1 != null and userDef1 != ''"> 
        <bind name="userDef1Pattern" value="'%' + userDef1 + '%'" />
        AND userDef1 like #{userDef1Pattern}
    </if>
    <if test="userDef2 != null and userDef2 != ''"> 
        <bind name="userDef2Pattern" value="'%' + userDef2 + '%'" />
        AND userDef2 like #{userDef2Pattern}
    </if>
    <if test="userDef3 != null and userDef3 != ''"> 
        <bind name="userDef3Pattern" value="'%' + userDef3 + '%'" />
        AND userDef3 like #{userDef3Pattern}
    </if>
    <if test="userDef4 != null and userDef4 != ''"> 
        <bind name="userDef4Pattern" value="'%' + userDef4 + '%'" />
        AND userDef4 like #{userDef4Pattern}
    </if>
    <if test="userDef5 != null and userDef5 != ''"> 
        <bind name="userDef5Pattern" value="'%' + userDef5 + '%'" />
        AND userDef5 like #{userDef5Pattern}
    </if>
  </where>
  </select>

  <select id="selectListEntityByEqual" resultType="com.huaheng.pc.config.zoneCapacity.domain.ZoneCapacity">
   SELECT id, code, name, materialId, materialType, zoneId, uphAlarm, uph, lphAlarm, lph, created, createdBy, lastUpdated, lastUpdatedBy, enable, deleted, userDef1, userDef2, userDef3, userDef4, userDef5  
   FROM zone_capacity
  <where>
    <if test="id != null"> 
        AND id = #{id}
    </if>
    <if test="code != null"> 
        AND code = #{code}
    </if>
    <if test="name != null"> 
        AND name = #{name}
    </if>
    <if test="materialId != null"> 
        AND materialId = #{materialId}
    </if>
    <if test="materialType != null"> 
        AND materialType = #{materialType}
    </if>
    <if test="zoneId != null"> 
        AND zoneId = #{zoneId}
    </if>
    <if test="uphAlarm != null"> 
        AND uphAlarm = #{uphAlarm}
    </if>
    <if test="uph != null"> 
        AND uph = #{uph}
    </if>
    <if test="lphAlarm != null"> 
        AND lphAlarm = #{lphAlarm}
    </if>
    <if test="lph != null"> 
        AND lph = #{lph}
    </if>
    <if test="created != null"> 
        AND created = #{created}
    </if>
    <if test="createdBy != null"> 
        AND createdBy = #{createdBy}
    </if>
    <if test="lastUpdated != null"> 
        AND lastUpdated = #{lastUpdated}
    </if>
    <if test="lastUpdatedBy != null"> 
        AND lastUpdatedBy = #{lastUpdatedBy}
    </if>
    <if test="enable != null"> 
        AND enable = #{enable}
    </if>
    <if test="deleted != null"> 
        AND deleted = #{deleted}
    </if>
    <if test="userDef1 != null"> 
        AND userDef1 = #{userDef1}
    </if>
    <if test="userDef2 != null"> 
        AND userDef2 = #{userDef2}
    </if>
    <if test="userDef3 != null"> 
        AND userDef3 = #{userDef3}
    </if>
    <if test="userDef4 != null"> 
        AND userDef4 = #{userDef4}
    </if>
    <if test="userDef5 != null"> 
        AND userDef5 = #{userDef5}
    </if>
  </where>
  </select>

  <select id="selectListMapByEqual" resultType="java.util.HashMap">
      SELECT ${columns} FROM zone_capacity
  <where>
    <if test="condition.id != null"> 
        AND id = #{condition.id}
    </if>
    <if test="condition.code != null"> 
        AND code = #{condition.code}
    </if>
    <if test="condition.name != null"> 
        AND name = #{condition.name}
    </if>
    <if test="condition.materialId != null"> 
        AND materialId = #{condition.materialId}
    </if>
    <if test="condition.materialType != null"> 
        AND materialType = #{condition.materialType}
    </if>
    <if test="condition.zoneId != null"> 
        AND zoneId = #{condition.zoneId}
    </if>
    <if test="condition.uphAlarm != null"> 
        AND uphAlarm = #{condition.uphAlarm}
    </if>
    <if test="condition.uph != null"> 
        AND uph = #{condition.uph}
    </if>
    <if test="condition.lphAlarm != null"> 
        AND lphAlarm = #{condition.lphAlarm}
    </if>
    <if test="condition.lph != null"> 
        AND lph = #{condition.lph}
    </if>
    <if test="condition.created != null"> 
        AND created = #{condition.created}
    </if>
    <if test="condition.createdBy != null"> 
        AND createdBy = #{condition.createdBy}
    </if>
    <if test="condition.lastUpdated != null"> 
        AND lastUpdated = #{condition.lastUpdated}
    </if>
    <if test="condition.lastUpdatedBy != null"> 
        AND lastUpdatedBy = #{condition.lastUpdatedBy}
    </if>
    <if test="condition.enable != null"> 
        AND enable = #{condition.enable}
    </if>
    <if test="condition.deleted != null"> 
        AND deleted = #{condition.deleted}
    </if>
    <if test="condition.userDef1 != null"> 
        AND userDef1 = #{condition.userDef1}
    </if>
    <if test="condition.userDef2 != null"> 
        AND userDef2 = #{condition.userDef2}
    </if>
    <if test="condition.userDef3 != null"> 
        AND userDef3 = #{condition.userDef3}
    </if>
    <if test="condition.userDef4 != null"> 
        AND userDef4 = #{condition.userDef4}
    </if>
    <if test="condition.userDef5 != null"> 
        AND userDef5 = #{condition.userDef5}
    </if>
  </where>
  </select>

  <select id="selectEntityById" resultType="com.huaheng.pc.config.zoneCapacity.domain.ZoneCapacity">
      SELECT id, code, name, materialId, materialType, zoneId, uphAlarm, uph, lphAlarm, lph, created, createdBy, lastUpdated, lastUpdatedBy, enable, deleted, userDef1, userDef2, userDef3, userDef4, userDef5  FROM zone_capacity WHERE id = #{id}
  </select>

  <select id="selectFirstEntity" resultType="com.huaheng.pc.config.zoneCapacity.domain.ZoneCapacity">
  SELECT id, code, name, materialId, materialType, zoneId, uphAlarm, uph, lphAlarm, lph, created, createdBy, lastUpdated, lastUpdatedBy, enable, deleted, userDef1, userDef2, userDef3, userDef4, userDef5  
  FROM zone_capacity
  <where>
    <if test="id != null"> 
        AND id = #{id}
    </if>
    <if test="code != null"> 
        AND code = #{code}
    </if>
    <if test="name != null"> 
        AND name = #{name}
    </if>
    <if test="materialId != null"> 
        AND materialId = #{materialId}
    </if>
    <if test="materialType != null"> 
        AND materialType = #{materialType}
    </if>
    <if test="zoneId != null"> 
        AND zoneId = #{zoneId}
    </if>
    <if test="uphAlarm != null"> 
        AND uphAlarm = #{uphAlarm}
    </if>
    <if test="uph != null"> 
        AND uph = #{uph}
    </if>
    <if test="lphAlarm != null"> 
        AND lphAlarm = #{lphAlarm}
    </if>
    <if test="lph != null"> 
        AND lph = #{lph}
    </if>
    <if test="created != null"> 
        AND created = #{created}
    </if>
    <if test="createdBy != null"> 
        AND createdBy = #{createdBy}
    </if>
    <if test="lastUpdated != null"> 
        AND lastUpdated = #{lastUpdated}
    </if>
    <if test="lastUpdatedBy != null"> 
        AND lastUpdatedBy = #{lastUpdatedBy}
    </if>
    <if test="enable != null"> 
        AND enable = #{enable}
    </if>
    <if test="deleted != null"> 
        AND deleted = #{deleted}
    </if>
    <if test="userDef1 != null"> 
        AND userDef1 = #{userDef1}
    </if>
    <if test="userDef2 != null"> 
        AND userDef2 = #{userDef2}
    </if>
    <if test="userDef3 != null"> 
        AND userDef3 = #{userDef3}
    </if>
    <if test="userDef4 != null"> 
        AND userDef4 = #{userDef4}
    </if>
    <if test="userDef5 != null"> 
        AND userDef5 = #{userDef5}
    </if>
  </where>
   LIMIT 1 
  </select>

  <select id="selectFirstMap" resultType="java.util.HashMap">
      SELECT ${columns} FROM zone_capacity
  <where>
    <if test="condition.id != null"> 
        AND id = #{condition.id}
    </if>
    <if test="condition.code != null"> 
        AND code = #{condition.code}
    </if>
    <if test="condition.name != null"> 
        AND name = #{condition.name}
    </if>
    <if test="condition.materialId != null"> 
        AND materialId = #{condition.materialId}
    </if>
    <if test="condition.materialType != null"> 
        AND materialType = #{condition.materialType}
    </if>
    <if test="condition.zoneId != null"> 
        AND zoneId = #{condition.zoneId}
    </if>
    <if test="condition.uphAlarm != null"> 
        AND uphAlarm = #{condition.uphAlarm}
    </if>
    <if test="condition.uph != null"> 
        AND uph = #{condition.uph}
    </if>
    <if test="condition.lphAlarm != null"> 
        AND lphAlarm = #{condition.lphAlarm}
    </if>
    <if test="condition.lph != null"> 
        AND lph = #{condition.lph}
    </if>
    <if test="condition.created != null"> 
        AND created = #{condition.created}
    </if>
    <if test="condition.createdBy != null"> 
        AND createdBy = #{condition.createdBy}
    </if>
    <if test="condition.lastUpdated != null"> 
        AND lastUpdated = #{condition.lastUpdated}
    </if>
    <if test="condition.lastUpdatedBy != null"> 
        AND lastUpdatedBy = #{condition.lastUpdatedBy}
    </if>
    <if test="condition.enable != null"> 
        AND enable = #{condition.enable}
    </if>
    <if test="condition.deleted != null"> 
        AND deleted = #{condition.deleted}
    </if>
    <if test="condition.userDef1 != null"> 
        AND userDef1 = #{condition.userDef1}
    </if>
    <if test="condition.userDef2 != null"> 
        AND userDef2 = #{condition.userDef2}
    </if>
    <if test="condition.userDef3 != null"> 
        AND userDef3 = #{condition.userDef3}
    </if>
    <if test="condition.userDef4 != null"> 
        AND userDef4 = #{condition.userDef4}
    </if>
    <if test="condition.userDef5 != null"> 
        AND userDef5 = #{condition.userDef5}
    </if>
  </where>
   LIMIT 1 
  </select>

  <insert id="insert" parameterType="com.huaheng.pc.config.zoneCapacity.domain.ZoneCapacity" keyProperty="id" useGeneratedKeys="true" >
  INSERT INTO zone_capacity 
  <trim prefix="(" suffix=")" suffixOverrides=",">
    <if test="code != null"> 
        code, 
    </if>
    <if test="name != null"> 
        name, 
    </if>
    <if test="materialId != null"> 
        materialId, 
    </if>
    <if test="materialType != null"> 
        materialType, 
    </if>
    <if test="zoneId != null"> 
        zoneId, 
    </if>
    <if test="uphAlarm != null"> 
        uphAlarm, 
    </if>
    <if test="uph != null"> 
        uph, 
    </if>
    <if test="lphAlarm != null"> 
        lphAlarm, 
    </if>
    <if test="lph != null"> 
        lph, 
    </if>
    <if test="created != null"> 
        created, 
    </if>
    <if test="createdBy != null"> 
        createdBy, 
    </if>
    <if test="lastUpdated != null"> 
        lastUpdated, 
    </if>
    <if test="lastUpdatedBy != null"> 
        lastUpdatedBy, 
    </if>
    <if test="enable != null"> 
        enable, 
    </if>
    <if test="deleted != null"> 
        deleted, 
    </if>
    <if test="userDef1 != null"> 
        userDef1, 
    </if>
    <if test="userDef2 != null"> 
        userDef2, 
    </if>
    <if test="userDef3 != null"> 
        userDef3, 
    </if>
    <if test="userDef4 != null"> 
        userDef4, 
    </if>
    <if test="userDef5 != null"> 
        userDef5, 
    </if>
  </trim>
  <trim prefix=" values (" suffix=")" suffixOverrides=",">
    <if test="code != null"> 
        #{code, jdbcType=VARCHAR}, 
    </if>
    <if test="name != null"> 
        #{name, jdbcType=VARCHAR}, 
    </if>
    <if test="materialId != null"> 
        #{materialId, jdbcType=INTEGER}, 
    </if>
    <if test="materialType != null"> 
        #{materialType, jdbcType=VARCHAR}, 
    </if>
    <if test="zoneId != null"> 
        #{zoneId, jdbcType=VARCHAR}, 
    </if>
    <if test="uphAlarm != null"> 
        #{uphAlarm, jdbcType=DECIMAL}, 
    </if>
    <if test="uph != null"> 
        #{uph, jdbcType=DECIMAL}, 
    </if>
    <if test="lphAlarm != null"> 
        #{lphAlarm, jdbcType=DECIMAL}, 
    </if>
    <if test="lph != null"> 
        #{lph, jdbcType=DECIMAL}, 
    </if>
    <if test="created != null"> 
        #{created, jdbcType=TIMESTAMP}, 
    </if>
    <if test="createdBy != null"> 
        #{createdBy, jdbcType=VARCHAR}, 
    </if>
    <if test="lastUpdated != null"> 
        #{lastUpdated, jdbcType=TIMESTAMP}, 
    </if>
    <if test="lastUpdatedBy != null"> 
        #{lastUpdatedBy, jdbcType=VARCHAR}, 
    </if>
    <if test="enable != null"> 
        #{enable, jdbcType=BIT}, 
    </if>
    <if test="deleted != null"> 
        #{deleted, jdbcType=BIT}, 
    </if>
    <if test="userDef1 != null"> 
        #{userDef1, jdbcType=VARCHAR}, 
    </if>
    <if test="userDef2 != null"> 
        #{userDef2, jdbcType=VARCHAR}, 
    </if>
    <if test="userDef3 != null"> 
        #{userDef3, jdbcType=VARCHAR}, 
    </if>
    <if test="userDef4 != null"> 
        #{userDef4, jdbcType=VARCHAR}, 
    </if>
    <if test="userDef5 != null"> 
        #{userDef5, jdbcType=VARCHAR}, 
    </if>
  </trim>
  </insert>

  <update id="updateByModel">
  UPDATE zone_capacity 
  <set>
    <if test="code != null"> 
        code = #{code, jdbcType=VARCHAR}, 
    </if>
    <if test="name != null"> 
        name = #{name, jdbcType=VARCHAR}, 
    </if>
    <if test="materialId != null"> 
        materialId = #{materialId, jdbcType=INTEGER}, 
    </if>
    <if test="materialType != null"> 
        materialType = #{materialType, jdbcType=VARCHAR}, 
    </if>
    <if test="zoneId != null"> 
        zoneId = #{zoneId, jdbcType=VARCHAR}, 
    </if>
    <if test="uphAlarm != null"> 
        uphAlarm = #{uphAlarm, jdbcType=DECIMAL}, 
    </if>
    <if test="uph != null"> 
        uph = #{uph, jdbcType=DECIMAL}, 
    </if>
    <if test="lphAlarm != null"> 
        lphAlarm = #{lphAlarm, jdbcType=DECIMAL}, 
    </if>
    <if test="lph != null"> 
        lph = #{lph, jdbcType=DECIMAL}, 
    </if>
    <if test="created != null"> 
        created = #{created, jdbcType=TIMESTAMP}, 
    </if>
    <if test="createdBy != null"> 
        createdBy = #{createdBy, jdbcType=VARCHAR}, 
    </if>
    <if test="lastUpdated != null"> 
        lastUpdated = #{lastUpdated, jdbcType=TIMESTAMP}, 
    </if>
    <if test="lastUpdatedBy != null"> 
        lastUpdatedBy = #{lastUpdatedBy, jdbcType=VARCHAR}, 
    </if>
    <if test="enable != null"> 
        enable = #{enable, jdbcType=BIT}, 
    </if>
    <if test="deleted != null"> 
        deleted = #{deleted, jdbcType=BIT}, 
    </if>
    <if test="userDef1 != null"> 
        userDef1 = #{userDef1, jdbcType=VARCHAR}, 
    </if>
    <if test="userDef2 != null"> 
        userDef2 = #{userDef2, jdbcType=VARCHAR}, 
    </if>
    <if test="userDef3 != null"> 
        userDef3 = #{userDef3, jdbcType=VARCHAR}, 
    </if>
    <if test="userDef4 != null"> 
        userDef4 = #{userDef4, jdbcType=VARCHAR}, 
    </if>
    <if test="userDef5 != null"> 
        userDef5 = #{userDef5, jdbcType=VARCHAR}, 
    </if>
  </set>
   WHERE id = #{id,jdbcType=INTEGER}
  </update>

  <update id="updateByCondition">
  UPDATE zone_capacity 
  <set>
    <if test="record.code != null"> 
        code = #{record.code, jdbcType=VARCHAR}, 
    </if>
    <if test="record.name != null"> 
        name = #{record.name, jdbcType=VARCHAR}, 
    </if>
    <if test="record.materialId != null"> 
        materialId = #{record.materialId, jdbcType=INTEGER}, 
    </if>
    <if test="record.materialType != null"> 
        materialType = #{record.materialType, jdbcType=VARCHAR}, 
    </if>
    <if test="record.zoneId != null"> 
        zoneId = #{record.zoneId, jdbcType=VARCHAR}, 
    </if>
    <if test="record.uphAlarm != null"> 
        uphAlarm = #{record.uphAlarm, jdbcType=DECIMAL}, 
    </if>
    <if test="record.uph != null"> 
        uph = #{record.uph, jdbcType=DECIMAL}, 
    </if>
    <if test="record.lphAlarm != null"> 
        lphAlarm = #{record.lphAlarm, jdbcType=DECIMAL}, 
    </if>
    <if test="record.lph != null"> 
        lph = #{record.lph, jdbcType=DECIMAL}, 
    </if>
    <if test="record.created != null"> 
        created = #{record.created, jdbcType=TIMESTAMP}, 
    </if>
    <if test="record.createdBy != null"> 
        createdBy = #{record.createdBy, jdbcType=VARCHAR}, 
    </if>
    <if test="record.lastUpdated != null"> 
        lastUpdated = #{record.lastUpdated, jdbcType=TIMESTAMP}, 
    </if>
    <if test="record.lastUpdatedBy != null"> 
        lastUpdatedBy = #{record.lastUpdatedBy, jdbcType=VARCHAR}, 
    </if>
    <if test="record.enable != null"> 
        enable = #{record.enable, jdbcType=BIT}, 
    </if>
    <if test="record.deleted != null"> 
        deleted = #{record.deleted, jdbcType=BIT}, 
    </if>
    <if test="record.userDef1 != null"> 
        userDef1 = #{record.userDef1, jdbcType=VARCHAR}, 
    </if>
    <if test="record.userDef2 != null"> 
        userDef2 = #{record.userDef2, jdbcType=VARCHAR}, 
    </if>
    <if test="record.userDef3 != null"> 
        userDef3 = #{record.userDef3, jdbcType=VARCHAR}, 
    </if>
    <if test="record.userDef4 != null"> 
        userDef4 = #{record.userDef4, jdbcType=VARCHAR}, 
    </if>
    <if test="record.userDef5 != null"> 
        userDef5 = #{record.userDef5, jdbcType=VARCHAR}, 
    </if>
  </set>
  <where>
    <if test="condition.id != null"> 
        AND id = #{condition.id}
    </if>
    <if test="condition.code != null"> 
        AND code = #{condition.code}
    </if>
    <if test="condition.name != null"> 
        AND name = #{condition.name}
    </if>
    <if test="condition.materialId != null"> 
        AND materialId = #{condition.materialId}
    </if>
    <if test="condition.materialType != null"> 
        AND materialType = #{condition.materialType}
    </if>
    <if test="condition.zoneId != null"> 
        AND zoneId = #{condition.zoneId}
    </if>
    <if test="condition.uphAlarm != null"> 
        AND uphAlarm = #{condition.uphAlarm}
    </if>
    <if test="condition.uph != null"> 
        AND uph = #{condition.uph}
    </if>
    <if test="condition.lphAlarm != null"> 
        AND lphAlarm = #{condition.lphAlarm}
    </if>
    <if test="condition.lph != null"> 
        AND lph = #{condition.lph}
    </if>
    <if test="condition.created != null"> 
        AND created = #{condition.created}
    </if>
    <if test="condition.createdBy != null"> 
        AND createdBy = #{condition.createdBy}
    </if>
    <if test="condition.lastUpdated != null"> 
        AND lastUpdated = #{condition.lastUpdated}
    </if>
    <if test="condition.lastUpdatedBy != null"> 
        AND lastUpdatedBy = #{condition.lastUpdatedBy}
    </if>
    <if test="condition.enable != null"> 
        AND enable = #{condition.enable}
    </if>
    <if test="condition.deleted != null"> 
        AND deleted = #{condition.deleted}
    </if>
    <if test="condition.userDef1 != null"> 
        AND userDef1 = #{condition.userDef1}
    </if>
    <if test="condition.userDef2 != null"> 
        AND userDef2 = #{condition.userDef2}
    </if>
    <if test="condition.userDef3 != null"> 
        AND userDef3 = #{condition.userDef3}
    </if>
    <if test="condition.userDef4 != null"> 
        AND userDef4 = #{condition.userDef4}
    </if>
    <if test="condition.userDef5 != null"> 
        AND userDef5 = #{condition.userDef5}
    </if>
  </where>
  </update>

  <delete id="deleteById"> 
  DELETE FROM zone_capacity WHERE id = #{id, jdbcType=INTEGER} 
  </delete>

  <delete id="deleteByCondition"> 
  DELETE FROM zone_capacity 
  <where>
    <if test="id != null"> 
        AND id = #{id}
    </if>
    <if test="code != null"> 
        AND code = #{code}
    </if>
    <if test="name != null"> 
        AND name = #{name}
    </if>
    <if test="materialId != null"> 
        AND materialId = #{materialId}
    </if>
    <if test="materialType != null"> 
        AND materialType = #{materialType}
    </if>
    <if test="zoneId != null"> 
        AND zoneId = #{zoneId}
    </if>
    <if test="uphAlarm != null"> 
        AND uphAlarm = #{uphAlarm}
    </if>
    <if test="uph != null"> 
        AND uph = #{uph}
    </if>
    <if test="lphAlarm != null"> 
        AND lphAlarm = #{lphAlarm}
    </if>
    <if test="lph != null"> 
        AND lph = #{lph}
    </if>
    <if test="created != null"> 
        AND created = #{created}
    </if>
    <if test="createdBy != null"> 
        AND createdBy = #{createdBy}
    </if>
    <if test="lastUpdated != null"> 
        AND lastUpdated = #{lastUpdated}
    </if>
    <if test="lastUpdatedBy != null"> 
        AND lastUpdatedBy = #{lastUpdatedBy}
    </if>
    <if test="enable != null"> 
        AND enable = #{enable}
    </if>
    <if test="deleted != null"> 
        AND deleted = #{deleted}
    </if>
    <if test="userDef1 != null"> 
        AND userDef1 = #{userDef1}
    </if>
    <if test="userDef2 != null"> 
        AND userDef2 = #{userDef2}
    </if>
    <if test="userDef3 != null"> 
        AND userDef3 = #{userDef3}
    </if>
    <if test="userDef4 != null"> 
        AND userDef4 = #{userDef4}
    </if>
    <if test="userDef5 != null"> 
        AND userDef5 = #{userDef5}
    </if>
  </where>
  </delete>

  </mapper>