<?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.tmerclub.cloud.supplier.mapper.SupplierExtensionMapper">
  <resultMap id="supplierExtensionMap" type="com.tmerclub.cloud.supplier.model.SupplierExtension">
    <id column="supplier_extension_id" property="supplierExtensionId" />
    <result column="supplier_id" property="supplierId"/>
    <result column="create_time" property="createTime"/>
    <result column="update_time" property="updateTime"/>
    <result column="sale_num" property="saleNum"/>
  </resultMap>
  <sql id="Vo_Column_List">
    `supplier_extension_id`,`supplier_id`,`create_time`,`update_time`,`sale_num`
  </sql>
  <insert id="save">
    insert into supplier_extension (`supplier_id`)
    values (#{supplierExtension.supplierId});
  </insert>
  <update id="update">
    update supplier_extension
    <set>
      <if test="supplierExtension.saleNum != null">
        `sale_num` = #{supplierExtension.saleNum},
      </if>
    </set>
    where supplier_Id = #{supplierExtension.supplierId}
  </update>
</mapper>
