<?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.jsh.erp.datasource.mappers.DepotItemMapper">
  <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.DepotItem">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="Id" jdbcType="BIGINT" property="id" />
    <result column="HeaderId" jdbcType="BIGINT" property="headerid" />
    <result column="MaterialId" jdbcType="BIGINT" property="materialid" />
    <result column="MUnit" jdbcType="VARCHAR" property="munit" />
    <result column="OperNumber" jdbcType="DOUBLE" property="opernumber" />
    <result column="BasicNumber" jdbcType="DOUBLE" property="basicnumber" />
    <result column="UnitPrice" jdbcType="DOUBLE" property="unitprice" />
    <result column="TaxUnitPrice" jdbcType="DOUBLE" property="taxunitprice" />
    <result column="AllPrice" jdbcType="DOUBLE" property="allprice" />
    <result column="Remark" jdbcType="VARCHAR" property="remark" />
    <result column="Img" jdbcType="VARCHAR" property="img" />
    <result column="Incidentals" jdbcType="DOUBLE" property="incidentals" />
    <result column="DepotId" jdbcType="BIGINT" property="depotid" />
    <result column="AnotherDepotId" jdbcType="BIGINT" property="anotherdepotid" />
    <result column="TaxRate" jdbcType="DOUBLE" property="taxrate" />
    <result column="TaxMoney" jdbcType="DOUBLE" property="taxmoney" />
    <result column="TaxLastMoney" jdbcType="DOUBLE" property="taxlastmoney" />
    <result column="OtherField1" jdbcType="VARCHAR" property="otherfield1" />
    <result column="OtherField2" jdbcType="VARCHAR" property="otherfield2" />
    <result column="OtherField3" jdbcType="VARCHAR" property="otherfield3" />
    <result column="OtherField4" jdbcType="VARCHAR" property="otherfield4" />
    <result column="OtherField5" jdbcType="VARCHAR" property="otherfield5" />
    <result column="MType" jdbcType="VARCHAR" property="mtype" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      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 - @mbggenerated
      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 - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    Id, HeaderId, MaterialId, MUnit, OperNumber, BasicNumber, UnitPrice, TaxUnitPrice, 
    AllPrice, Remark, Img, Incidentals, DepotId, AnotherDepotId, TaxRate, TaxMoney, TaxLastMoney, 
    OtherField1, OtherField2, OtherField3, OtherField4, OtherField5, MType
  </sql>
  <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from jsh_depotitem
    <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.Long" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from jsh_depotitem
    where Id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from jsh_depotitem
    where Id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from jsh_depotitem
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotItem">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into jsh_depotitem (Id, HeaderId, MaterialId, 
      MUnit, OperNumber, BasicNumber, 
      UnitPrice, TaxUnitPrice, AllPrice, 
      Remark, Img, Incidentals, 
      DepotId, AnotherDepotId, TaxRate, 
      TaxMoney, TaxLastMoney, OtherField1, 
      OtherField2, OtherField3, OtherField4, 
      OtherField5, MType)
    values (#{id,jdbcType=BIGINT}, #{headerid,jdbcType=BIGINT}, #{materialid,jdbcType=BIGINT}, 
      #{munit,jdbcType=VARCHAR}, #{opernumber,jdbcType=DOUBLE}, #{basicnumber,jdbcType=DOUBLE}, 
      #{unitprice,jdbcType=DOUBLE}, #{taxunitprice,jdbcType=DOUBLE}, #{allprice,jdbcType=DOUBLE}, 
      #{remark,jdbcType=VARCHAR}, #{img,jdbcType=VARCHAR}, #{incidentals,jdbcType=DOUBLE}, 
      #{depotid,jdbcType=BIGINT}, #{anotherdepotid,jdbcType=BIGINT}, #{taxrate,jdbcType=DOUBLE}, 
      #{taxmoney,jdbcType=DOUBLE}, #{taxlastmoney,jdbcType=DOUBLE}, #{otherfield1,jdbcType=VARCHAR}, 
      #{otherfield2,jdbcType=VARCHAR}, #{otherfield3,jdbcType=VARCHAR}, #{otherfield4,jdbcType=VARCHAR}, 
      #{otherfield5,jdbcType=VARCHAR}, #{mtype,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into jsh_depotitem
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        Id,
      </if>
      <if test="headerid != null">
        HeaderId,
      </if>
      <if test="materialid != null">
        MaterialId,
      </if>
      <if test="munit != null">
        MUnit,
      </if>
      <if test="opernumber != null">
        OperNumber,
      </if>
      <if test="basicnumber != null">
        BasicNumber,
      </if>
      <if test="unitprice != null">
        UnitPrice,
      </if>
      <if test="taxunitprice != null">
        TaxUnitPrice,
      </if>
      <if test="allprice != null">
        AllPrice,
      </if>
      <if test="remark != null">
        Remark,
      </if>
      <if test="img != null">
        Img,
      </if>
      <if test="incidentals != null">
        Incidentals,
      </if>
      <if test="depotid != null">
        DepotId,
      </if>
      <if test="anotherdepotid != null">
        AnotherDepotId,
      </if>
      <if test="taxrate != null">
        TaxRate,
      </if>
      <if test="taxmoney != null">
        TaxMoney,
      </if>
      <if test="taxlastmoney != null">
        TaxLastMoney,
      </if>
      <if test="otherfield1 != null">
        OtherField1,
      </if>
      <if test="otherfield2 != null">
        OtherField2,
      </if>
      <if test="otherfield3 != null">
        OtherField3,
      </if>
      <if test="otherfield4 != null">
        OtherField4,
      </if>
      <if test="otherfield5 != null">
        OtherField5,
      </if>
      <if test="mtype != null">
        MType,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="headerid != null">
        #{headerid,jdbcType=BIGINT},
      </if>
      <if test="materialid != null">
        #{materialid,jdbcType=BIGINT},
      </if>
      <if test="munit != null">
        #{munit,jdbcType=VARCHAR},
      </if>
      <if test="opernumber != null">
        #{opernumber,jdbcType=DOUBLE},
      </if>
      <if test="basicnumber != null">
        #{basicnumber,jdbcType=DOUBLE},
      </if>
      <if test="unitprice != null">
        #{unitprice,jdbcType=DOUBLE},
      </if>
      <if test="taxunitprice != null">
        #{taxunitprice,jdbcType=DOUBLE},
      </if>
      <if test="allprice != null">
        #{allprice,jdbcType=DOUBLE},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="img != null">
        #{img,jdbcType=VARCHAR},
      </if>
      <if test="incidentals != null">
        #{incidentals,jdbcType=DOUBLE},
      </if>
      <if test="depotid != null">
        #{depotid,jdbcType=BIGINT},
      </if>
      <if test="anotherdepotid != null">
        #{anotherdepotid,jdbcType=BIGINT},
      </if>
      <if test="taxrate != null">
        #{taxrate,jdbcType=DOUBLE},
      </if>
      <if test="taxmoney != null">
        #{taxmoney,jdbcType=DOUBLE},
      </if>
      <if test="taxlastmoney != null">
        #{taxlastmoney,jdbcType=DOUBLE},
      </if>
      <if test="otherfield1 != null">
        #{otherfield1,jdbcType=VARCHAR},
      </if>
      <if test="otherfield2 != null">
        #{otherfield2,jdbcType=VARCHAR},
      </if>
      <if test="otherfield3 != null">
        #{otherfield3,jdbcType=VARCHAR},
      </if>
      <if test="otherfield4 != null">
        #{otherfield4,jdbcType=VARCHAR},
      </if>
      <if test="otherfield5 != null">
        #{otherfield5,jdbcType=VARCHAR},
      </if>
      <if test="mtype != null">
        #{mtype,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from jsh_depotitem
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jsh_depotitem
    <set>
      <if test="record.id != null">
        Id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.headerid != null">
        HeaderId = #{record.headerid,jdbcType=BIGINT},
      </if>
      <if test="record.materialid != null">
        MaterialId = #{record.materialid,jdbcType=BIGINT},
      </if>
      <if test="record.munit != null">
        MUnit = #{record.munit,jdbcType=VARCHAR},
      </if>
      <if test="record.opernumber != null">
        OperNumber = #{record.opernumber,jdbcType=DOUBLE},
      </if>
      <if test="record.basicnumber != null">
        BasicNumber = #{record.basicnumber,jdbcType=DOUBLE},
      </if>
      <if test="record.unitprice != null">
        UnitPrice = #{record.unitprice,jdbcType=DOUBLE},
      </if>
      <if test="record.taxunitprice != null">
        TaxUnitPrice = #{record.taxunitprice,jdbcType=DOUBLE},
      </if>
      <if test="record.allprice != null">
        AllPrice = #{record.allprice,jdbcType=DOUBLE},
      </if>
      <if test="record.remark != null">
        Remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.img != null">
        Img = #{record.img,jdbcType=VARCHAR},
      </if>
      <if test="record.incidentals != null">
        Incidentals = #{record.incidentals,jdbcType=DOUBLE},
      </if>
      <if test="record.depotid != null">
        DepotId = #{record.depotid,jdbcType=BIGINT},
      </if>
      <if test="record.anotherdepotid != null">
        AnotherDepotId = #{record.anotherdepotid,jdbcType=BIGINT},
      </if>
      <if test="record.taxrate != null">
        TaxRate = #{record.taxrate,jdbcType=DOUBLE},
      </if>
      <if test="record.taxmoney != null">
        TaxMoney = #{record.taxmoney,jdbcType=DOUBLE},
      </if>
      <if test="record.taxlastmoney != null">
        TaxLastMoney = #{record.taxlastmoney,jdbcType=DOUBLE},
      </if>
      <if test="record.otherfield1 != null">
        OtherField1 = #{record.otherfield1,jdbcType=VARCHAR},
      </if>
      <if test="record.otherfield2 != null">
        OtherField2 = #{record.otherfield2,jdbcType=VARCHAR},
      </if>
      <if test="record.otherfield3 != null">
        OtherField3 = #{record.otherfield3,jdbcType=VARCHAR},
      </if>
      <if test="record.otherfield4 != null">
        OtherField4 = #{record.otherfield4,jdbcType=VARCHAR},
      </if>
      <if test="record.otherfield5 != null">
        OtherField5 = #{record.otherfield5,jdbcType=VARCHAR},
      </if>
      <if test="record.mtype != null">
        MType = #{record.mtype,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jsh_depotitem
    set Id = #{record.id,jdbcType=BIGINT},
      HeaderId = #{record.headerid,jdbcType=BIGINT},
      MaterialId = #{record.materialid,jdbcType=BIGINT},
      MUnit = #{record.munit,jdbcType=VARCHAR},
      OperNumber = #{record.opernumber,jdbcType=DOUBLE},
      BasicNumber = #{record.basicnumber,jdbcType=DOUBLE},
      UnitPrice = #{record.unitprice,jdbcType=DOUBLE},
      TaxUnitPrice = #{record.taxunitprice,jdbcType=DOUBLE},
      AllPrice = #{record.allprice,jdbcType=DOUBLE},
      Remark = #{record.remark,jdbcType=VARCHAR},
      Img = #{record.img,jdbcType=VARCHAR},
      Incidentals = #{record.incidentals,jdbcType=DOUBLE},
      DepotId = #{record.depotid,jdbcType=BIGINT},
      AnotherDepotId = #{record.anotherdepotid,jdbcType=BIGINT},
      TaxRate = #{record.taxrate,jdbcType=DOUBLE},
      TaxMoney = #{record.taxmoney,jdbcType=DOUBLE},
      TaxLastMoney = #{record.taxlastmoney,jdbcType=DOUBLE},
      OtherField1 = #{record.otherfield1,jdbcType=VARCHAR},
      OtherField2 = #{record.otherfield2,jdbcType=VARCHAR},
      OtherField3 = #{record.otherfield3,jdbcType=VARCHAR},
      OtherField4 = #{record.otherfield4,jdbcType=VARCHAR},
      OtherField5 = #{record.otherfield5,jdbcType=VARCHAR},
      MType = #{record.mtype,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jsh_depotitem
    <set>
      <if test="headerid != null">
        HeaderId = #{headerid,jdbcType=BIGINT},
      </if>
      <if test="materialid != null">
        MaterialId = #{materialid,jdbcType=BIGINT},
      </if>
      <if test="munit != null">
        MUnit = #{munit,jdbcType=VARCHAR},
      </if>
      <if test="opernumber != null">
        OperNumber = #{opernumber,jdbcType=DOUBLE},
      </if>
      <if test="basicnumber != null">
        BasicNumber = #{basicnumber,jdbcType=DOUBLE},
      </if>
      <if test="unitprice != null">
        UnitPrice = #{unitprice,jdbcType=DOUBLE},
      </if>
      <if test="taxunitprice != null">
        TaxUnitPrice = #{taxunitprice,jdbcType=DOUBLE},
      </if>
      <if test="allprice != null">
        AllPrice = #{allprice,jdbcType=DOUBLE},
      </if>
      <if test="remark != null">
        Remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="img != null">
        Img = #{img,jdbcType=VARCHAR},
      </if>
      <if test="incidentals != null">
        Incidentals = #{incidentals,jdbcType=DOUBLE},
      </if>
      <if test="depotid != null">
        DepotId = #{depotid,jdbcType=BIGINT},
      </if>
      <if test="anotherdepotid != null">
        AnotherDepotId = #{anotherdepotid,jdbcType=BIGINT},
      </if>
      <if test="taxrate != null">
        TaxRate = #{taxrate,jdbcType=DOUBLE},
      </if>
      <if test="taxmoney != null">
        TaxMoney = #{taxmoney,jdbcType=DOUBLE},
      </if>
      <if test="taxlastmoney != null">
        TaxLastMoney = #{taxlastmoney,jdbcType=DOUBLE},
      </if>
      <if test="otherfield1 != null">
        OtherField1 = #{otherfield1,jdbcType=VARCHAR},
      </if>
      <if test="otherfield2 != null">
        OtherField2 = #{otherfield2,jdbcType=VARCHAR},
      </if>
      <if test="otherfield3 != null">
        OtherField3 = #{otherfield3,jdbcType=VARCHAR},
      </if>
      <if test="otherfield4 != null">
        OtherField4 = #{otherfield4,jdbcType=VARCHAR},
      </if>
      <if test="otherfield5 != null">
        OtherField5 = #{otherfield5,jdbcType=VARCHAR},
      </if>
      <if test="mtype != null">
        MType = #{mtype,jdbcType=VARCHAR},
      </if>
    </set>
    where Id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.DepotItem">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jsh_depotitem
    set HeaderId = #{headerid,jdbcType=BIGINT},
      MaterialId = #{materialid,jdbcType=BIGINT},
      MUnit = #{munit,jdbcType=VARCHAR},
      OperNumber = #{opernumber,jdbcType=DOUBLE},
      BasicNumber = #{basicnumber,jdbcType=DOUBLE},
      UnitPrice = #{unitprice,jdbcType=DOUBLE},
      TaxUnitPrice = #{taxunitprice,jdbcType=DOUBLE},
      AllPrice = #{allprice,jdbcType=DOUBLE},
      Remark = #{remark,jdbcType=VARCHAR},
      Img = #{img,jdbcType=VARCHAR},
      Incidentals = #{incidentals,jdbcType=DOUBLE},
      DepotId = #{depotid,jdbcType=BIGINT},
      AnotherDepotId = #{anotherdepotid,jdbcType=BIGINT},
      TaxRate = #{taxrate,jdbcType=DOUBLE},
      TaxMoney = #{taxmoney,jdbcType=DOUBLE},
      TaxLastMoney = #{taxlastmoney,jdbcType=DOUBLE},
      OtherField1 = #{otherfield1,jdbcType=VARCHAR},
      OtherField2 = #{otherfield2,jdbcType=VARCHAR},
      OtherField3 = #{otherfield3,jdbcType=VARCHAR},
      OtherField4 = #{otherfield4,jdbcType=VARCHAR},
      OtherField5 = #{otherfield5,jdbcType=VARCHAR},
      MType = #{mtype,jdbcType=VARCHAR}
    where Id = #{id,jdbcType=BIGINT}
  </update>
</mapper>