<?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.gyee.frame.mapper.auto.EquipmentSqlMapper">
  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.EquipmentSql">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="NUMERIC" property="id" />
    <result column="EQNUM" jdbcType="NVARCHAR" property="eqnum" />
    <result column="DESCRIPTION" jdbcType="NVARCHAR" property="description" />
    <result column="LOCATION" jdbcType="NVARCHAR" property="location" />
    <result column="PARENT" jdbcType="NVARCHAR" property="parent" />
    <result column="SERIALNUM" jdbcType="NVARCHAR" property="serialnum" />
    <result column="ASSETNUM" jdbcType="NVARCHAR" property="assetnum" />
    <result column="STATUS" jdbcType="NVARCHAR" property="status" />
    <result column="STATUSDATE" jdbcType="TIMESTAMP" property="statusdate" />
    <result column="VENDOR" jdbcType="NVARCHAR" property="vendor" />
    <result column="FAILURECODE" jdbcType="NVARCHAR" property="failurecode" />
    <result column="MANUFACTURER" jdbcType="NVARCHAR" property="manufacturer" />
    <result column="PURPRICE" jdbcType="DECIMAL" property="purprice" />
    <result column="INSTALLDATE" jdbcType="TIMESTAMP" property="installdate" />
    <result column="WARRANTYEXPDATE" jdbcType="TIMESTAMP" property="warrantyexpdate" />
    <result column="TOTALCOST" jdbcType="DECIMAL" property="totalcost" />
    <result column="YTDCOST" jdbcType="DECIMAL" property="ytdcost" />
    <result column="BUDGETCOST" jdbcType="DECIMAL" property="budgetcost" />
    <result column="CLASSID" jdbcType="NVARCHAR" property="classid" />
    <result column="ISRUNNING" jdbcType="NVARCHAR" property="isrunning" />
    <result column="ITEMNUM" jdbcType="NVARCHAR" property="itemnum" />
    <result column="TOTDOWNTIME" jdbcType="DECIMAL" property="totdowntime" />
    <result column="LFDATE" jdbcType="TIMESTAMP" property="lfdate" />
    <result column="GRADE" jdbcType="NVARCHAR" property="grade" />
    <result column="CHANGEDATE" jdbcType="TIMESTAMP" property="changedate" />
    <result column="CHANGEBY" jdbcType="NVARCHAR" property="changeby" />
    <result column="RUNDATE" jdbcType="TIMESTAMP" property="rundate" />
    <result column="RUNNUMBER" jdbcType="NVARCHAR" property="runnumber" />
    <result column="PRIORITY" jdbcType="NUMERIC" property="priority" />
    <result column="INVCOST" jdbcType="DECIMAL" property="invcost" />
    <result column="CONSTRUCT" jdbcType="NVARCHAR" property="construct" />
    <result column="MODEL" jdbcType="NVARCHAR" property="model" />
    <result column="LFNUMBER" jdbcType="NVARCHAR" property="lfnumber" />
    <result column="DEPTNUM" jdbcType="NVARCHAR" property="deptnum" />
    <result column="BINNUM" jdbcType="NVARCHAR" property="binnum" />
    <result column="LFSERIAL" jdbcType="NVARCHAR" property="lfserial" />
    <result column="STOCKCOST" jdbcType="DECIMAL" property="stockcost" />
    <result column="SERIAL" jdbcType="NVARCHAR" property="serial" />
    <result column="LARGETYPE" jdbcType="NVARCHAR" property="largetype" />
    <result column="LABORNUM" jdbcType="NVARCHAR" property="labornum" />
    <result column="PLANYEARS" jdbcType="NUMERIC" property="planyears" />
    <result column="APPERTAIN" jdbcType="NVARCHAR" property="appertain" />
    <result column="CNTNUM" jdbcType="NVARCHAR" property="cntnum" />
    <result column="CURRENCY" jdbcType="NVARCHAR" property="currency" />
    <result column="PROJECT" jdbcType="NVARCHAR" property="project" />
    <result column="RATE" jdbcType="DECIMAL" property="rate" />
    <result column="LOTNUM" jdbcType="NVARCHAR" property="lotnum" />
    <result column="CALNUM" jdbcType="NVARCHAR" property="calnum" />
    <result column="SHIFTNUM" jdbcType="NVARCHAR" property="shiftnum" />
    <result column="SITENUM" jdbcType="NVARCHAR" property="sitenum" />
    <result column="CORPNUM" jdbcType="NVARCHAR" property="corpnum" />
    <result column="CHANGEREASON" jdbcType="NVARCHAR" property="changereason" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    ID, EQNUM, DESCRIPTION, LOCATION, PARENT, SERIALNUM, ASSETNUM, STATUS, STATUSDATE, 
    VENDOR, FAILURECODE, MANUFACTURER, PURPRICE, INSTALLDATE, WARRANTYEXPDATE, TOTALCOST, 
    YTDCOST, BUDGETCOST, CLASSID, ISRUNNING, ITEMNUM, TOTDOWNTIME, LFDATE, GRADE, CHANGEDATE, 
    CHANGEBY, RUNDATE, RUNNUMBER, PRIORITY, INVCOST, CONSTRUCT, MODEL, LFNUMBER, DEPTNUM, 
    BINNUM, LFSERIAL, STOCKCOST, SERIAL, LARGETYPE, LABORNUM, PLANYEARS, APPERTAIN, CNTNUM, 
    CURRENCY, PROJECT, RATE, LOTNUM, CALNUM, SHIFTNUM, SITENUM, CORPNUM, CHANGEREASON
  </sql>
  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.EquipmentSqlExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from EQUIPMENT
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from EQUIPMENT
    where ID = #{id,jdbcType=NUMERIC}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from EQUIPMENT
    where ID = #{id,jdbcType=NUMERIC}
  </delete>
  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.EquipmentSqlExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from EQUIPMENT
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.gyee.frame.model.auto.EquipmentSql">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into EQUIPMENT (ID, EQNUM, DESCRIPTION, 
      LOCATION, PARENT, SERIALNUM, 
      ASSETNUM, STATUS, STATUSDATE, 
      VENDOR, FAILURECODE, MANUFACTURER, 
      PURPRICE, INSTALLDATE, WARRANTYEXPDATE, 
      TOTALCOST, YTDCOST, BUDGETCOST, 
      CLASSID, ISRUNNING, ITEMNUM, 
      TOTDOWNTIME, LFDATE, GRADE, 
      CHANGEDATE, CHANGEBY, RUNDATE, 
      RUNNUMBER, PRIORITY, INVCOST, 
      CONSTRUCT, MODEL, LFNUMBER, 
      DEPTNUM, BINNUM, LFSERIAL, 
      STOCKCOST, SERIAL, LARGETYPE, 
      LABORNUM, PLANYEARS, APPERTAIN, 
      CNTNUM, CURRENCY, PROJECT, 
      RATE, LOTNUM, CALNUM, 
      SHIFTNUM, SITENUM, CORPNUM, 
      CHANGEREASON)
    values (#{id,jdbcType=NUMERIC}, #{eqnum,jdbcType=NVARCHAR}, #{description,jdbcType=NVARCHAR}, 
      #{location,jdbcType=NVARCHAR}, #{parent,jdbcType=NVARCHAR}, #{serialnum,jdbcType=NVARCHAR}, 
      #{assetnum,jdbcType=NVARCHAR}, #{status,jdbcType=NVARCHAR}, #{statusdate,jdbcType=TIMESTAMP}, 
      #{vendor,jdbcType=NVARCHAR}, #{failurecode,jdbcType=NVARCHAR}, #{manufacturer,jdbcType=NVARCHAR}, 
      #{purprice,jdbcType=DECIMAL}, #{installdate,jdbcType=TIMESTAMP}, #{warrantyexpdate,jdbcType=TIMESTAMP}, 
      #{totalcost,jdbcType=DECIMAL}, #{ytdcost,jdbcType=DECIMAL}, #{budgetcost,jdbcType=DECIMAL}, 
      #{classid,jdbcType=NVARCHAR}, #{isrunning,jdbcType=NVARCHAR}, #{itemnum,jdbcType=NVARCHAR}, 
      #{totdowntime,jdbcType=DECIMAL}, #{lfdate,jdbcType=TIMESTAMP}, #{grade,jdbcType=NVARCHAR}, 
      #{changedate,jdbcType=TIMESTAMP}, #{changeby,jdbcType=NVARCHAR}, #{rundate,jdbcType=TIMESTAMP}, 
      #{runnumber,jdbcType=NVARCHAR}, #{priority,jdbcType=NUMERIC}, #{invcost,jdbcType=DECIMAL}, 
      #{construct,jdbcType=NVARCHAR}, #{model,jdbcType=NVARCHAR}, #{lfnumber,jdbcType=NVARCHAR}, 
      #{deptnum,jdbcType=NVARCHAR}, #{binnum,jdbcType=NVARCHAR}, #{lfserial,jdbcType=NVARCHAR}, 
      #{stockcost,jdbcType=DECIMAL}, #{serial,jdbcType=NVARCHAR}, #{largetype,jdbcType=NVARCHAR}, 
      #{labornum,jdbcType=NVARCHAR}, #{planyears,jdbcType=NUMERIC}, #{appertain,jdbcType=NVARCHAR}, 
      #{cntnum,jdbcType=NVARCHAR}, #{currency,jdbcType=NVARCHAR}, #{project,jdbcType=NVARCHAR}, 
      #{rate,jdbcType=DECIMAL}, #{lotnum,jdbcType=NVARCHAR}, #{calnum,jdbcType=NVARCHAR}, 
      #{shiftnum,jdbcType=NVARCHAR}, #{sitenum,jdbcType=NVARCHAR}, #{corpnum,jdbcType=NVARCHAR}, 
      #{changereason,jdbcType=NVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.EquipmentSql">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into EQUIPMENT
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="eqnum != null">
        EQNUM,
      </if>
      <if test="description != null">
        DESCRIPTION,
      </if>
      <if test="location != null">
        LOCATION,
      </if>
      <if test="parent != null">
        PARENT,
      </if>
      <if test="serialnum != null">
        SERIALNUM,
      </if>
      <if test="assetnum != null">
        ASSETNUM,
      </if>
      <if test="status != null">
        STATUS,
      </if>
      <if test="statusdate != null">
        STATUSDATE,
      </if>
      <if test="vendor != null">
        VENDOR,
      </if>
      <if test="failurecode != null">
        FAILURECODE,
      </if>
      <if test="manufacturer != null">
        MANUFACTURER,
      </if>
      <if test="purprice != null">
        PURPRICE,
      </if>
      <if test="installdate != null">
        INSTALLDATE,
      </if>
      <if test="warrantyexpdate != null">
        WARRANTYEXPDATE,
      </if>
      <if test="totalcost != null">
        TOTALCOST,
      </if>
      <if test="ytdcost != null">
        YTDCOST,
      </if>
      <if test="budgetcost != null">
        BUDGETCOST,
      </if>
      <if test="classid != null">
        CLASSID,
      </if>
      <if test="isrunning != null">
        ISRUNNING,
      </if>
      <if test="itemnum != null">
        ITEMNUM,
      </if>
      <if test="totdowntime != null">
        TOTDOWNTIME,
      </if>
      <if test="lfdate != null">
        LFDATE,
      </if>
      <if test="grade != null">
        GRADE,
      </if>
      <if test="changedate != null">
        CHANGEDATE,
      </if>
      <if test="changeby != null">
        CHANGEBY,
      </if>
      <if test="rundate != null">
        RUNDATE,
      </if>
      <if test="runnumber != null">
        RUNNUMBER,
      </if>
      <if test="priority != null">
        PRIORITY,
      </if>
      <if test="invcost != null">
        INVCOST,
      </if>
      <if test="construct != null">
        CONSTRUCT,
      </if>
      <if test="model != null">
        MODEL,
      </if>
      <if test="lfnumber != null">
        LFNUMBER,
      </if>
      <if test="deptnum != null">
        DEPTNUM,
      </if>
      <if test="binnum != null">
        BINNUM,
      </if>
      <if test="lfserial != null">
        LFSERIAL,
      </if>
      <if test="stockcost != null">
        STOCKCOST,
      </if>
      <if test="serial != null">
        SERIAL,
      </if>
      <if test="largetype != null">
        LARGETYPE,
      </if>
      <if test="labornum != null">
        LABORNUM,
      </if>
      <if test="planyears != null">
        PLANYEARS,
      </if>
      <if test="appertain != null">
        APPERTAIN,
      </if>
      <if test="cntnum != null">
        CNTNUM,
      </if>
      <if test="currency != null">
        CURRENCY,
      </if>
      <if test="project != null">
        PROJECT,
      </if>
      <if test="rate != null">
        RATE,
      </if>
      <if test="lotnum != null">
        LOTNUM,
      </if>
      <if test="calnum != null">
        CALNUM,
      </if>
      <if test="shiftnum != null">
        SHIFTNUM,
      </if>
      <if test="sitenum != null">
        SITENUM,
      </if>
      <if test="corpnum != null">
        CORPNUM,
      </if>
      <if test="changereason != null">
        CHANGEREASON,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=NUMERIC},
      </if>
      <if test="eqnum != null">
        #{eqnum,jdbcType=NVARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=NVARCHAR},
      </if>
      <if test="location != null">
        #{location,jdbcType=NVARCHAR},
      </if>
      <if test="parent != null">
        #{parent,jdbcType=NVARCHAR},
      </if>
      <if test="serialnum != null">
        #{serialnum,jdbcType=NVARCHAR},
      </if>
      <if test="assetnum != null">
        #{assetnum,jdbcType=NVARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=NVARCHAR},
      </if>
      <if test="statusdate != null">
        #{statusdate,jdbcType=TIMESTAMP},
      </if>
      <if test="vendor != null">
        #{vendor,jdbcType=NVARCHAR},
      </if>
      <if test="failurecode != null">
        #{failurecode,jdbcType=NVARCHAR},
      </if>
      <if test="manufacturer != null">
        #{manufacturer,jdbcType=NVARCHAR},
      </if>
      <if test="purprice != null">
        #{purprice,jdbcType=DECIMAL},
      </if>
      <if test="installdate != null">
        #{installdate,jdbcType=TIMESTAMP},
      </if>
      <if test="warrantyexpdate != null">
        #{warrantyexpdate,jdbcType=TIMESTAMP},
      </if>
      <if test="totalcost != null">
        #{totalcost,jdbcType=DECIMAL},
      </if>
      <if test="ytdcost != null">
        #{ytdcost,jdbcType=DECIMAL},
      </if>
      <if test="budgetcost != null">
        #{budgetcost,jdbcType=DECIMAL},
      </if>
      <if test="classid != null">
        #{classid,jdbcType=NVARCHAR},
      </if>
      <if test="isrunning != null">
        #{isrunning,jdbcType=NVARCHAR},
      </if>
      <if test="itemnum != null">
        #{itemnum,jdbcType=NVARCHAR},
      </if>
      <if test="totdowntime != null">
        #{totdowntime,jdbcType=DECIMAL},
      </if>
      <if test="lfdate != null">
        #{lfdate,jdbcType=TIMESTAMP},
      </if>
      <if test="grade != null">
        #{grade,jdbcType=NVARCHAR},
      </if>
      <if test="changedate != null">
        #{changedate,jdbcType=TIMESTAMP},
      </if>
      <if test="changeby != null">
        #{changeby,jdbcType=NVARCHAR},
      </if>
      <if test="rundate != null">
        #{rundate,jdbcType=TIMESTAMP},
      </if>
      <if test="runnumber != null">
        #{runnumber,jdbcType=NVARCHAR},
      </if>
      <if test="priority != null">
        #{priority,jdbcType=NUMERIC},
      </if>
      <if test="invcost != null">
        #{invcost,jdbcType=DECIMAL},
      </if>
      <if test="construct != null">
        #{construct,jdbcType=NVARCHAR},
      </if>
      <if test="model != null">
        #{model,jdbcType=NVARCHAR},
      </if>
      <if test="lfnumber != null">
        #{lfnumber,jdbcType=NVARCHAR},
      </if>
      <if test="deptnum != null">
        #{deptnum,jdbcType=NVARCHAR},
      </if>
      <if test="binnum != null">
        #{binnum,jdbcType=NVARCHAR},
      </if>
      <if test="lfserial != null">
        #{lfserial,jdbcType=NVARCHAR},
      </if>
      <if test="stockcost != null">
        #{stockcost,jdbcType=DECIMAL},
      </if>
      <if test="serial != null">
        #{serial,jdbcType=NVARCHAR},
      </if>
      <if test="largetype != null">
        #{largetype,jdbcType=NVARCHAR},
      </if>
      <if test="labornum != null">
        #{labornum,jdbcType=NVARCHAR},
      </if>
      <if test="planyears != null">
        #{planyears,jdbcType=NUMERIC},
      </if>
      <if test="appertain != null">
        #{appertain,jdbcType=NVARCHAR},
      </if>
      <if test="cntnum != null">
        #{cntnum,jdbcType=NVARCHAR},
      </if>
      <if test="currency != null">
        #{currency,jdbcType=NVARCHAR},
      </if>
      <if test="project != null">
        #{project,jdbcType=NVARCHAR},
      </if>
      <if test="rate != null">
        #{rate,jdbcType=DECIMAL},
      </if>
      <if test="lotnum != null">
        #{lotnum,jdbcType=NVARCHAR},
      </if>
      <if test="calnum != null">
        #{calnum,jdbcType=NVARCHAR},
      </if>
      <if test="shiftnum != null">
        #{shiftnum,jdbcType=NVARCHAR},
      </if>
      <if test="sitenum != null">
        #{sitenum,jdbcType=NVARCHAR},
      </if>
      <if test="corpnum != null">
        #{corpnum,jdbcType=NVARCHAR},
      </if>
      <if test="changereason != null">
        #{changereason,jdbcType=NVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.gyee.frame.model.auto.EquipmentSqlExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from EQUIPMENT
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update EQUIPMENT
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=NUMERIC},
      </if>
      <if test="record.eqnum != null">
        EQNUM = #{record.eqnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.description != null">
        DESCRIPTION = #{record.description,jdbcType=NVARCHAR},
      </if>
      <if test="record.location != null">
        LOCATION = #{record.location,jdbcType=NVARCHAR},
      </if>
      <if test="record.parent != null">
        PARENT = #{record.parent,jdbcType=NVARCHAR},
      </if>
      <if test="record.serialnum != null">
        SERIALNUM = #{record.serialnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.assetnum != null">
        ASSETNUM = #{record.assetnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.status != null">
        STATUS = #{record.status,jdbcType=NVARCHAR},
      </if>
      <if test="record.statusdate != null">
        STATUSDATE = #{record.statusdate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.vendor != null">
        VENDOR = #{record.vendor,jdbcType=NVARCHAR},
      </if>
      <if test="record.failurecode != null">
        FAILURECODE = #{record.failurecode,jdbcType=NVARCHAR},
      </if>
      <if test="record.manufacturer != null">
        MANUFACTURER = #{record.manufacturer,jdbcType=NVARCHAR},
      </if>
      <if test="record.purprice != null">
        PURPRICE = #{record.purprice,jdbcType=DECIMAL},
      </if>
      <if test="record.installdate != null">
        INSTALLDATE = #{record.installdate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.warrantyexpdate != null">
        WARRANTYEXPDATE = #{record.warrantyexpdate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.totalcost != null">
        TOTALCOST = #{record.totalcost,jdbcType=DECIMAL},
      </if>
      <if test="record.ytdcost != null">
        YTDCOST = #{record.ytdcost,jdbcType=DECIMAL},
      </if>
      <if test="record.budgetcost != null">
        BUDGETCOST = #{record.budgetcost,jdbcType=DECIMAL},
      </if>
      <if test="record.classid != null">
        CLASSID = #{record.classid,jdbcType=NVARCHAR},
      </if>
      <if test="record.isrunning != null">
        ISRUNNING = #{record.isrunning,jdbcType=NVARCHAR},
      </if>
      <if test="record.itemnum != null">
        ITEMNUM = #{record.itemnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.totdowntime != null">
        TOTDOWNTIME = #{record.totdowntime,jdbcType=DECIMAL},
      </if>
      <if test="record.lfdate != null">
        LFDATE = #{record.lfdate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.grade != null">
        GRADE = #{record.grade,jdbcType=NVARCHAR},
      </if>
      <if test="record.changedate != null">
        CHANGEDATE = #{record.changedate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.changeby != null">
        CHANGEBY = #{record.changeby,jdbcType=NVARCHAR},
      </if>
      <if test="record.rundate != null">
        RUNDATE = #{record.rundate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.runnumber != null">
        RUNNUMBER = #{record.runnumber,jdbcType=NVARCHAR},
      </if>
      <if test="record.priority != null">
        PRIORITY = #{record.priority,jdbcType=NUMERIC},
      </if>
      <if test="record.invcost != null">
        INVCOST = #{record.invcost,jdbcType=DECIMAL},
      </if>
      <if test="record.construct != null">
        CONSTRUCT = #{record.construct,jdbcType=NVARCHAR},
      </if>
      <if test="record.model != null">
        MODEL = #{record.model,jdbcType=NVARCHAR},
      </if>
      <if test="record.lfnumber != null">
        LFNUMBER = #{record.lfnumber,jdbcType=NVARCHAR},
      </if>
      <if test="record.deptnum != null">
        DEPTNUM = #{record.deptnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.binnum != null">
        BINNUM = #{record.binnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.lfserial != null">
        LFSERIAL = #{record.lfserial,jdbcType=NVARCHAR},
      </if>
      <if test="record.stockcost != null">
        STOCKCOST = #{record.stockcost,jdbcType=DECIMAL},
      </if>
      <if test="record.serial != null">
        SERIAL = #{record.serial,jdbcType=NVARCHAR},
      </if>
      <if test="record.largetype != null">
        LARGETYPE = #{record.largetype,jdbcType=NVARCHAR},
      </if>
      <if test="record.labornum != null">
        LABORNUM = #{record.labornum,jdbcType=NVARCHAR},
      </if>
      <if test="record.planyears != null">
        PLANYEARS = #{record.planyears,jdbcType=NUMERIC},
      </if>
      <if test="record.appertain != null">
        APPERTAIN = #{record.appertain,jdbcType=NVARCHAR},
      </if>
      <if test="record.cntnum != null">
        CNTNUM = #{record.cntnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.currency != null">
        CURRENCY = #{record.currency,jdbcType=NVARCHAR},
      </if>
      <if test="record.project != null">
        PROJECT = #{record.project,jdbcType=NVARCHAR},
      </if>
      <if test="record.rate != null">
        RATE = #{record.rate,jdbcType=DECIMAL},
      </if>
      <if test="record.lotnum != null">
        LOTNUM = #{record.lotnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.calnum != null">
        CALNUM = #{record.calnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.shiftnum != null">
        SHIFTNUM = #{record.shiftnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.sitenum != null">
        SITENUM = #{record.sitenum,jdbcType=NVARCHAR},
      </if>
      <if test="record.corpnum != null">
        CORPNUM = #{record.corpnum,jdbcType=NVARCHAR},
      </if>
      <if test="record.changereason != null">
        CHANGEREASON = #{record.changereason,jdbcType=NVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update EQUIPMENT
    set ID = #{record.id,jdbcType=NUMERIC},
      EQNUM = #{record.eqnum,jdbcType=NVARCHAR},
      DESCRIPTION = #{record.description,jdbcType=NVARCHAR},
      LOCATION = #{record.location,jdbcType=NVARCHAR},
      PARENT = #{record.parent,jdbcType=NVARCHAR},
      SERIALNUM = #{record.serialnum,jdbcType=NVARCHAR},
      ASSETNUM = #{record.assetnum,jdbcType=NVARCHAR},
      STATUS = #{record.status,jdbcType=NVARCHAR},
      STATUSDATE = #{record.statusdate,jdbcType=TIMESTAMP},
      VENDOR = #{record.vendor,jdbcType=NVARCHAR},
      FAILURECODE = #{record.failurecode,jdbcType=NVARCHAR},
      MANUFACTURER = #{record.manufacturer,jdbcType=NVARCHAR},
      PURPRICE = #{record.purprice,jdbcType=DECIMAL},
      INSTALLDATE = #{record.installdate,jdbcType=TIMESTAMP},
      WARRANTYEXPDATE = #{record.warrantyexpdate,jdbcType=TIMESTAMP},
      TOTALCOST = #{record.totalcost,jdbcType=DECIMAL},
      YTDCOST = #{record.ytdcost,jdbcType=DECIMAL},
      BUDGETCOST = #{record.budgetcost,jdbcType=DECIMAL},
      CLASSID = #{record.classid,jdbcType=NVARCHAR},
      ISRUNNING = #{record.isrunning,jdbcType=NVARCHAR},
      ITEMNUM = #{record.itemnum,jdbcType=NVARCHAR},
      TOTDOWNTIME = #{record.totdowntime,jdbcType=DECIMAL},
      LFDATE = #{record.lfdate,jdbcType=TIMESTAMP},
      GRADE = #{record.grade,jdbcType=NVARCHAR},
      CHANGEDATE = #{record.changedate,jdbcType=TIMESTAMP},
      CHANGEBY = #{record.changeby,jdbcType=NVARCHAR},
      RUNDATE = #{record.rundate,jdbcType=TIMESTAMP},
      RUNNUMBER = #{record.runnumber,jdbcType=NVARCHAR},
      PRIORITY = #{record.priority,jdbcType=NUMERIC},
      INVCOST = #{record.invcost,jdbcType=DECIMAL},
      CONSTRUCT = #{record.construct,jdbcType=NVARCHAR},
      MODEL = #{record.model,jdbcType=NVARCHAR},
      LFNUMBER = #{record.lfnumber,jdbcType=NVARCHAR},
      DEPTNUM = #{record.deptnum,jdbcType=NVARCHAR},
      BINNUM = #{record.binnum,jdbcType=NVARCHAR},
      LFSERIAL = #{record.lfserial,jdbcType=NVARCHAR},
      STOCKCOST = #{record.stockcost,jdbcType=DECIMAL},
      SERIAL = #{record.serial,jdbcType=NVARCHAR},
      LARGETYPE = #{record.largetype,jdbcType=NVARCHAR},
      LABORNUM = #{record.labornum,jdbcType=NVARCHAR},
      PLANYEARS = #{record.planyears,jdbcType=NUMERIC},
      APPERTAIN = #{record.appertain,jdbcType=NVARCHAR},
      CNTNUM = #{record.cntnum,jdbcType=NVARCHAR},
      CURRENCY = #{record.currency,jdbcType=NVARCHAR},
      PROJECT = #{record.project,jdbcType=NVARCHAR},
      RATE = #{record.rate,jdbcType=DECIMAL},
      LOTNUM = #{record.lotnum,jdbcType=NVARCHAR},
      CALNUM = #{record.calnum,jdbcType=NVARCHAR},
      SHIFTNUM = #{record.shiftnum,jdbcType=NVARCHAR},
      SITENUM = #{record.sitenum,jdbcType=NVARCHAR},
      CORPNUM = #{record.corpnum,jdbcType=NVARCHAR},
      CHANGEREASON = #{record.changereason,jdbcType=NVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.EquipmentSql">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update EQUIPMENT
    <set>
      <if test="eqnum != null">
        EQNUM = #{eqnum,jdbcType=NVARCHAR},
      </if>
      <if test="description != null">
        DESCRIPTION = #{description,jdbcType=NVARCHAR},
      </if>
      <if test="location != null">
        LOCATION = #{location,jdbcType=NVARCHAR},
      </if>
      <if test="parent != null">
        PARENT = #{parent,jdbcType=NVARCHAR},
      </if>
      <if test="serialnum != null">
        SERIALNUM = #{serialnum,jdbcType=NVARCHAR},
      </if>
      <if test="assetnum != null">
        ASSETNUM = #{assetnum,jdbcType=NVARCHAR},
      </if>
      <if test="status != null">
        STATUS = #{status,jdbcType=NVARCHAR},
      </if>
      <if test="statusdate != null">
        STATUSDATE = #{statusdate,jdbcType=TIMESTAMP},
      </if>
      <if test="vendor != null">
        VENDOR = #{vendor,jdbcType=NVARCHAR},
      </if>
      <if test="failurecode != null">
        FAILURECODE = #{failurecode,jdbcType=NVARCHAR},
      </if>
      <if test="manufacturer != null">
        MANUFACTURER = #{manufacturer,jdbcType=NVARCHAR},
      </if>
      <if test="purprice != null">
        PURPRICE = #{purprice,jdbcType=DECIMAL},
      </if>
      <if test="installdate != null">
        INSTALLDATE = #{installdate,jdbcType=TIMESTAMP},
      </if>
      <if test="warrantyexpdate != null">
        WARRANTYEXPDATE = #{warrantyexpdate,jdbcType=TIMESTAMP},
      </if>
      <if test="totalcost != null">
        TOTALCOST = #{totalcost,jdbcType=DECIMAL},
      </if>
      <if test="ytdcost != null">
        YTDCOST = #{ytdcost,jdbcType=DECIMAL},
      </if>
      <if test="budgetcost != null">
        BUDGETCOST = #{budgetcost,jdbcType=DECIMAL},
      </if>
      <if test="classid != null">
        CLASSID = #{classid,jdbcType=NVARCHAR},
      </if>
      <if test="isrunning != null">
        ISRUNNING = #{isrunning,jdbcType=NVARCHAR},
      </if>
      <if test="itemnum != null">
        ITEMNUM = #{itemnum,jdbcType=NVARCHAR},
      </if>
      <if test="totdowntime != null">
        TOTDOWNTIME = #{totdowntime,jdbcType=DECIMAL},
      </if>
      <if test="lfdate != null">
        LFDATE = #{lfdate,jdbcType=TIMESTAMP},
      </if>
      <if test="grade != null">
        GRADE = #{grade,jdbcType=NVARCHAR},
      </if>
      <if test="changedate != null">
        CHANGEDATE = #{changedate,jdbcType=TIMESTAMP},
      </if>
      <if test="changeby != null">
        CHANGEBY = #{changeby,jdbcType=NVARCHAR},
      </if>
      <if test="rundate != null">
        RUNDATE = #{rundate,jdbcType=TIMESTAMP},
      </if>
      <if test="runnumber != null">
        RUNNUMBER = #{runnumber,jdbcType=NVARCHAR},
      </if>
      <if test="priority != null">
        PRIORITY = #{priority,jdbcType=NUMERIC},
      </if>
      <if test="invcost != null">
        INVCOST = #{invcost,jdbcType=DECIMAL},
      </if>
      <if test="construct != null">
        CONSTRUCT = #{construct,jdbcType=NVARCHAR},
      </if>
      <if test="model != null">
        MODEL = #{model,jdbcType=NVARCHAR},
      </if>
      <if test="lfnumber != null">
        LFNUMBER = #{lfnumber,jdbcType=NVARCHAR},
      </if>
      <if test="deptnum != null">
        DEPTNUM = #{deptnum,jdbcType=NVARCHAR},
      </if>
      <if test="binnum != null">
        BINNUM = #{binnum,jdbcType=NVARCHAR},
      </if>
      <if test="lfserial != null">
        LFSERIAL = #{lfserial,jdbcType=NVARCHAR},
      </if>
      <if test="stockcost != null">
        STOCKCOST = #{stockcost,jdbcType=DECIMAL},
      </if>
      <if test="serial != null">
        SERIAL = #{serial,jdbcType=NVARCHAR},
      </if>
      <if test="largetype != null">
        LARGETYPE = #{largetype,jdbcType=NVARCHAR},
      </if>
      <if test="labornum != null">
        LABORNUM = #{labornum,jdbcType=NVARCHAR},
      </if>
      <if test="planyears != null">
        PLANYEARS = #{planyears,jdbcType=NUMERIC},
      </if>
      <if test="appertain != null">
        APPERTAIN = #{appertain,jdbcType=NVARCHAR},
      </if>
      <if test="cntnum != null">
        CNTNUM = #{cntnum,jdbcType=NVARCHAR},
      </if>
      <if test="currency != null">
        CURRENCY = #{currency,jdbcType=NVARCHAR},
      </if>
      <if test="project != null">
        PROJECT = #{project,jdbcType=NVARCHAR},
      </if>
      <if test="rate != null">
        RATE = #{rate,jdbcType=DECIMAL},
      </if>
      <if test="lotnum != null">
        LOTNUM = #{lotnum,jdbcType=NVARCHAR},
      </if>
      <if test="calnum != null">
        CALNUM = #{calnum,jdbcType=NVARCHAR},
      </if>
      <if test="shiftnum != null">
        SHIFTNUM = #{shiftnum,jdbcType=NVARCHAR},
      </if>
      <if test="sitenum != null">
        SITENUM = #{sitenum,jdbcType=NVARCHAR},
      </if>
      <if test="corpnum != null">
        CORPNUM = #{corpnum,jdbcType=NVARCHAR},
      </if>
      <if test="changereason != null">
        CHANGEREASON = #{changereason,jdbcType=NVARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=NUMERIC}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.EquipmentSql">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update EQUIPMENT
    set EQNUM = #{eqnum,jdbcType=NVARCHAR},
      DESCRIPTION = #{description,jdbcType=NVARCHAR},
      LOCATION = #{location,jdbcType=NVARCHAR},
      PARENT = #{parent,jdbcType=NVARCHAR},
      SERIALNUM = #{serialnum,jdbcType=NVARCHAR},
      ASSETNUM = #{assetnum,jdbcType=NVARCHAR},
      STATUS = #{status,jdbcType=NVARCHAR},
      STATUSDATE = #{statusdate,jdbcType=TIMESTAMP},
      VENDOR = #{vendor,jdbcType=NVARCHAR},
      FAILURECODE = #{failurecode,jdbcType=NVARCHAR},
      MANUFACTURER = #{manufacturer,jdbcType=NVARCHAR},
      PURPRICE = #{purprice,jdbcType=DECIMAL},
      INSTALLDATE = #{installdate,jdbcType=TIMESTAMP},
      WARRANTYEXPDATE = #{warrantyexpdate,jdbcType=TIMESTAMP},
      TOTALCOST = #{totalcost,jdbcType=DECIMAL},
      YTDCOST = #{ytdcost,jdbcType=DECIMAL},
      BUDGETCOST = #{budgetcost,jdbcType=DECIMAL},
      CLASSID = #{classid,jdbcType=NVARCHAR},
      ISRUNNING = #{isrunning,jdbcType=NVARCHAR},
      ITEMNUM = #{itemnum,jdbcType=NVARCHAR},
      TOTDOWNTIME = #{totdowntime,jdbcType=DECIMAL},
      LFDATE = #{lfdate,jdbcType=TIMESTAMP},
      GRADE = #{grade,jdbcType=NVARCHAR},
      CHANGEDATE = #{changedate,jdbcType=TIMESTAMP},
      CHANGEBY = #{changeby,jdbcType=NVARCHAR},
      RUNDATE = #{rundate,jdbcType=TIMESTAMP},
      RUNNUMBER = #{runnumber,jdbcType=NVARCHAR},
      PRIORITY = #{priority,jdbcType=NUMERIC},
      INVCOST = #{invcost,jdbcType=DECIMAL},
      CONSTRUCT = #{construct,jdbcType=NVARCHAR},
      MODEL = #{model,jdbcType=NVARCHAR},
      LFNUMBER = #{lfnumber,jdbcType=NVARCHAR},
      DEPTNUM = #{deptnum,jdbcType=NVARCHAR},
      BINNUM = #{binnum,jdbcType=NVARCHAR},
      LFSERIAL = #{lfserial,jdbcType=NVARCHAR},
      STOCKCOST = #{stockcost,jdbcType=DECIMAL},
      SERIAL = #{serial,jdbcType=NVARCHAR},
      LARGETYPE = #{largetype,jdbcType=NVARCHAR},
      LABORNUM = #{labornum,jdbcType=NVARCHAR},
      PLANYEARS = #{planyears,jdbcType=NUMERIC},
      APPERTAIN = #{appertain,jdbcType=NVARCHAR},
      CNTNUM = #{cntnum,jdbcType=NVARCHAR},
      CURRENCY = #{currency,jdbcType=NVARCHAR},
      PROJECT = #{project,jdbcType=NVARCHAR},
      RATE = #{rate,jdbcType=DECIMAL},
      LOTNUM = #{lotnum,jdbcType=NVARCHAR},
      CALNUM = #{calnum,jdbcType=NVARCHAR},
      SHIFTNUM = #{shiftnum,jdbcType=NVARCHAR},
      SITENUM = #{sitenum,jdbcType=NVARCHAR},
      CORPNUM = #{corpnum,jdbcType=NVARCHAR},
      CHANGEREASON = #{changereason,jdbcType=NVARCHAR}
    where ID = #{id,jdbcType=NUMERIC}
  </update>

  <select id="getEquipmentListByLocation"  resultType="com.gyee.frame.model.auto.EquipmentSql">
    SELECT 	dbo.LOCATIONS.LOCATION as location,dbo.LOCATIONS.DESCRIPTION as description,dbo.LOCSTRUCT.PARENT as parent FROM dbo.LOCATIONS,dbo.LOCSTRUCT
    where dbo.LOCSTRUCT.LOCATION=dbo.LOCATIONS.LOCATION and dbo.LOCSTRUCT.LOCATION like '${location}%'

  </select>

</mapper>