<?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.SupplierMapper">
  <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Supplier">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="supplier" jdbcType="VARCHAR" property="supplier" />
    <result column="contacts" jdbcType="VARCHAR" property="contacts" />
    <result column="phonenum" jdbcType="VARCHAR" property="phonenum" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="description" jdbcType="VARCHAR" property="description" />
    <result column="isystem" jdbcType="TINYINT" property="isystem" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="enabled" jdbcType="BIT" property="enabled" />
    <result column="AdvanceIn" jdbcType="DECIMAL" property="advancein" />
    <result column="BeginNeedGet" jdbcType="DECIMAL" property="beginneedget" />
    <result column="BeginNeedPay" jdbcType="DECIMAL" property="beginneedpay" />
    <result column="AllNeedGet" jdbcType="DECIMAL" property="allneedget" />
    <result column="AllNeedPay" jdbcType="DECIMAL" property="allneedpay" />
    <result column="fax" jdbcType="VARCHAR" property="fax" />
    <result column="telephone" jdbcType="VARCHAR" property="telephone" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="taxNum" jdbcType="VARCHAR" property="taxnum" />
    <result column="bankName" jdbcType="VARCHAR" property="bankname" />
    <result column="accountNumber" jdbcType="VARCHAR" property="accountnumber" />
    <result column="taxRate" jdbcType="DECIMAL" property="taxrate" />
    <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
    <result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
  </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, supplier, contacts, phonenum, email, description, isystem, type, enabled, AdvanceIn, 
    BeginNeedGet, BeginNeedPay, AllNeedGet, AllNeedPay, fax, telephone, address, taxNum, 
    bankName, accountNumber, taxRate, tenant_id, delete_Flag
  </sql>
  <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SupplierExample" 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_supplier
    <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_supplier
    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_supplier
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.SupplierExample">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from jsh_supplier
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.jsh.erp.datasource.entities.Supplier">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into jsh_supplier (id, supplier, contacts, 
      phonenum, email, description, 
      isystem, type, enabled, 
      AdvanceIn, BeginNeedGet, BeginNeedPay, 
      AllNeedGet, AllNeedPay, fax, 
      telephone, address, taxNum, 
      bankName, accountNumber, taxRate, 
      tenant_id, delete_Flag)
    values (#{id,jdbcType=BIGINT}, #{supplier,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, 
      #{phonenum,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, 
      #{isystem,jdbcType=TINYINT}, #{type,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, 
      #{advancein,jdbcType=DECIMAL}, #{beginneedget,jdbcType=DECIMAL}, #{beginneedpay,jdbcType=DECIMAL}, 
      #{allneedget,jdbcType=DECIMAL}, #{allneedpay,jdbcType=DECIMAL}, #{fax,jdbcType=VARCHAR}, 
      #{telephone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{taxnum,jdbcType=VARCHAR}, 
      #{bankname,jdbcType=VARCHAR}, #{accountnumber,jdbcType=VARCHAR}, #{taxrate,jdbcType=DECIMAL}, 
      #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Supplier">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into jsh_supplier
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="supplier != null">
        supplier,
      </if>
      <if test="contacts != null">
        contacts,
      </if>
      <if test="phonenum != null">
        phonenum,
      </if>
      <if test="email != null">
        email,
      </if>
      <if test="description != null">
        description,
      </if>
      <if test="isystem != null">
        isystem,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="enabled != null">
        enabled,
      </if>
      <if test="advancein != null">
        AdvanceIn,
      </if>
      <if test="beginneedget != null">
        BeginNeedGet,
      </if>
      <if test="beginneedpay != null">
        BeginNeedPay,
      </if>
      <if test="allneedget != null">
        AllNeedGet,
      </if>
      <if test="allneedpay != null">
        AllNeedPay,
      </if>
      <if test="fax != null">
        fax,
      </if>
      <if test="telephone != null">
        telephone,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="taxnum != null">
        taxNum,
      </if>
      <if test="bankname != null">
        bankName,
      </if>
      <if test="accountnumber != null">
        accountNumber,
      </if>
      <if test="taxrate != null">
        taxRate,
      </if>
      <if test="tenantId != null">
        tenant_id,
      </if>
      <if test="deleteFlag != null">
        delete_Flag,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="supplier != null">
        #{supplier,jdbcType=VARCHAR},
      </if>
      <if test="contacts != null">
        #{contacts,jdbcType=VARCHAR},
      </if>
      <if test="phonenum != null">
        #{phonenum,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        #{email,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=VARCHAR},
      </if>
      <if test="isystem != null">
        #{isystem,jdbcType=TINYINT},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="enabled != null">
        #{enabled,jdbcType=BIT},
      </if>
      <if test="advancein != null">
        #{advancein,jdbcType=DECIMAL},
      </if>
      <if test="beginneedget != null">
        #{beginneedget,jdbcType=DECIMAL},
      </if>
      <if test="beginneedpay != null">
        #{beginneedpay,jdbcType=DECIMAL},
      </if>
      <if test="allneedget != null">
        #{allneedget,jdbcType=DECIMAL},
      </if>
      <if test="allneedpay != null">
        #{allneedpay,jdbcType=DECIMAL},
      </if>
      <if test="fax != null">
        #{fax,jdbcType=VARCHAR},
      </if>
      <if test="telephone != null">
        #{telephone,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="taxnum != null">
        #{taxnum,jdbcType=VARCHAR},
      </if>
      <if test="bankname != null">
        #{bankname,jdbcType=VARCHAR},
      </if>
      <if test="accountnumber != null">
        #{accountnumber,jdbcType=VARCHAR},
      </if>
      <if test="taxrate != null">
        #{taxrate,jdbcType=DECIMAL},
      </if>
      <if test="tenantId != null">
        #{tenantId,jdbcType=BIGINT},
      </if>
      <if test="deleteFlag != null">
        #{deleteFlag,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from jsh_supplier
    <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_supplier
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.supplier != null">
        supplier = #{record.supplier,jdbcType=VARCHAR},
      </if>
      <if test="record.contacts != null">
        contacts = #{record.contacts,jdbcType=VARCHAR},
      </if>
      <if test="record.phonenum != null">
        phonenum = #{record.phonenum,jdbcType=VARCHAR},
      </if>
      <if test="record.email != null">
        email = #{record.email,jdbcType=VARCHAR},
      </if>
      <if test="record.description != null">
        description = #{record.description,jdbcType=VARCHAR},
      </if>
      <if test="record.isystem != null">
        isystem = #{record.isystem,jdbcType=TINYINT},
      </if>
      <if test="record.type != null">
        type = #{record.type,jdbcType=VARCHAR},
      </if>
      <if test="record.enabled != null">
        enabled = #{record.enabled,jdbcType=BIT},
      </if>
      <if test="record.advancein != null">
        AdvanceIn = #{record.advancein,jdbcType=DECIMAL},
      </if>
      <if test="record.beginneedget != null">
        BeginNeedGet = #{record.beginneedget,jdbcType=DECIMAL},
      </if>
      <if test="record.beginneedpay != null">
        BeginNeedPay = #{record.beginneedpay,jdbcType=DECIMAL},
      </if>
      <if test="record.allneedget != null">
        AllNeedGet = #{record.allneedget,jdbcType=DECIMAL},
      </if>
      <if test="record.allneedpay != null">
        AllNeedPay = #{record.allneedpay,jdbcType=DECIMAL},
      </if>
      <if test="record.fax != null">
        fax = #{record.fax,jdbcType=VARCHAR},
      </if>
      <if test="record.telephone != null">
        telephone = #{record.telephone,jdbcType=VARCHAR},
      </if>
      <if test="record.address != null">
        address = #{record.address,jdbcType=VARCHAR},
      </if>
      <if test="record.taxnum != null">
        taxNum = #{record.taxnum,jdbcType=VARCHAR},
      </if>
      <if test="record.bankname != null">
        bankName = #{record.bankname,jdbcType=VARCHAR},
      </if>
      <if test="record.accountnumber != null">
        accountNumber = #{record.accountnumber,jdbcType=VARCHAR},
      </if>
      <if test="record.taxrate != null">
        taxRate = #{record.taxrate,jdbcType=DECIMAL},
      </if>
      <if test="record.tenantId != null">
        tenant_id = #{record.tenantId,jdbcType=BIGINT},
      </if>
      <if test="record.deleteFlag != null">
        delete_Flag = #{record.deleteFlag,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_supplier
    set id = #{record.id,jdbcType=BIGINT},
      supplier = #{record.supplier,jdbcType=VARCHAR},
      contacts = #{record.contacts,jdbcType=VARCHAR},
      phonenum = #{record.phonenum,jdbcType=VARCHAR},
      email = #{record.email,jdbcType=VARCHAR},
      description = #{record.description,jdbcType=VARCHAR},
      isystem = #{record.isystem,jdbcType=TINYINT},
      type = #{record.type,jdbcType=VARCHAR},
      enabled = #{record.enabled,jdbcType=BIT},
      AdvanceIn = #{record.advancein,jdbcType=DECIMAL},
      BeginNeedGet = #{record.beginneedget,jdbcType=DECIMAL},
      BeginNeedPay = #{record.beginneedpay,jdbcType=DECIMAL},
      AllNeedGet = #{record.allneedget,jdbcType=DECIMAL},
      AllNeedPay = #{record.allneedpay,jdbcType=DECIMAL},
      fax = #{record.fax,jdbcType=VARCHAR},
      telephone = #{record.telephone,jdbcType=VARCHAR},
      address = #{record.address,jdbcType=VARCHAR},
      taxNum = #{record.taxnum,jdbcType=VARCHAR},
      bankName = #{record.bankname,jdbcType=VARCHAR},
      accountNumber = #{record.accountnumber,jdbcType=VARCHAR},
      taxRate = #{record.taxrate,jdbcType=DECIMAL},
      tenant_id = #{record.tenantId,jdbcType=BIGINT},
      delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Supplier">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jsh_supplier
    <set>
      <if test="supplier != null">
        supplier = #{supplier,jdbcType=VARCHAR},
      </if>
      <if test="contacts != null">
        contacts = #{contacts,jdbcType=VARCHAR},
      </if>
      <if test="phonenum != null">
        phonenum = #{phonenum,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        email = #{email,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        description = #{description,jdbcType=VARCHAR},
      </if>
      <if test="isystem != null">
        isystem = #{isystem,jdbcType=TINYINT},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="enabled != null">
        enabled = #{enabled,jdbcType=BIT},
      </if>
      <if test="advancein != null">
        AdvanceIn = #{advancein,jdbcType=DECIMAL},
      </if>
      <if test="beginneedget != null">
        BeginNeedGet = #{beginneedget,jdbcType=DECIMAL},
      </if>
      <if test="beginneedpay != null">
        BeginNeedPay = #{beginneedpay,jdbcType=DECIMAL},
      </if>
      <if test="allneedget != null">
        AllNeedGet = #{allneedget,jdbcType=DECIMAL},
      </if>
      <if test="allneedpay != null">
        AllNeedPay = #{allneedpay,jdbcType=DECIMAL},
      </if>
      <if test="fax != null">
        fax = #{fax,jdbcType=VARCHAR},
      </if>
      <if test="telephone != null">
        telephone = #{telephone,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="taxnum != null">
        taxNum = #{taxnum,jdbcType=VARCHAR},
      </if>
      <if test="bankname != null">
        bankName = #{bankname,jdbcType=VARCHAR},
      </if>
      <if test="accountnumber != null">
        accountNumber = #{accountnumber,jdbcType=VARCHAR},
      </if>
      <if test="taxrate != null">
        taxRate = #{taxrate,jdbcType=DECIMAL},
      </if>
      <if test="tenantId != null">
        tenant_id = #{tenantId,jdbcType=BIGINT},
      </if>
      <if test="deleteFlag != null">
        delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Supplier">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jsh_supplier
    set supplier = #{supplier,jdbcType=VARCHAR},
      contacts = #{contacts,jdbcType=VARCHAR},
      phonenum = #{phonenum,jdbcType=VARCHAR},
      email = #{email,jdbcType=VARCHAR},
      description = #{description,jdbcType=VARCHAR},
      isystem = #{isystem,jdbcType=TINYINT},
      type = #{type,jdbcType=VARCHAR},
      enabled = #{enabled,jdbcType=BIT},
      AdvanceIn = #{advancein,jdbcType=DECIMAL},
      BeginNeedGet = #{beginneedget,jdbcType=DECIMAL},
      BeginNeedPay = #{beginneedpay,jdbcType=DECIMAL},
      AllNeedGet = #{allneedget,jdbcType=DECIMAL},
      AllNeedPay = #{allneedpay,jdbcType=DECIMAL},
      fax = #{fax,jdbcType=VARCHAR},
      telephone = #{telephone,jdbcType=VARCHAR},
      address = #{address,jdbcType=VARCHAR},
      taxNum = #{taxnum,jdbcType=VARCHAR},
      bankName = #{bankname,jdbcType=VARCHAR},
      accountNumber = #{accountnumber,jdbcType=VARCHAR},
      taxRate = #{taxrate,jdbcType=DECIMAL},
      tenant_id = #{tenantId,jdbcType=BIGINT},
      delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>