<?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.zjt.mapper.cgmaterialMapper" >
  <resultMap id="BaseResultMap" type="com.zjt.entity.cgmaterial" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="username" property="username" jdbcType="VARCHAR" />
    <result column="materialCode" property="materialcode" jdbcType="VARCHAR" />
    <result column="materialDetile" property="materialdetile" jdbcType="VARCHAR" />
    <result column="price" property="price" jdbcType="VARCHAR" />
    <result column="SPH" property="sph" jdbcType="VARCHAR" />
    <result column="CYL" property="cyl" jdbcType="VARCHAR" />
    <result column="AXIS" property="axis" jdbcType="VARCHAR" />
    <result column="PDFOD" property="pdfod" jdbcType="VARCHAR" />
    <result column="PH" property="ph" jdbcType="VARCHAR" />
    <result column="XADD" property="xadd" jdbcType="VARCHAR" />
    <result column="PRISM" property="prism" jdbcType="VARCHAR" />
    <result column="CVA" property="cva" jdbcType="VARCHAR" />
    <result column="OPTICBC" property="opticbc" jdbcType="VARCHAR" />
    <result column="RS" property="rs" jdbcType="VARCHAR" />
    <result column="SD" property="sd" jdbcType="VARCHAR" />
    <result column="LRS" property="lrs" jdbcType="VARCHAR" />
    <result column="CRS" property="crs" jdbcType="VARCHAR" />
    <result column="BRS" property="brs" jdbcType="VARCHAR" />
    <result column="MPRO" property="mpro" jdbcType="VARCHAR" />
    <result column="LBPO" property="lbpo" jdbcType="VARCHAR" />
    <result column="FRAMESHAPE" property="frameshape" jdbcType="VARCHAR" />
    <result column="FRAMEHEIGHT" property="frameheight" jdbcType="VARCHAR" />
    <result column="FRAMEBRIDGEWIDTH" property="framebridgewidth" jdbcType="VARCHAR" />
    <result column="SPK" property="spk" jdbcType="VARCHAR" />
    <result column="JFRAMESHAPE" property="jframeshape" jdbcType="VARCHAR" />
    <result column="COLOR" property="color" jdbcType="VARCHAR" />
    <result column="lEN_DIAMETER" property="lenDiameter" jdbcType="VARCHAR" />
    <result column="PX" property="px" jdbcType="VARCHAR" />
    <result column="PS" property="ps" jdbcType="VARCHAR" />
    <result column="MARK" property="mark" jdbcType="VARCHAR" />
    <result column="WZ" property="wz" jdbcType="VARCHAR" />
    <result column="CREATETIME" property="createtime" jdbcType="TIMESTAMP" />
    <result column="STORE" property="store" jdbcType="VARCHAR" />
    <result column="NUM" property="num" jdbcType="INTEGER" />
    <result column="YULIU1" property="yuliu1" jdbcType="VARCHAR" />
    <result column="LY" property="ly" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, username, materialCode, materialDetile, price, SPH, CYL, AXIS, PDFOD, PH, XADD,
    PRISM, CVA, OPTICBC, RS, SD, LRS, CRS, BRS, MPRO, LBPO, FRAMESHAPE, FRAMEHEIGHT,
    FRAMEBRIDGEWIDTH, SPK, JFRAMESHAPE, COLOR, lEN_DIAMETER, PX, PS, MARK, WZ, CREATETIME,
    STORE, NUM, YULIU1, LY
  </sql>
<!--  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >-->
<!--    select-->
<!--    <include refid="Base_Column_List" />-->
<!--    from b_cg_material-->
<!--    where id = #{id,jdbcType=BIGINT}-->
<!--  </select>-->
<!--  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >-->
<!--    delete from b_cg_material-->
<!--    where id = #{id,jdbcType=BIGINT}-->
<!--  </delete>-->
  <insert id="insert" parameterType="com.zjt.entity.cgmaterial" >
    insert into b_cg_material (id, username, materialCode,
      materialDetile, price, SPH,
      CYL, AXIS, PDFOD, PH,
      XADD, PRISM, CVA, OPTICBC,
      RS, SD, LRS, CRS,
      BRS, MPRO, LBPO, FRAMESHAPE,
      FRAMEHEIGHT, FRAMEBRIDGEWIDTH, SPK,
      JFRAMESHAPE, COLOR, lEN_DIAMETER,
      PX, PS, MARK, WZ,
      CREATETIME, STORE, NUM,
      YULIU1, LY)
    values (#{id,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, #{materialcode,jdbcType=VARCHAR},
      #{materialdetile,jdbcType=VARCHAR}, #{price,jdbcType=VARCHAR}, #{sph,jdbcType=VARCHAR},
      #{cyl,jdbcType=VARCHAR}, #{axis,jdbcType=VARCHAR}, #{pdfod,jdbcType=VARCHAR}, #{ph,jdbcType=VARCHAR},
      #{xadd,jdbcType=VARCHAR}, #{prism,jdbcType=VARCHAR}, #{cva,jdbcType=VARCHAR}, #{opticbc,jdbcType=VARCHAR},
      #{rs,jdbcType=VARCHAR}, #{sd,jdbcType=VARCHAR}, #{lrs,jdbcType=VARCHAR}, #{crs,jdbcType=VARCHAR},
      #{brs,jdbcType=VARCHAR}, #{mpro,jdbcType=VARCHAR}, #{lbpo,jdbcType=VARCHAR}, #{frameshape,jdbcType=VARCHAR},
      #{frameheight,jdbcType=VARCHAR}, #{framebridgewidth,jdbcType=VARCHAR}, #{spk,jdbcType=VARCHAR},
      #{jframeshape,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, #{lenDiameter,jdbcType=VARCHAR},
      #{px,jdbcType=VARCHAR}, #{ps,jdbcType=VARCHAR}, #{mark,jdbcType=VARCHAR}, #{wz,jdbcType=VARCHAR},
      #{createtime,jdbcType=TIMESTAMP}, #{store,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER},
      #{yuliu1,jdbcType=VARCHAR}, #{ly,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zjt.entity.cgmaterial" >
    insert into b_cg_material
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="username != null" >
        username,
      </if>
      <if test="materialcode != null" >
        materialCode,
      </if>
      <if test="materialdetile != null" >
        materialDetile,
      </if>
      <if test="price != null" >
        price,
      </if>
      <if test="sph != null" >
        SPH,
      </if>
      <if test="cyl != null" >
        CYL,
      </if>
      <if test="axis != null" >
        AXIS,
      </if>
      <if test="pdfod != null" >
        PDFOD,
      </if>
      <if test="ph != null" >
        PH,
      </if>
      <if test="xadd != null" >
        XADD,
      </if>
      <if test="prism != null" >
        PRISM,
      </if>
      <if test="cva != null" >
        CVA,
      </if>
      <if test="opticbc != null" >
        OPTICBC,
      </if>
      <if test="rs != null" >
        RS,
      </if>
      <if test="sd != null" >
        SD,
      </if>
      <if test="lrs != null" >
        LRS,
      </if>
      <if test="crs != null" >
        CRS,
      </if>
      <if test="brs != null" >
        BRS,
      </if>
      <if test="mpro != null" >
        MPRO,
      </if>
      <if test="lbpo != null" >
        LBPO,
      </if>
      <if test="frameshape != null" >
        FRAMESHAPE,
      </if>
      <if test="frameheight != null" >
        FRAMEHEIGHT,
      </if>
      <if test="framebridgewidth != null" >
        FRAMEBRIDGEWIDTH,
      </if>
      <if test="spk != null" >
        SPK,
      </if>
      <if test="jframeshape != null" >
        JFRAMESHAPE,
      </if>
      <if test="color != null" >
        COLOR,
      </if>
      <if test="lenDiameter != null" >
        lEN_DIAMETER,
      </if>
      <if test="px != null" >
        PX,
      </if>
      <if test="ps != null" >
        PS,
      </if>
      <if test="mark != null" >
        MARK,
      </if>
      <if test="wz != null" >
        WZ,
      </if>
      <if test="createtime != null" >
        CREATETIME,
      </if>
      <if test="store != null" >
        STORE,
      </if>
      <if test="num != null" >
        NUM,
      </if>
      <if test="yuliu1 != null" >
        YULIU1,
      </if>
      <if test="ly != null" >
        LY,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="username != null" >
        #{username,jdbcType=VARCHAR},
      </if>
      <if test="materialcode != null" >
        #{materialcode,jdbcType=VARCHAR},
      </if>
      <if test="materialdetile != null" >
        #{materialdetile,jdbcType=VARCHAR},
      </if>
      <if test="price != null" >
        #{price,jdbcType=VARCHAR},
      </if>
      <if test="sph != null" >
        #{sph,jdbcType=VARCHAR},
      </if>
      <if test="cyl != null" >
        #{cyl,jdbcType=VARCHAR},
      </if>
      <if test="axis != null" >
        #{axis,jdbcType=VARCHAR},
      </if>
      <if test="pdfod != null" >
        #{pdfod,jdbcType=VARCHAR},
      </if>
      <if test="ph != null" >
        #{ph,jdbcType=VARCHAR},
      </if>
      <if test="xadd != null" >
        #{xadd,jdbcType=VARCHAR},
      </if>
      <if test="prism != null" >
        #{prism,jdbcType=VARCHAR},
      </if>
      <if test="cva != null" >
        #{cva,jdbcType=VARCHAR},
      </if>
      <if test="opticbc != null" >
        #{opticbc,jdbcType=VARCHAR},
      </if>
      <if test="rs != null" >
        #{rs,jdbcType=VARCHAR},
      </if>
      <if test="sd != null" >
        #{sd,jdbcType=VARCHAR},
      </if>
      <if test="lrs != null" >
        #{lrs,jdbcType=VARCHAR},
      </if>
      <if test="crs != null" >
        #{crs,jdbcType=VARCHAR},
      </if>
      <if test="brs != null" >
        #{brs,jdbcType=VARCHAR},
      </if>
      <if test="mpro != null" >
        #{mpro,jdbcType=VARCHAR},
      </if>
      <if test="lbpo != null" >
        #{lbpo,jdbcType=VARCHAR},
      </if>
      <if test="frameshape != null" >
        #{frameshape,jdbcType=VARCHAR},
      </if>
      <if test="frameheight != null" >
        #{frameheight,jdbcType=VARCHAR},
      </if>
      <if test="framebridgewidth != null" >
        #{framebridgewidth,jdbcType=VARCHAR},
      </if>
      <if test="spk != null" >
        #{spk,jdbcType=VARCHAR},
      </if>
      <if test="jframeshape != null" >
        #{jframeshape,jdbcType=VARCHAR},
      </if>
      <if test="color != null" >
        #{color,jdbcType=VARCHAR},
      </if>
      <if test="lenDiameter != null" >
        #{lenDiameter,jdbcType=VARCHAR},
      </if>
      <if test="px != null" >
        #{px,jdbcType=VARCHAR},
      </if>
      <if test="ps != null" >
        #{ps,jdbcType=VARCHAR},
      </if>
      <if test="mark != null" >
        #{mark,jdbcType=VARCHAR},
      </if>
      <if test="wz != null" >
        #{wz,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null" >
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="store != null" >
        #{store,jdbcType=VARCHAR},
      </if>
      <if test="num != null" >
        #{num,jdbcType=INTEGER},
      </if>
      <if test="yuliu1 != null" >
        #{yuliu1,jdbcType=VARCHAR},
      </if>
      <if test="ly != null" >
        #{ly,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.zjt.entity.cgmaterial" >
    update b_cg_material
    <set >
      <if test="username != null" >
        username = #{username,jdbcType=VARCHAR},
      </if>
      <if test="materialcode != null" >
        materialCode = #{materialcode,jdbcType=VARCHAR},
      </if>
      <if test="materialdetile != null" >
        materialDetile = #{materialdetile,jdbcType=VARCHAR},
      </if>
      <if test="price != null" >
        price = #{price,jdbcType=VARCHAR},
      </if>
      <if test="sph != null" >
        SPH = #{sph,jdbcType=VARCHAR},
      </if>
      <if test="cyl != null" >
        CYL = #{cyl,jdbcType=VARCHAR},
      </if>
      <if test="axis != null" >
        AXIS = #{axis,jdbcType=VARCHAR},
      </if>
      <if test="pdfod != null" >
        PDFOD = #{pdfod,jdbcType=VARCHAR},
      </if>
      <if test="ph != null" >
        PH = #{ph,jdbcType=VARCHAR},
      </if>
      <if test="xadd != null" >
        XADD = #{xadd,jdbcType=VARCHAR},
      </if>
      <if test="prism != null" >
        PRISM = #{prism,jdbcType=VARCHAR},
      </if>
      <if test="cva != null" >
        CVA = #{cva,jdbcType=VARCHAR},
      </if>
      <if test="opticbc != null" >
        OPTICBC = #{opticbc,jdbcType=VARCHAR},
      </if>
      <if test="rs != null" >
        RS = #{rs,jdbcType=VARCHAR},
      </if>
      <if test="sd != null" >
        SD = #{sd,jdbcType=VARCHAR},
      </if>
      <if test="lrs != null" >
        LRS = #{lrs,jdbcType=VARCHAR},
      </if>
      <if test="crs != null" >
        CRS = #{crs,jdbcType=VARCHAR},
      </if>
      <if test="brs != null" >
        BRS = #{brs,jdbcType=VARCHAR},
      </if>
      <if test="mpro != null" >
        MPRO = #{mpro,jdbcType=VARCHAR},
      </if>
      <if test="lbpo != null" >
        LBPO = #{lbpo,jdbcType=VARCHAR},
      </if>
      <if test="frameshape != null" >
        FRAMESHAPE = #{frameshape,jdbcType=VARCHAR},
      </if>
      <if test="frameheight != null" >
        FRAMEHEIGHT = #{frameheight,jdbcType=VARCHAR},
      </if>
      <if test="framebridgewidth != null" >
        FRAMEBRIDGEWIDTH = #{framebridgewidth,jdbcType=VARCHAR},
      </if>
      <if test="spk != null" >
        SPK = #{spk,jdbcType=VARCHAR},
      </if>
      <if test="jframeshape != null" >
        JFRAMESHAPE = #{jframeshape,jdbcType=VARCHAR},
      </if>
      <if test="color != null" >
        COLOR = #{color,jdbcType=VARCHAR},
      </if>
      <if test="lenDiameter != null" >
        lEN_DIAMETER = #{lenDiameter,jdbcType=VARCHAR},
      </if>
      <if test="px != null" >
        PX = #{px,jdbcType=VARCHAR},
      </if>
      <if test="ps != null" >
        PS = #{ps,jdbcType=VARCHAR},
      </if>
      <if test="mark != null" >
        MARK = #{mark,jdbcType=VARCHAR},
      </if>
      <if test="wz != null" >
        WZ = #{wz,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null" >
        CREATETIME = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="store != null" >
        STORE = #{store,jdbcType=VARCHAR},
      </if>
      <if test="num != null" >
        NUM = #{num,jdbcType=INTEGER},
      </if>
      <if test="yuliu1 != null" >
        YULIU1 = #{yuliu1,jdbcType=VARCHAR},
      </if>
      <if test="ly != null" >
        LY = #{ly,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zjt.entity.cgmaterial" >
    update b_cg_material
    set username = #{username,jdbcType=VARCHAR},
      materialCode = #{materialcode,jdbcType=VARCHAR},
      materialDetile = #{materialdetile,jdbcType=VARCHAR},
      price = #{price,jdbcType=VARCHAR},
      SPH = #{sph,jdbcType=VARCHAR},
      CYL = #{cyl,jdbcType=VARCHAR},
      AXIS = #{axis,jdbcType=VARCHAR},
      PDFOD = #{pdfod,jdbcType=VARCHAR},
      PH = #{ph,jdbcType=VARCHAR},
      XADD = #{xadd,jdbcType=VARCHAR},
      PRISM = #{prism,jdbcType=VARCHAR},
      CVA = #{cva,jdbcType=VARCHAR},
      OPTICBC = #{opticbc,jdbcType=VARCHAR},
      RS = #{rs,jdbcType=VARCHAR},
      SD = #{sd,jdbcType=VARCHAR},
      LRS = #{lrs,jdbcType=VARCHAR},
      CRS = #{crs,jdbcType=VARCHAR},
      BRS = #{brs,jdbcType=VARCHAR},
      MPRO = #{mpro,jdbcType=VARCHAR},
      LBPO = #{lbpo,jdbcType=VARCHAR},
      FRAMESHAPE = #{frameshape,jdbcType=VARCHAR},
      FRAMEHEIGHT = #{frameheight,jdbcType=VARCHAR},
      FRAMEBRIDGEWIDTH = #{framebridgewidth,jdbcType=VARCHAR},
      SPK = #{spk,jdbcType=VARCHAR},
      JFRAMESHAPE = #{jframeshape,jdbcType=VARCHAR},
      COLOR = #{color,jdbcType=VARCHAR},
      lEN_DIAMETER = #{lenDiameter,jdbcType=VARCHAR},
      PX = #{px,jdbcType=VARCHAR},
      PS = #{ps,jdbcType=VARCHAR},
      MARK = #{mark,jdbcType=VARCHAR},
      WZ = #{wz,jdbcType=VARCHAR},
      CREATETIME = #{createtime,jdbcType=TIMESTAMP},
      STORE = #{store,jdbcType=VARCHAR},
      NUM = #{num,jdbcType=INTEGER},
      YULIU1 = #{yuliu1,jdbcType=VARCHAR},
      LY = #{ly,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectData" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List" />
      from b_cg_material order by `createtime` asc
    </select>

  <select id="selectDataBy" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from b_cg_material
    where 1=1
     <if test="id != null and id != ''">
       and id= #{id}
     </if>
    <if test="storeCode != null and storeCode != '' and storeCode !='admin'">
      and store= #{storeCode}
    </if>
    <if test="begin != null and begin != ''">
      and createtime between #{begin}
    </if>
    <if test="end != null and end!= ''">
      and #{end}
    </if>
    <if test="receive != null and receive!= ''">
      and ly= #{receive}
    </if>
     order by `createtime` asc
  </select>

  <delete id="deldate">
     delete from b_cg_material
     where id =#{arg0} and materialCode=#{arg1}
  </delete>
</mapper>