<?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="cn.superdesk.uniorder.dao.mapper.accounting.unified.supplier.AccountingUnifiedSupplierMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplier">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="sup_dz_sn" jdbcType="VARCHAR" property="supDzSn" />
    <result column="dz_status" jdbcType="TINYINT" property="dzStatus" />
    <result column="dz_invstatus" jdbcType="TINYINT" property="dzInvstatus" />

    <result column="sale_id" jdbcType="BIGINT" property="saleId" />
    <result column="sale_name" jdbcType="VARCHAR" property="saleName" />

    <result column="inv_title" jdbcType="VARCHAR" property="invTitle" />
    <result column="tax_code" jdbcType="VARCHAR" property="taxCode" />
    <result column="inv_type" jdbcType="TINYINT" property="invType" />
    <result column="address" jdbcType="VARCHAR" property="address" />

    <result column="is_email" jdbcType="TINYINT" property="isEmail" />
    <result column="email_time" jdbcType="TIMESTAMP" property="emailTime" />

    <result column="star_time" jdbcType="TIMESTAMP" property="starTime" />
    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />

    <result column="back_account_status" jdbcType="TINYINT" property="backAccountStatus" />

    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_user_id" jdbcType="BIGINT" property="updateUserId" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    <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">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    <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">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    id, sup_dz_sn, dz_status, dz_invstatus, sale_id, sale_name, inv_title, tax_code, 
    inv_type, address, is_email, email_time, star_time, end_time, back_account_status, 
    create_time, create_user_id, update_time, update_user_id
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierExample" resultMap="BaseResultMap">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from accounting_unified_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">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    select 
    <include refid="Base_Column_List" />
    from accounting_unified_supplier
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    delete from accounting_unified_supplier
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierExample">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    delete from accounting_unified_supplier
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplier">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into accounting_unified_supplier (sup_dz_sn, dz_status, dz_invstatus, 
      sale_id, sale_name, inv_title, 
      tax_code, inv_type, address, 
      is_email, email_time, star_time, 
      end_time, back_account_status, create_time, 
      create_user_id, update_time, update_user_id
      )
    values (#{supDzSn,jdbcType=VARCHAR}, #{dzStatus,jdbcType=TINYINT}, #{dzInvstatus,jdbcType=TINYINT}, 
      #{saleId,jdbcType=BIGINT}, #{saleName,jdbcType=VARCHAR}, #{invTitle,jdbcType=VARCHAR}, 
      #{taxCode,jdbcType=VARCHAR}, #{invType,jdbcType=TINYINT}, #{address,jdbcType=VARCHAR}, 
      #{isEmail,jdbcType=TINYINT}, #{emailTime,jdbcType=TIMESTAMP}, #{starTime,jdbcType=TIMESTAMP}, 
      #{endTime,jdbcType=TIMESTAMP}, #{backAccountStatus,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createUserId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=BIGINT}
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplier">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into accounting_unified_supplier
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="supDzSn != null">
        sup_dz_sn,
      </if>
      <if test="dzStatus != null">
        dz_status,
      </if>
      <if test="dzInvstatus != null">
        dz_invstatus,
      </if>
      <if test="saleId != null">
        sale_id,
      </if>
      <if test="saleName != null">
        sale_name,
      </if>
      <if test="invTitle != null">
        inv_title,
      </if>
      <if test="taxCode != null">
        tax_code,
      </if>
      <if test="invType != null">
        inv_type,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="isEmail != null">
        is_email,
      </if>
      <if test="emailTime != null">
        email_time,
      </if>
      <if test="starTime != null">
        star_time,
      </if>
      <if test="endTime != null">
        end_time,
      </if>
      <if test="backAccountStatus != null">
        back_account_status,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="supDzSn != null">
        #{supDzSn,jdbcType=VARCHAR},
      </if>
      <if test="dzStatus != null">
        #{dzStatus,jdbcType=TINYINT},
      </if>
      <if test="dzInvstatus != null">
        #{dzInvstatus,jdbcType=TINYINT},
      </if>
      <if test="saleId != null">
        #{saleId,jdbcType=BIGINT},
      </if>
      <if test="saleName != null">
        #{saleName,jdbcType=VARCHAR},
      </if>
      <if test="invTitle != null">
        #{invTitle,jdbcType=VARCHAR},
      </if>
      <if test="taxCode != null">
        #{taxCode,jdbcType=VARCHAR},
      </if>
      <if test="invType != null">
        #{invType,jdbcType=TINYINT},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="isEmail != null">
        #{isEmail,jdbcType=TINYINT},
      </if>
      <if test="emailTime != null">
        #{emailTime,jdbcType=TIMESTAMP},
      </if>
      <if test="starTime != null">
        #{starTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null">
        #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="backAccountStatus != null">
        #{backAccountStatus,jdbcType=TINYINT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierExample" resultType="java.lang.Long">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    select count(*) from accounting_unified_supplier
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    update accounting_unified_supplier
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.supDzSn != null">
        sup_dz_sn = #{record.supDzSn,jdbcType=VARCHAR},
      </if>
      <if test="record.dzStatus != null">
        dz_status = #{record.dzStatus,jdbcType=TINYINT},
      </if>
      <if test="record.dzInvstatus != null">
        dz_invstatus = #{record.dzInvstatus,jdbcType=TINYINT},
      </if>
      <if test="record.saleId != null">
        sale_id = #{record.saleId,jdbcType=BIGINT},
      </if>
      <if test="record.saleName != null">
        sale_name = #{record.saleName,jdbcType=VARCHAR},
      </if>
      <if test="record.invTitle != null">
        inv_title = #{record.invTitle,jdbcType=VARCHAR},
      </if>
      <if test="record.taxCode != null">
        tax_code = #{record.taxCode,jdbcType=VARCHAR},
      </if>
      <if test="record.invType != null">
        inv_type = #{record.invType,jdbcType=TINYINT},
      </if>
      <if test="record.address != null">
        address = #{record.address,jdbcType=VARCHAR},
      </if>
      <if test="record.isEmail != null">
        is_email = #{record.isEmail,jdbcType=TINYINT},
      </if>
      <if test="record.emailTime != null">
        email_time = #{record.emailTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.starTime != null">
        star_time = #{record.starTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.endTime != null">
        end_time = #{record.endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.backAccountStatus != null">
        back_account_status = #{record.backAccountStatus,jdbcType=TINYINT},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=BIGINT},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    update accounting_unified_supplier
    set id = #{record.id,jdbcType=BIGINT},
      sup_dz_sn = #{record.supDzSn,jdbcType=VARCHAR},
      dz_status = #{record.dzStatus,jdbcType=TINYINT},
      dz_invstatus = #{record.dzInvstatus,jdbcType=TINYINT},
      sale_id = #{record.saleId,jdbcType=BIGINT},
      sale_name = #{record.saleName,jdbcType=VARCHAR},
      inv_title = #{record.invTitle,jdbcType=VARCHAR},
      tax_code = #{record.taxCode,jdbcType=VARCHAR},
      inv_type = #{record.invType,jdbcType=TINYINT},
      address = #{record.address,jdbcType=VARCHAR},
      is_email = #{record.isEmail,jdbcType=TINYINT},
      email_time = #{record.emailTime,jdbcType=TIMESTAMP},
      star_time = #{record.starTime,jdbcType=TIMESTAMP},
      end_time = #{record.endTime,jdbcType=TIMESTAMP},
      back_account_status = #{record.backAccountStatus,jdbcType=TINYINT},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplier">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    update accounting_unified_supplier
    <set>
      <if test="supDzSn != null">
        sup_dz_sn = #{supDzSn,jdbcType=VARCHAR},
      </if>
      <if test="dzStatus != null">
        dz_status = #{dzStatus,jdbcType=TINYINT},
      </if>
      <if test="dzInvstatus != null">
        dz_invstatus = #{dzInvstatus,jdbcType=TINYINT},
      </if>
      <if test="saleId != null">
        sale_id = #{saleId,jdbcType=BIGINT},
      </if>
      <if test="saleName != null">
        sale_name = #{saleName,jdbcType=VARCHAR},
      </if>
      <if test="invTitle != null">
        inv_title = #{invTitle,jdbcType=VARCHAR},
      </if>
      <if test="taxCode != null">
        tax_code = #{taxCode,jdbcType=VARCHAR},
      </if>
      <if test="invType != null">
        inv_type = #{invType,jdbcType=TINYINT},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="isEmail != null">
        is_email = #{isEmail,jdbcType=TINYINT},
      </if>
      <if test="emailTime != null">
        email_time = #{emailTime,jdbcType=TIMESTAMP},
      </if>
      <if test="starTime != null">
        star_time = #{starTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null">
        end_time = #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="backAccountStatus != null">
        back_account_status = #{backAccountStatus,jdbcType=TINYINT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplier">
    <!--


      This element was generated on Fri Jun 19 16:48:52 CST 2020.
    -->
    update accounting_unified_supplier
    set sup_dz_sn = #{supDzSn,jdbcType=VARCHAR},
      dz_status = #{dzStatus,jdbcType=TINYINT},
      dz_invstatus = #{dzInvstatus,jdbcType=TINYINT},
      sale_id = #{saleId,jdbcType=BIGINT},
      sale_name = #{saleName,jdbcType=VARCHAR},
      inv_title = #{invTitle,jdbcType=VARCHAR},
      tax_code = #{taxCode,jdbcType=VARCHAR},
      inv_type = #{invType,jdbcType=TINYINT},
      address = #{address,jdbcType=VARCHAR},
      is_email = #{isEmail,jdbcType=TINYINT},
      email_time = #{emailTime,jdbcType=TIMESTAMP},
      star_time = #{starTime,jdbcType=TIMESTAMP},
      end_time = #{endTime,jdbcType=TIMESTAMP},
      back_account_status = #{backAccountStatus,jdbcType=TINYINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>