<?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.LineMapper">
  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.Line">
    <result column="id" jdbcType="VARCHAR" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="aname" jdbcType="VARCHAR" property="aname" />
    <result column="projectid" jdbcType="VARCHAR" property="projectid" />
    <result column="ordernum" jdbcType="DECIMAL" property="ordernum" />
    <result column="capacity" jdbcType="DECIMAL" property="capacity" />
    <result column="capacityunit" jdbcType="VARCHAR" property="capacityunit" />
    <result column="quantity" jdbcType="DECIMAL" property="quantity" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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">
    <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">
	  	  	      	id,
       	  	      	code,
       	  	      	name,
       	  	      	aname,
       	  	      	projectid,
       	  	      	ordernum,
       	  	      	capacity,
       	  	      	capacityunit,
       	  	    	  	quantity
       	</sql>
  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.LineExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from line
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from line
    where id = #{id,jdbcType=VARCHAR}
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from line
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.LineExample">
    delete from line
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  
  <insert id="insert" parameterType="com.gyee.frame.model.auto.Line">
    insert into line (
      	  	       id,
       	  	       code,
       	  	       name,
       	  	       aname,
       	  	       projectid,
       	  	       ordernum,
       	  	       capacity,
       	  	       capacityunit,
       	  	    	  quantity
       	    )
    values (
	  	  	      	#{id,jdbcType=VARCHAR},
       	  	      	#{code,jdbcType=VARCHAR},
       	  	      	#{name,jdbcType=VARCHAR},
       	  	      	#{aname,jdbcType=VARCHAR},
       	  	      	#{projectid,jdbcType=VARCHAR},
       	  	      	#{ordernum,jdbcType=DECIMAL},
       	  	      	#{capacity,jdbcType=DECIMAL},
       	  	      	#{capacityunit,jdbcType=VARCHAR},
       	  	    	  #{quantity,jdbcType=DECIMAL}
       	    )
  </insert>
  
  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.Line">
    insert into line
    <trim prefix="(" suffix=")" suffixOverrides=",">
          
      <if test="id != null">
        id,
      </if>
      
         
      <if test="code != null">
        code,
      </if>
      
         
      <if test="name != null">
        name,
      </if>
      
         
      <if test="aname != null">
        aname,
      </if>
      
         
      <if test="projectid != null">
        projectid,
      </if>
      
         
      <if test="ordernum != null">
        ordernum,
      </if>
      
         
      <if test="capacity != null">
        capacity,
      </if>
      
         
      <if test="capacityunit != null">
        capacityunit,
      </if>
      
         
      <if test="quantity != null">
        quantity,
      </if>
      
         </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
          <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
          <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
          <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
          <if test="aname != null">
        #{aname,jdbcType=VARCHAR},
      </if>
          <if test="projectid != null">
        #{projectid,jdbcType=VARCHAR},
      </if>
          <if test="ordernum != null">
        #{ordernum,jdbcType=DECIMAL},
      </if>
          <if test="capacity != null">
        #{capacity,jdbcType=DECIMAL},
      </if>
          <if test="capacityunit != null">
        #{capacityunit,jdbcType=VARCHAR},
      </if>
          <if test="quantity != null">
        #{quantity,jdbcType=DECIMAL},
      </if>
        </trim>
  </insert>
  
  <select id="countByExample" parameterType="com.gyee.frame.model.auto.LineExample" resultType="java.lang.Long">
    select count(*) from line
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  
  <update id="updateByExampleSelective" parameterType="map">
    update line
    <set>
          <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
          <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.aname != null">
        aname = #{record.aname,jdbcType=VARCHAR},
      </if>
          <if test="record.projectid != null">
        projectid = #{record.projectid,jdbcType=VARCHAR},
      </if>
          <if test="record.ordernum != null">
        ordernum = #{record.ordernum,jdbcType=DECIMAL},
      </if>
          <if test="record.capacity != null">
        capacity = #{record.capacity,jdbcType=DECIMAL},
      </if>
          <if test="record.capacityunit != null">
        capacityunit = #{record.capacityunit,jdbcType=VARCHAR},
      </if>
          <if test="record.quantity != null">
        quantity = #{record.quantity,jdbcType=DECIMAL},
      </if>
         
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  
  
  <update id="updateByExample" parameterType="map">
    update line
    set
            	     	 id = #{record.id,jdbcType=VARCHAR},
    	         	     	 code = #{record.code,jdbcType=VARCHAR},
    	         	     	 name = #{record.name,jdbcType=VARCHAR},
    	         	     	 aname = #{record.aname,jdbcType=VARCHAR},
    	         	     	 projectid = #{record.projectid,jdbcType=VARCHAR},
    	         	     	 ordernum = #{record.ordernum,jdbcType=DECIMAL},
    	         	     	 capacity = #{record.capacity,jdbcType=DECIMAL},
    	         	     	 capacityunit = #{record.capacityunit,jdbcType=VARCHAR},
    	         	     	 quantity = #{record.quantity,jdbcType=DECIMAL}
    	         <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  
  
      <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.Line">
    update line
    <set>
                          <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
                      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
                      <if test="aname != null">
        aname = #{aname,jdbcType=VARCHAR},
      </if>
                      <if test="projectid != null">
        projectid = #{projectid,jdbcType=VARCHAR},
      </if>
                      <if test="ordernum != null">
        ordernum = #{ordernum,jdbcType=DECIMAL},
      </if>
                      <if test="capacity != null">
        capacity = #{capacity,jdbcType=DECIMAL},
      </if>
                      <if test="capacityunit != null">
        capacityunit = #{capacityunit,jdbcType=VARCHAR},
      </if>
                      <if test="quantity != null">
        quantity = #{quantity,jdbcType=DECIMAL},
      </if>
              </set>
    where 
            id = #{id,jdbcType=VARCHAR}
                                                                          
  </update>

      	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	   	      	

  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.Line">
    update line
    set 
             	        	    	 			code = #{code,jdbcType=VARCHAR},
		     	        	    	 			name = #{name,jdbcType=VARCHAR},
		     	        	    	 			aname = #{aname,jdbcType=VARCHAR},
		     	        	    	 			projectid = #{projectid,jdbcType=VARCHAR},
		     	        	    	 			ordernum = #{ordernum,jdbcType=DECIMAL},
		     	        	    	 			capacity = #{capacity,jdbcType=DECIMAL},
		     	        	    	 			capacityunit = #{capacityunit,jdbcType=VARCHAR},
		     	        	    	 			quantity = #{quantity,jdbcType=DECIMAL}
		     	        where 
            id = #{id,jdbcType=VARCHAR}
                                                                            
  </update>
  
                                                 
</mapper>