<?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.score.supplier.ScoreAccountingSupplierMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.accounting.score.supplier.AccountingScoreSupplier">
    <!--


      This element was generated on Wed Jun 17 10:52:02 CST 2020.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="accounting_order_sn_supplier" jdbcType="VARCHAR" property="accountingOrderSnSupplier" />
    <result column="accounting_status" jdbcType="TINYINT" property="accountingStatus" />
    <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
    <result column="merchant_name" jdbcType="VARCHAR" property="merchantName" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="invoice_status" jdbcType="TINYINT" property="invoiceStatus" />
    <result column="invoice_title" jdbcType="VARCHAR" property="invoiceTitle" />
    <result column="invoice_type" jdbcType="TINYINT" property="invoiceType" />
    <result column="tax_code" jdbcType="VARCHAR" property="taxCode" />
    <result column="is_send_email" jdbcType="TINYINT" property="isSendEmail" />
    <result column="send_email_time" jdbcType="TIMESTAMP" property="sendEmailTime" />
    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
    <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 Wed Jun 17 10:52:02 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 Wed Jun 17 10:52:02 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 Wed Jun 17 10:52:02 CST 2020.
    -->
    id, accounting_order_sn_supplier, accounting_status, merchant_id, merchant_name, 
    address, invoice_status, invoice_title, invoice_type, tax_code, is_send_email, send_email_time, 
    start_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.score.supplier.AccountingScoreSupplierExample" resultMap="BaseResultMap">
    <!--


      This element was generated on Wed Jun 17 10:52:02 CST 2020.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from score_accounting_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 Wed Jun 17 10:52:02 CST 2020.
    -->
    select 
    <include refid="Base_Column_List" />
    from score_accounting_supplier
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--


      This element was generated on Wed Jun 17 10:52:02 CST 2020.
    -->
    delete from score_accounting_supplier
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.accounting.score.supplier.AccountingScoreSupplierExample">
    <!--


      This element was generated on Wed Jun 17 10:52:02 CST 2020.
    -->
    delete from score_accounting_supplier
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.accounting.score.supplier.AccountingScoreSupplier">
    <!--


      This element was generated on Wed Jun 17 10:52:02 CST 2020.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into score_accounting_supplier (accounting_order_sn_supplier, accounting_status, 
      merchant_id, merchant_name, address, 
      invoice_status, invoice_title, invoice_type, 
      tax_code, is_send_email, send_email_time, 
      start_time, end_time, back_account_status, 
      create_time, create_user_id, update_time, 
      update_user_id)
    values (#{accountingOrderSnSupplier,jdbcType=VARCHAR}, #{accountingStatus,jdbcType=TINYINT}, 
      #{merchantId,jdbcType=BIGINT}, #{merchantName,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, 
      #{invoiceStatus,jdbcType=TINYINT}, #{invoiceTitle,jdbcType=VARCHAR}, #{invoiceType,jdbcType=TINYINT}, 
      #{taxCode,jdbcType=VARCHAR}, #{isSendEmail,jdbcType=TINYINT}, #{sendEmailTime,jdbcType=TIMESTAMP}, 
      #{startTime,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.score.supplier.AccountingScoreSupplier">
    <!--


      This element was generated on Wed Jun 17 10:52:02 CST 2020.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into score_accounting_supplier
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="accountingOrderSnSupplier != null">
        accounting_order_sn_supplier,
      </if>
      <if test="accountingStatus != null">
        accounting_status,
      </if>
      <if test="merchantId != null">
        merchant_id,
      </if>
      <if test="merchantName != null">
        merchant_name,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="invoiceStatus != null">
        invoice_status,
      </if>
      <if test="invoiceTitle != null">
        invoice_title,
      </if>
      <if test="invoiceType != null">
        invoice_type,
      </if>
      <if test="taxCode != null">
        tax_code,
      </if>
      <if test="isSendEmail != null">
        is_send_email,
      </if>
      <if test="sendEmailTime != null">
        send_email_time,
      </if>
      <if test="startTime != null">
        start_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="accountingOrderSnSupplier != null">
        #{accountingOrderSnSupplier,jdbcType=VARCHAR},
      </if>
      <if test="accountingStatus != null">
        #{accountingStatus,jdbcType=TINYINT},
      </if>
      <if test="merchantId != null">
        #{merchantId,jdbcType=BIGINT},
      </if>
      <if test="merchantName != null">
        #{merchantName,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="invoiceStatus != null">
        #{invoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="invoiceTitle != null">
        #{invoiceTitle,jdbcType=VARCHAR},
      </if>
      <if test="invoiceType != null">
        #{invoiceType,jdbcType=TINYINT},
      </if>
      <if test="taxCode != null">
        #{taxCode,jdbcType=VARCHAR},
      </if>
      <if test="isSendEmail != null">
        #{isSendEmail,jdbcType=TINYINT},
      </if>
      <if test="sendEmailTime != null">
        #{sendEmailTime,jdbcType=TIMESTAMP},
      </if>
      <if test="startTime != null">
        #{startTime,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.score.supplier.AccountingScoreSupplierExample" resultType="java.lang.Long">
    <!--


      This element was generated on Wed Jun 17 10:52:02 CST 2020.
    -->
    select count(*) from score_accounting_supplier
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--


      This element was generated on Wed Jun 17 10:52:02 CST 2020.
    -->
    update score_accounting_supplier
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.accountingOrderSnSupplier != null">
        accounting_order_sn_supplier = #{record.accountingOrderSnSupplier,jdbcType=VARCHAR},
      </if>
      <if test="record.accountingStatus != null">
        accounting_status = #{record.accountingStatus,jdbcType=TINYINT},
      </if>
      <if test="record.merchantId != null">
        merchant_id = #{record.merchantId,jdbcType=BIGINT},
      </if>
      <if test="record.merchantName != null">
        merchant_name = #{record.merchantName,jdbcType=VARCHAR},
      </if>
      <if test="record.address != null">
        address = #{record.address,jdbcType=VARCHAR},
      </if>
      <if test="record.invoiceStatus != null">
        invoice_status = #{record.invoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="record.invoiceTitle != null">
        invoice_title = #{record.invoiceTitle,jdbcType=VARCHAR},
      </if>
      <if test="record.invoiceType != null">
        invoice_type = #{record.invoiceType,jdbcType=TINYINT},
      </if>
      <if test="record.taxCode != null">
        tax_code = #{record.taxCode,jdbcType=VARCHAR},
      </if>
      <if test="record.isSendEmail != null">
        is_send_email = #{record.isSendEmail,jdbcType=TINYINT},
      </if>
      <if test="record.sendEmailTime != null">
        send_email_time = #{record.sendEmailTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.startTime != null">
        start_time = #{record.startTime,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 Wed Jun 17 10:52:02 CST 2020.
    -->
    update score_accounting_supplier
    set id = #{record.id,jdbcType=BIGINT},
      accounting_order_sn_supplier = #{record.accountingOrderSnSupplier,jdbcType=VARCHAR},
      accounting_status = #{record.accountingStatus,jdbcType=TINYINT},
      merchant_id = #{record.merchantId,jdbcType=BIGINT},
      merchant_name = #{record.merchantName,jdbcType=VARCHAR},
      address = #{record.address,jdbcType=VARCHAR},
      invoice_status = #{record.invoiceStatus,jdbcType=TINYINT},
      invoice_title = #{record.invoiceTitle,jdbcType=VARCHAR},
      invoice_type = #{record.invoiceType,jdbcType=TINYINT},
      tax_code = #{record.taxCode,jdbcType=VARCHAR},
      is_send_email = #{record.isSendEmail,jdbcType=TINYINT},
      send_email_time = #{record.sendEmailTime,jdbcType=TIMESTAMP},
      start_time = #{record.startTime,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.score.supplier.AccountingScoreSupplier">
    <!--


      This element was generated on Wed Jun 17 10:52:02 CST 2020.
    -->
    update score_accounting_supplier
    <set>
      <if test="accountingOrderSnSupplier != null">
        accounting_order_sn_supplier = #{accountingOrderSnSupplier,jdbcType=VARCHAR},
      </if>
      <if test="accountingStatus != null">
        accounting_status = #{accountingStatus,jdbcType=TINYINT},
      </if>
      <if test="merchantId != null">
        merchant_id = #{merchantId,jdbcType=BIGINT},
      </if>
      <if test="merchantName != null">
        merchant_name = #{merchantName,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="invoiceStatus != null">
        invoice_status = #{invoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="invoiceTitle != null">
        invoice_title = #{invoiceTitle,jdbcType=VARCHAR},
      </if>
      <if test="invoiceType != null">
        invoice_type = #{invoiceType,jdbcType=TINYINT},
      </if>
      <if test="taxCode != null">
        tax_code = #{taxCode,jdbcType=VARCHAR},
      </if>
      <if test="isSendEmail != null">
        is_send_email = #{isSendEmail,jdbcType=TINYINT},
      </if>
      <if test="sendEmailTime != null">
        send_email_time = #{sendEmailTime,jdbcType=TIMESTAMP},
      </if>
      <if test="startTime != null">
        start_time = #{startTime,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.score.supplier.AccountingScoreSupplier">
    <!--


      This element was generated on Wed Jun 17 10:52:02 CST 2020.
    -->
    update score_accounting_supplier
    set accounting_order_sn_supplier = #{accountingOrderSnSupplier,jdbcType=VARCHAR},
      accounting_status = #{accountingStatus,jdbcType=TINYINT},
      merchant_id = #{merchantId,jdbcType=BIGINT},
      merchant_name = #{merchantName,jdbcType=VARCHAR},
      address = #{address,jdbcType=VARCHAR},
      invoice_status = #{invoiceStatus,jdbcType=TINYINT},
      invoice_title = #{invoiceTitle,jdbcType=VARCHAR},
      invoice_type = #{invoiceType,jdbcType=TINYINT},
      tax_code = #{taxCode,jdbcType=VARCHAR},
      is_send_email = #{isSendEmail,jdbcType=TINYINT},
      send_email_time = #{sendEmailTime,jdbcType=TIMESTAMP},
      start_time = #{startTime,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>