<?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.thirdpart.qchjc.accounting.QchjcAccountingScoreCustomerEntityMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcAccountingScoreCustomerEntity">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="unified_id" jdbcType="BIGINT" property="unifiedId" />
    <result column="accounting_order_sn" jdbcType="VARCHAR" property="accountingOrderSn" />
    <result column="service_no" jdbcType="VARCHAR" property="serviceNo" />
    <result column="accounting_amount" jdbcType="DECIMAL" property="accountingAmount" />
    <result column="statistics_total_amount" jdbcType="DECIMAL" property="statisticsTotalAmount" />
    <result column="un_accounting_amount" jdbcType="DECIMAL" property="unAccountingAmount" />
    <result column="jc_un_accounting_amount" jdbcType="DECIMAL" property="jcUnAccountingAmount" />
    <result column="accounting_status" jdbcType="TINYINT" property="accountingStatus" />
    <result column="invoice_type" jdbcType="TINYINT" property="invoiceType" />
    <result column="invoice_status" jdbcType="TINYINT" property="invoiceStatus" />
    <result column="invoice_company_name" jdbcType="VARCHAR" property="invoiceCompanyName" />
    <result column="invoice_taxpayers_i_d_code" jdbcType="VARCHAR" property="invoiceTaxpayersIDCode" />
    <result column="enterprise_id" jdbcType="VARCHAR" property="enterpriseId" />
    <result column="purchase_user_id" jdbcType="VARCHAR" property="purchaseUserId" />
    <result column="purchase_user_name" jdbcType="VARCHAR" property="purchaseUserName" />
    <result column="purchase_phone" jdbcType="VARCHAR" property="purchasePhone" />
    <result column="purchase_address" jdbcType="VARCHAR" property="purchaseAddress" />
    <result column="purchase_email" jdbcType="VARCHAR" property="purchaseEmail" />
    <result column="purchase_virt_id" jdbcType="VARCHAR" property="purchaseVirtId" />
    <result column="purchase_virt_name" jdbcType="VARCHAR" property="purchaseVirtName" />
    <result column="is_send_email" jdbcType="TINYINT" property="isSendEmail" />
    <result column="send_email_time" jdbcType="TIMESTAMP" property="sendEmailTime" />
    <result column="date_type" jdbcType="TINYINT" property="dateType" />
    <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="bank_info_id" jdbcType="BIGINT" property="bankInfoId" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
    <result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
    <result column="update_user_name" jdbcType="VARCHAR" property="updateUserName" />
    <result column="pay_type" jdbcType="TINYINT" property="payType" />
    <result column="pay_status" jdbcType="TINYINT" property="payStatus" />
    <result column="wx_qrcode_img_url" jdbcType="VARCHAR" property="wxQrcodeImgUrl" />
    <result column="deleted" jdbcType="TINYINT" property="deleted" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="sync_time" jdbcType="TIMESTAMP" property="syncTime" />
    <result column="storage_status" jdbcType="TINYINT" property="storageStatus" />
    <result column="storage_reason" jdbcType="VARCHAR" property="storageReason" />
    <result column="storage_time" jdbcType="TIMESTAMP" property="storageTime" />
    <result column="invoice_count" jdbcType="INTEGER" property="invoiceCount" />
    <result column="receive_invoice_status" jdbcType="TINYINT" property="receiveInvoiceStatus" />
    <result column="order_goods_count" jdbcType="INTEGER" property="orderGoodsCount" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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">
    <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">
    id, unified_id, accounting_order_sn, service_no, accounting_amount, statistics_total_amount, 
    un_accounting_amount, jc_un_accounting_amount, accounting_status, invoice_type, invoice_status, 
    invoice_company_name, invoice_taxpayers_i_d_code, enterprise_id, purchase_user_id, 
    purchase_user_name, purchase_phone, purchase_address, purchase_email, purchase_virt_id, 
    purchase_virt_name, is_send_email, send_email_time, date_type, start_time, end_time, 
    back_account_status, bank_info_id, create_time, create_user_id, create_user_name, 
    update_time, update_user_id, update_user_name, pay_type, pay_status, wx_qrcode_img_url, 
    deleted, remark, sync_time, storage_status, storage_reason, storage_time, invoice_count, 
    receive_invoice_status, order_goods_count
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcAccountingScoreCustomerEntityExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from qchjc_accounting_score_customer
    <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">
    select 
    <include refid="Base_Column_List" />
    from qchjc_accounting_score_customer
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from qchjc_accounting_score_customer
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcAccountingScoreCustomerEntityExample">
    delete from qchjc_accounting_score_customer
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcAccountingScoreCustomerEntity">
    insert into qchjc_accounting_score_customer (id, unified_id, accounting_order_sn, 
      service_no, accounting_amount, statistics_total_amount, 
      un_accounting_amount, jc_un_accounting_amount, 
      accounting_status, invoice_type, invoice_status, 
      invoice_company_name, invoice_taxpayers_i_d_code, 
      enterprise_id, purchase_user_id, purchase_user_name, 
      purchase_phone, purchase_address, purchase_email, 
      purchase_virt_id, purchase_virt_name, is_send_email, 
      send_email_time, date_type, start_time, 
      end_time, back_account_status, bank_info_id, 
      create_time, create_user_id, create_user_name, 
      update_time, update_user_id, update_user_name, 
      pay_type, pay_status, wx_qrcode_img_url, 
      deleted, remark, sync_time, 
      storage_status, storage_reason, storage_time, 
      invoice_count, receive_invoice_status, order_goods_count
      )
    values (#{id,jdbcType=BIGINT}, #{unifiedId,jdbcType=BIGINT}, #{accountingOrderSn,jdbcType=VARCHAR}, 
      #{serviceNo,jdbcType=VARCHAR}, #{accountingAmount,jdbcType=DECIMAL}, #{statisticsTotalAmount,jdbcType=DECIMAL}, 
      #{unAccountingAmount,jdbcType=DECIMAL}, #{jcUnAccountingAmount,jdbcType=DECIMAL}, 
      #{accountingStatus,jdbcType=TINYINT}, #{invoiceType,jdbcType=TINYINT}, #{invoiceStatus,jdbcType=TINYINT}, 
      #{invoiceCompanyName,jdbcType=VARCHAR}, #{invoiceTaxpayersIDCode,jdbcType=VARCHAR}, 
      #{enterpriseId,jdbcType=VARCHAR}, #{purchaseUserId,jdbcType=VARCHAR}, #{purchaseUserName,jdbcType=VARCHAR}, 
      #{purchasePhone,jdbcType=VARCHAR}, #{purchaseAddress,jdbcType=VARCHAR}, #{purchaseEmail,jdbcType=VARCHAR}, 
      #{purchaseVirtId,jdbcType=VARCHAR}, #{purchaseVirtName,jdbcType=VARCHAR}, #{isSendEmail,jdbcType=TINYINT}, 
      #{sendEmailTime,jdbcType=TIMESTAMP}, #{dateType,jdbcType=TINYINT}, #{startTime,jdbcType=TIMESTAMP}, 
      #{endTime,jdbcType=TIMESTAMP}, #{backAccountStatus,jdbcType=TINYINT}, #{bankInfoId,jdbcType=BIGINT}, 
      #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=VARCHAR}, #{createUserName,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=VARCHAR}, #{updateUserName,jdbcType=VARCHAR}, 
      #{payType,jdbcType=TINYINT}, #{payStatus,jdbcType=TINYINT}, #{wxQrcodeImgUrl,jdbcType=VARCHAR}, 
      #{deleted,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, #{syncTime,jdbcType=TIMESTAMP}, 
      #{storageStatus,jdbcType=TINYINT}, #{storageReason,jdbcType=VARCHAR}, #{storageTime,jdbcType=TIMESTAMP}, 
      #{invoiceCount,jdbcType=INTEGER}, #{receiveInvoiceStatus,jdbcType=TINYINT}, #{orderGoodsCount,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcAccountingScoreCustomerEntity">
    insert into qchjc_accounting_score_customer
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="unifiedId != null">
        unified_id,
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn,
      </if>
      <if test="serviceNo != null">
        service_no,
      </if>
      <if test="accountingAmount != null">
        accounting_amount,
      </if>
      <if test="statisticsTotalAmount != null">
        statistics_total_amount,
      </if>
      <if test="unAccountingAmount != null">
        un_accounting_amount,
      </if>
      <if test="jcUnAccountingAmount != null">
        jc_un_accounting_amount,
      </if>
      <if test="accountingStatus != null">
        accounting_status,
      </if>
      <if test="invoiceType != null">
        invoice_type,
      </if>
      <if test="invoiceStatus != null">
        invoice_status,
      </if>
      <if test="invoiceCompanyName != null">
        invoice_company_name,
      </if>
      <if test="invoiceTaxpayersIDCode != null">
        invoice_taxpayers_i_d_code,
      </if>
      <if test="enterpriseId != null">
        enterprise_id,
      </if>
      <if test="purchaseUserId != null">
        purchase_user_id,
      </if>
      <if test="purchaseUserName != null">
        purchase_user_name,
      </if>
      <if test="purchasePhone != null">
        purchase_phone,
      </if>
      <if test="purchaseAddress != null">
        purchase_address,
      </if>
      <if test="purchaseEmail != null">
        purchase_email,
      </if>
      <if test="purchaseVirtId != null">
        purchase_virt_id,
      </if>
      <if test="purchaseVirtName != null">
        purchase_virt_name,
      </if>
      <if test="isSendEmail != null">
        is_send_email,
      </if>
      <if test="sendEmailTime != null">
        send_email_time,
      </if>
      <if test="dateType != null">
        date_type,
      </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="bankInfoId != null">
        bank_info_id,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="createUserName != null">
        create_user_name,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
      <if test="updateUserName != null">
        update_user_name,
      </if>
      <if test="payType != null">
        pay_type,
      </if>
      <if test="payStatus != null">
        pay_status,
      </if>
      <if test="wxQrcodeImgUrl != null">
        wx_qrcode_img_url,
      </if>
      <if test="deleted != null">
        deleted,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="syncTime != null">
        sync_time,
      </if>
      <if test="storageStatus != null">
        storage_status,
      </if>
      <if test="storageReason != null">
        storage_reason,
      </if>
      <if test="storageTime != null">
        storage_time,
      </if>
      <if test="invoiceCount != null">
        invoice_count,
      </if>
      <if test="receiveInvoiceStatus != null">
        receive_invoice_status,
      </if>
      <if test="orderGoodsCount != null">
        order_goods_count,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="unifiedId != null">
        #{unifiedId,jdbcType=BIGINT},
      </if>
      <if test="accountingOrderSn != null">
        #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="accountingAmount != null">
        #{accountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="statisticsTotalAmount != null">
        #{statisticsTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="unAccountingAmount != null">
        #{unAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="jcUnAccountingAmount != null">
        #{jcUnAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="accountingStatus != null">
        #{accountingStatus,jdbcType=TINYINT},
      </if>
      <if test="invoiceType != null">
        #{invoiceType,jdbcType=TINYINT},
      </if>
      <if test="invoiceStatus != null">
        #{invoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="invoiceCompanyName != null">
        #{invoiceCompanyName,jdbcType=VARCHAR},
      </if>
      <if test="invoiceTaxpayersIDCode != null">
        #{invoiceTaxpayersIDCode,jdbcType=VARCHAR},
      </if>
      <if test="enterpriseId != null">
        #{enterpriseId,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserId != null">
        #{purchaseUserId,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserName != null">
        #{purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="purchasePhone != null">
        #{purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="purchaseAddress != null">
        #{purchaseAddress,jdbcType=VARCHAR},
      </if>
      <if test="purchaseEmail != null">
        #{purchaseEmail,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtId != null">
        #{purchaseVirtId,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtName != null">
        #{purchaseVirtName,jdbcType=VARCHAR},
      </if>
      <if test="isSendEmail != null">
        #{isSendEmail,jdbcType=TINYINT},
      </if>
      <if test="sendEmailTime != null">
        #{sendEmailTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dateType != null">
        #{dateType,jdbcType=TINYINT},
      </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="bankInfoId != null">
        #{bankInfoId,jdbcType=BIGINT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=VARCHAR},
      </if>
      <if test="createUserName != null">
        #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=VARCHAR},
      </if>
      <if test="updateUserName != null">
        #{updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="payType != null">
        #{payType,jdbcType=TINYINT},
      </if>
      <if test="payStatus != null">
        #{payStatus,jdbcType=TINYINT},
      </if>
      <if test="wxQrcodeImgUrl != null">
        #{wxQrcodeImgUrl,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        #{deleted,jdbcType=TINYINT},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="syncTime != null">
        #{syncTime,jdbcType=TIMESTAMP},
      </if>
      <if test="storageStatus != null">
        #{storageStatus,jdbcType=TINYINT},
      </if>
      <if test="storageReason != null">
        #{storageReason,jdbcType=VARCHAR},
      </if>
      <if test="storageTime != null">
        #{storageTime,jdbcType=TIMESTAMP},
      </if>
      <if test="invoiceCount != null">
        #{invoiceCount,jdbcType=INTEGER},
      </if>
      <if test="receiveInvoiceStatus != null">
        #{receiveInvoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="orderGoodsCount != null">
        #{orderGoodsCount,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcAccountingScoreCustomerEntityExample" resultType="java.lang.Long">
    select count(*) from qchjc_accounting_score_customer
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update qchjc_accounting_score_customer
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.unifiedId != null">
        unified_id = #{record.unifiedId,jdbcType=BIGINT},
      </if>
      <if test="record.accountingOrderSn != null">
        accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceNo != null">
        service_no = #{record.serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="record.accountingAmount != null">
        accounting_amount = #{record.accountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.statisticsTotalAmount != null">
        statistics_total_amount = #{record.statisticsTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.unAccountingAmount != null">
        un_accounting_amount = #{record.unAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.jcUnAccountingAmount != null">
        jc_un_accounting_amount = #{record.jcUnAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.accountingStatus != null">
        accounting_status = #{record.accountingStatus,jdbcType=TINYINT},
      </if>
      <if test="record.invoiceType != null">
        invoice_type = #{record.invoiceType,jdbcType=TINYINT},
      </if>
      <if test="record.invoiceStatus != null">
        invoice_status = #{record.invoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="record.invoiceCompanyName != null">
        invoice_company_name = #{record.invoiceCompanyName,jdbcType=VARCHAR},
      </if>
      <if test="record.invoiceTaxpayersIDCode != null">
        invoice_taxpayers_i_d_code = #{record.invoiceTaxpayersIDCode,jdbcType=VARCHAR},
      </if>
      <if test="record.enterpriseId != null">
        enterprise_id = #{record.enterpriseId,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseUserId != null">
        purchase_user_id = #{record.purchaseUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseUserName != null">
        purchase_user_name = #{record.purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchasePhone != null">
        purchase_phone = #{record.purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseAddress != null">
        purchase_address = #{record.purchaseAddress,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseEmail != null">
        purchase_email = #{record.purchaseEmail,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseVirtId != null">
        purchase_virt_id = #{record.purchaseVirtId,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseVirtName != null">
        purchase_virt_name = #{record.purchaseVirtName,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.dateType != null">
        date_type = #{record.dateType,jdbcType=TINYINT},
      </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.bankInfoId != null">
        bank_info_id = #{record.bankInfoId,jdbcType=BIGINT},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.createUserName != null">
        create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.updateUserName != null">
        update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.payType != null">
        pay_type = #{record.payType,jdbcType=TINYINT},
      </if>
      <if test="record.payStatus != null">
        pay_status = #{record.payStatus,jdbcType=TINYINT},
      </if>
      <if test="record.wxQrcodeImgUrl != null">
        wx_qrcode_img_url = #{record.wxQrcodeImgUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.deleted != null">
        deleted = #{record.deleted,jdbcType=TINYINT},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.syncTime != null">
        sync_time = #{record.syncTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.storageStatus != null">
        storage_status = #{record.storageStatus,jdbcType=TINYINT},
      </if>
      <if test="record.storageReason != null">
        storage_reason = #{record.storageReason,jdbcType=VARCHAR},
      </if>
      <if test="record.storageTime != null">
        storage_time = #{record.storageTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.invoiceCount != null">
        invoice_count = #{record.invoiceCount,jdbcType=INTEGER},
      </if>
      <if test="record.receiveInvoiceStatus != null">
        receive_invoice_status = #{record.receiveInvoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="record.orderGoodsCount != null">
        order_goods_count = #{record.orderGoodsCount,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update qchjc_accounting_score_customer
    set id = #{record.id,jdbcType=BIGINT},
      unified_id = #{record.unifiedId,jdbcType=BIGINT},
      accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      service_no = #{record.serviceNo,jdbcType=VARCHAR},
      accounting_amount = #{record.accountingAmount,jdbcType=DECIMAL},
      statistics_total_amount = #{record.statisticsTotalAmount,jdbcType=DECIMAL},
      un_accounting_amount = #{record.unAccountingAmount,jdbcType=DECIMAL},
      jc_un_accounting_amount = #{record.jcUnAccountingAmount,jdbcType=DECIMAL},
      accounting_status = #{record.accountingStatus,jdbcType=TINYINT},
      invoice_type = #{record.invoiceType,jdbcType=TINYINT},
      invoice_status = #{record.invoiceStatus,jdbcType=TINYINT},
      invoice_company_name = #{record.invoiceCompanyName,jdbcType=VARCHAR},
      invoice_taxpayers_i_d_code = #{record.invoiceTaxpayersIDCode,jdbcType=VARCHAR},
      enterprise_id = #{record.enterpriseId,jdbcType=VARCHAR},
      purchase_user_id = #{record.purchaseUserId,jdbcType=VARCHAR},
      purchase_user_name = #{record.purchaseUserName,jdbcType=VARCHAR},
      purchase_phone = #{record.purchasePhone,jdbcType=VARCHAR},
      purchase_address = #{record.purchaseAddress,jdbcType=VARCHAR},
      purchase_email = #{record.purchaseEmail,jdbcType=VARCHAR},
      purchase_virt_id = #{record.purchaseVirtId,jdbcType=VARCHAR},
      purchase_virt_name = #{record.purchaseVirtName,jdbcType=VARCHAR},
      is_send_email = #{record.isSendEmail,jdbcType=TINYINT},
      send_email_time = #{record.sendEmailTime,jdbcType=TIMESTAMP},
      date_type = #{record.dateType,jdbcType=TINYINT},
      start_time = #{record.startTime,jdbcType=TIMESTAMP},
      end_time = #{record.endTime,jdbcType=TIMESTAMP},
      back_account_status = #{record.backAccountStatus,jdbcType=TINYINT},
      bank_info_id = #{record.bankInfoId,jdbcType=BIGINT},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=VARCHAR},
      create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=VARCHAR},
      update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      pay_type = #{record.payType,jdbcType=TINYINT},
      pay_status = #{record.payStatus,jdbcType=TINYINT},
      wx_qrcode_img_url = #{record.wxQrcodeImgUrl,jdbcType=VARCHAR},
      deleted = #{record.deleted,jdbcType=TINYINT},
      remark = #{record.remark,jdbcType=VARCHAR},
      sync_time = #{record.syncTime,jdbcType=TIMESTAMP},
      storage_status = #{record.storageStatus,jdbcType=TINYINT},
      storage_reason = #{record.storageReason,jdbcType=VARCHAR},
      storage_time = #{record.storageTime,jdbcType=TIMESTAMP},
      invoice_count = #{record.invoiceCount,jdbcType=INTEGER},
      receive_invoice_status = #{record.receiveInvoiceStatus,jdbcType=TINYINT},
      order_goods_count = #{record.orderGoodsCount,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcAccountingScoreCustomerEntity">
    update qchjc_accounting_score_customer
    <set>
      <if test="unifiedId != null">
        unified_id = #{unifiedId,jdbcType=BIGINT},
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        service_no = #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="accountingAmount != null">
        accounting_amount = #{accountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="statisticsTotalAmount != null">
        statistics_total_amount = #{statisticsTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="unAccountingAmount != null">
        un_accounting_amount = #{unAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="jcUnAccountingAmount != null">
        jc_un_accounting_amount = #{jcUnAccountingAmount,jdbcType=DECIMAL},
      </if>
      <if test="accountingStatus != null">
        accounting_status = #{accountingStatus,jdbcType=TINYINT},
      </if>
      <if test="invoiceType != null">
        invoice_type = #{invoiceType,jdbcType=TINYINT},
      </if>
      <if test="invoiceStatus != null">
        invoice_status = #{invoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="invoiceCompanyName != null">
        invoice_company_name = #{invoiceCompanyName,jdbcType=VARCHAR},
      </if>
      <if test="invoiceTaxpayersIDCode != null">
        invoice_taxpayers_i_d_code = #{invoiceTaxpayersIDCode,jdbcType=VARCHAR},
      </if>
      <if test="enterpriseId != null">
        enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserId != null">
        purchase_user_id = #{purchaseUserId,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserName != null">
        purchase_user_name = #{purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="purchasePhone != null">
        purchase_phone = #{purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="purchaseAddress != null">
        purchase_address = #{purchaseAddress,jdbcType=VARCHAR},
      </if>
      <if test="purchaseEmail != null">
        purchase_email = #{purchaseEmail,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtId != null">
        purchase_virt_id = #{purchaseVirtId,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtName != null">
        purchase_virt_name = #{purchaseVirtName,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="dateType != null">
        date_type = #{dateType,jdbcType=TINYINT},
      </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="bankInfoId != null">
        bank_info_id = #{bankInfoId,jdbcType=BIGINT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=VARCHAR},
      </if>
      <if test="createUserName != null">
        create_user_name = #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=VARCHAR},
      </if>
      <if test="updateUserName != null">
        update_user_name = #{updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="payType != null">
        pay_type = #{payType,jdbcType=TINYINT},
      </if>
      <if test="payStatus != null">
        pay_status = #{payStatus,jdbcType=TINYINT},
      </if>
      <if test="wxQrcodeImgUrl != null">
        wx_qrcode_img_url = #{wxQrcodeImgUrl,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        deleted = #{deleted,jdbcType=TINYINT},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="syncTime != null">
        sync_time = #{syncTime,jdbcType=TIMESTAMP},
      </if>
      <if test="storageStatus != null">
        storage_status = #{storageStatus,jdbcType=TINYINT},
      </if>
      <if test="storageReason != null">
        storage_reason = #{storageReason,jdbcType=VARCHAR},
      </if>
      <if test="storageTime != null">
        storage_time = #{storageTime,jdbcType=TIMESTAMP},
      </if>
      <if test="invoiceCount != null">
        invoice_count = #{invoiceCount,jdbcType=INTEGER},
      </if>
      <if test="receiveInvoiceStatus != null">
        receive_invoice_status = #{receiveInvoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="orderGoodsCount != null">
        order_goods_count = #{orderGoodsCount,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcAccountingScoreCustomerEntity">
    update qchjc_accounting_score_customer
    set unified_id = #{unifiedId,jdbcType=BIGINT},
      accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      service_no = #{serviceNo,jdbcType=VARCHAR},
      accounting_amount = #{accountingAmount,jdbcType=DECIMAL},
      statistics_total_amount = #{statisticsTotalAmount,jdbcType=DECIMAL},
      un_accounting_amount = #{unAccountingAmount,jdbcType=DECIMAL},
      jc_un_accounting_amount = #{jcUnAccountingAmount,jdbcType=DECIMAL},
      accounting_status = #{accountingStatus,jdbcType=TINYINT},
      invoice_type = #{invoiceType,jdbcType=TINYINT},
      invoice_status = #{invoiceStatus,jdbcType=TINYINT},
      invoice_company_name = #{invoiceCompanyName,jdbcType=VARCHAR},
      invoice_taxpayers_i_d_code = #{invoiceTaxpayersIDCode,jdbcType=VARCHAR},
      enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
      purchase_user_id = #{purchaseUserId,jdbcType=VARCHAR},
      purchase_user_name = #{purchaseUserName,jdbcType=VARCHAR},
      purchase_phone = #{purchasePhone,jdbcType=VARCHAR},
      purchase_address = #{purchaseAddress,jdbcType=VARCHAR},
      purchase_email = #{purchaseEmail,jdbcType=VARCHAR},
      purchase_virt_id = #{purchaseVirtId,jdbcType=VARCHAR},
      purchase_virt_name = #{purchaseVirtName,jdbcType=VARCHAR},
      is_send_email = #{isSendEmail,jdbcType=TINYINT},
      send_email_time = #{sendEmailTime,jdbcType=TIMESTAMP},
      date_type = #{dateType,jdbcType=TINYINT},
      start_time = #{startTime,jdbcType=TIMESTAMP},
      end_time = #{endTime,jdbcType=TIMESTAMP},
      back_account_status = #{backAccountStatus,jdbcType=TINYINT},
      bank_info_id = #{bankInfoId,jdbcType=BIGINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=VARCHAR},
      create_user_name = #{createUserName,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=VARCHAR},
      update_user_name = #{updateUserName,jdbcType=VARCHAR},
      pay_type = #{payType,jdbcType=TINYINT},
      pay_status = #{payStatus,jdbcType=TINYINT},
      wx_qrcode_img_url = #{wxQrcodeImgUrl,jdbcType=VARCHAR},
      deleted = #{deleted,jdbcType=TINYINT},
      remark = #{remark,jdbcType=VARCHAR},
      sync_time = #{syncTime,jdbcType=TIMESTAMP},
      storage_status = #{storageStatus,jdbcType=TINYINT},
      storage_reason = #{storageReason,jdbcType=VARCHAR},
      storage_time = #{storageTime,jdbcType=TIMESTAMP},
      invoice_count = #{invoiceCount,jdbcType=INTEGER},
      receive_invoice_status = #{receiveInvoiceStatus,jdbcType=TINYINT},
      order_goods_count = #{orderGoodsCount,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>

    <resultMap id="customerStatementResMap" type="cn.superdesk.uniorder.dto.vo.thirdpart.qchjc.accounting.QchjcCustomerStatementVo">
        <id column="id" javaType="java.lang.Long" jdbcType="BIGINT" property="id" />
        <result column="unified_id" javaType="java.lang.Long" jdbcType="BIGINT" property="unifiedId" />
        <result column="accounting_order_sn" javaType="java.lang.String" jdbcType="VARCHAR" property="accountingOrderSn" />
        <result column="accounting_amount" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="accountingAmount" />
        <result column="statistics_total_amount" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="statisticsTotalAmount" />
        <result column="jc_un_accounting_amount" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="jcUnAccountingAmount" />
        <result column="accounting_status" javaType="java.lang.Integer" jdbcType="TINYINT" property="accountingStatus" />
        <result column="invoice_status" javaType="java.lang.Integer" jdbcType="TINYINT" property="invoiceStatus" />
        <result column="purchase_user_id" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseUserId" />
        <result column="purchase_user_name" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseUserName" />
        <result column="purchase_phone" javaType="java.lang.String" jdbcType="VARCHAR" property="purchasePhone" />
        <result column="purchase_address" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseAddress" />
        <result column="purchase_email" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseEmail" />
        <result column="purchase_virt_id" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseVirtId" />
        <result column="purchase_virt_name" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseVirtName" />
        <result column="date_type" javaType="java.lang.Integer" jdbcType="TINYINT" property="dateType" />
        <result column="start_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="startTime" />
        <result column="end_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="endTime" />
        <result column="create_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="createTime" />
        <result column="create_user_id" javaType="java.lang.String" jdbcType="VARCHAR" property="createUserId" />
        <result column="create_user_name" javaType="java.lang.String" jdbcType="VARCHAR" property="createUserName" />
        <result column="update_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="updateTime" />
        <result column="update_user_id" javaType="java.lang.String" jdbcType="VARCHAR" property="updateUserId" />
        <result column="update_user_name" javaType="java.lang.String" jdbcType="VARCHAR" property="updateUserName" />
        <result column="pay_status" javaType="java.lang.Integer" jdbcType="TINYINT" property="payStatus" />
        <!--    &amp;amp;lt;result column="deleted" property="deleted" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <result column="remark" javaType="java.lang.String" jdbcType="VARCHAR" property="remark" />
        <result column="sync_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="syncTime" />
        <result column="storage_status" javaType="java.lang.Integer" jdbcType="TINYINT" property="storageStatus" />
        <result column="storage_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="storageTime" />
        <result column="invoice_count" javaType="java.lang.Integer" jdbcType="INTEGER" property="invoiceCount" />
        <collection columnPrefix="o_" property="orderSelected" resultMap="orderMap" />
    </resultMap>

    <resultMap id="orderMap" type="cn.superdesk.uniorder.dto.vo.thirdpart.qchjc.accounting.QchjcOrderVo">
        <id column="id" javaType="java.lang.Long" jdbcType="BIGINT" property="id" />
        <result column="unified_id" javaType="java.lang.Long" jdbcType="BIGINT" property="unifiedId" />
        <result column="accounting_order_sn" javaType="java.lang.String" jdbcType="VARCHAR" property="accountingOrderSn" />
        <result column="order_sn" javaType="java.lang.String" jdbcType="VARCHAR" property="orderSn" />
        <result column="order_sn_out_trade" javaType="java.lang.String" jdbcType="VARCHAR" property="orderSnOutTrade" />
        <result column="out_snapshot_order_id" javaType="java.lang.String" jdbcType="VARCHAR" property="outSnapshotOrderId" />
        <!--    &amp;amp;lt;result column="service_name" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="service_no" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="project_id" property="" javaType="java.lang.Long" jdbcType="BIGINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="project_name" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <result column="purchase_virt_id" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseVirtId" />
        <result column="purchase_virt_name" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseVirtName" />
        <result column="purchase_department_name" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseDepartmentName" />
        <result column="purchase_user_id" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseUserId" />
        <result column="purchase_user_name" javaType="java.lang.String" jdbcType="VARCHAR" property="purchaseUserName" />
        <result column="purchase_phone" javaType="java.lang.String" jdbcType="VARCHAR" property="purchasePhone" />
        <result column="sale_id" javaType="java.lang.String" jdbcType="VARCHAR" property="supplierId" />
        <result column="sale_name" javaType="java.lang.String" jdbcType="VARCHAR" property="supplierName" />
        <result column="amount" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="orderAmount" />
        <result column="cost_amount" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="orderCostAmount" />
        <result column="transport_amount" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="transportAmount" />
        <result column="transport_merchant_assume_amount" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="transportMerchantAssumeAmount" />
        <!--    &amp;amp;lt;result column="goods_amount" property="" javaType="java.math.BigDecimal" jdbcType="DECIMAL" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="goods_cost_amount" property="" javaType="java.math.BigDecimal" jdbcType="DECIMAL" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="refund_goods_amount" property="" javaType="java.math.BigDecimal" jdbcType="DECIMAL" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="refund_goods_cost_amount" property="" javaType="java.math.BigDecimal" jdbcType="DECIMAL" /&amp;amp;gt;-->
        <result column="complet_state" javaType="java.lang.Integer" jdbcType="TINYINT" property="completState" />
        <!--    &amp;amp;lt;result column="order_locking_customer" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="order_locking_supplier" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <result column="pay_type" javaType="java.lang.Integer" jdbcType="TINYINT" property="payType" />
        <result column="pay_type_name" javaType="java.lang.String" jdbcType="VARCHAR" property="payTypeName" />
        <result column="pay_state" javaType="java.lang.Integer" jdbcType="TINYINT" property="payState" />
        <result column="pay_state_name" javaType="java.lang.String" jdbcType="VARCHAR" property="payStateName" />
        <result column="order_state" javaType="java.lang.Integer" jdbcType="TINYINT" property="orderState" />
        <result column="order_state_name" javaType="java.lang.String" jdbcType="VARCHAR" property="orderStateName" />
        <!--    &amp;amp;lt;result column="settlement_type" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="appraise_state" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="source_channel" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <result column="other_params" javaType="java.lang.String" jdbcType="VARCHAR" property="otherParams" />
        <!--    &amp;amp;lt;result column="user_type" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="user_name" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <result column="create_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="createTime" />
        <result column="create_user_id" javaType="java.lang.String" jdbcType="VARCHAR" property="createUserId" />
        <result column="update_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="updateTime" />
        <result column="update_user_id" javaType="java.lang.String" jdbcType="VARCHAR" property="updateUserId" />
        <result column="order_type" javaType="java.lang.Integer" jdbcType="TINYINT" property="orderType" />
        <result column="refund_order_sn" javaType="java.lang.String" jdbcType="VARCHAR" property="refundOrderSn" />
        <result column="rec_user_name" javaType="java.lang.String" jdbcType="VARCHAR" property="recUserName" />
        <result column="rec_user_id" javaType="java.lang.String" jdbcType="VARCHAR" property="recUserId" />
        <result column="rec_user_phone" javaType="java.lang.String" jdbcType="VARCHAR" property="recUserPhone" />
        <result column="rec_address" javaType="java.lang.String" jdbcType="VARCHAR" property="recAddress" />
        <result column="express_sn" javaType="java.lang.String" jdbcType="VARCHAR" property="expressSn" />
        <result column="express" javaType="java.lang.String" jdbcType="VARCHAR" property="express" />
        <result column="express_company" javaType="java.lang.String" jdbcType="VARCHAR" property="expressCompany" />
        <result column="remarks" javaType="java.lang.String" jdbcType="VARCHAR" property="remarks" />
        <!--    &amp;amp;lt;result column="accounting_state_supplier" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="accounting_state_customer" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="invoice_status" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="invoice_apply_sn" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="invoice_number" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="oper_account" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="oper_name" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <result column="pay_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="payTime" />
        <result column="send_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="sendTime" />
        <result column="finish_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="finishTime" />
        <result column="accounting_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="accountingTime" />
        <!--    &amp;amp;lt;result column="back_account_status" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <result column="sync_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="syncTime" />
        <result column="storage_status" javaType="java.lang.Integer" jdbcType="TINYINT" property="storageStatus" />
        <result column="storage_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="storageTime" />
        <collection columnPrefix="g_" property="orderGoodsSelected" resultMap="goodsMap" />
    </resultMap>

    <resultMap id="goodsMap" type="cn.superdesk.uniorder.dto.vo.thirdpart.qchjc.accounting.QchjcOrderGoodsVo">
        <id column="id" javaType="java.lang.Long" jdbcType="BIGINT" property="id" />
        <result column="unified_id" javaType="java.lang.Long" jdbcType="BIGINT" property="unifiedOrderGoodsId" />
        <result column="order_sn" javaType="java.lang.String" jdbcType="VARCHAR" property="orderSn" />
        <result column="goods_name" javaType="java.lang.String" jdbcType="VARCHAR" property="goodsName" />
        <result column="goods_alias" javaType="java.lang.String" jdbcType="VARCHAR" property="goodsAlias" />
        <result column="goods_id" javaType="java.lang.String" jdbcType="VARCHAR" property="goodsId" />
        <result column="out_snapshot_order_goods_id" javaType="java.lang.String" jdbcType="VARCHAR" property="outSnapshotOrderGoodsId" />
        <result column="goods_type" javaType="java.lang.Integer" jdbcType="TINYINT" property="goodsType" />
        <result column="quantity" javaType="java.lang.Integer" jdbcType="INTEGER" property="quantity" />
        <result column="unit" javaType="java.lang.String" jdbcType="VARCHAR" property="unit" />
        <result column="selling_price" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="sellingPrice" />
        <result column="cost_price" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="costPrice" />
        <!--    &amp;amp;lt;result column="fiscal_code" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="tax_code" property="" javaType="java.lang.String" jdbcType="VARCHAR" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="tax_rate" property="" javaType="java.math.BigDecimal" jdbcType="DECIMAL" /&amp;amp;gt;-->
        <result column="merch_tax_id" javaType="java.lang.String" jdbcType="VARCHAR" property="merchTaxId" />
        <result column="merch_tax_code" javaType="java.lang.String" jdbcType="VARCHAR" property="merchTaxCode" />
        <result column="merch_tax_rate" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="merchTaxRate" />
        <result column="operation_tax_id" javaType="java.lang.String" jdbcType="VARCHAR" property="operationTaxId" />
        <result column="operation_tax_code" javaType="java.lang.String" jdbcType="VARCHAR" property="operationTaxCode" />
        <result column="operation_tax_rate" javaType="java.math.BigDecimal" jdbcType="DECIMAL" property="operationTaxRate" />
        <result column="cate_id_lv1" javaType="java.lang.String" jdbcType="VARCHAR" property="cateIdLv1" />
        <result column="cate_name_lv1" javaType="java.lang.String" jdbcType="VARCHAR" property="cateNameLv1" />
        <result column="cate_id_lv2" javaType="java.lang.String" jdbcType="VARCHAR" property="cateIdLv2" />
        <result column="cate_name_lv2" javaType="java.lang.String" jdbcType="VARCHAR" property="cateNameLv2" />
        <result column="cate_id_lv3" javaType="java.lang.String" jdbcType="BIGINT" property="cateIdLv3" />
        <result column="cate_name_lv3" javaType="java.lang.String" jdbcType="VARCHAR" property="cateNameLv3" />
        <result column="self_option" javaType="java.lang.String" jdbcType="VARCHAR" property="selfOption" />
        <result column="direction" javaType="java.lang.Integer" jdbcType="TINYINT" property="direction" />
        <!--    &amp;amp;lt;result column="goods_locking_customer" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="goods_locking_supplier" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="accounting_state_customer" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="accounting_state_supplier" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="back_account_status" property="" javaType="java.lang.Integer" jdbcType="TINYINT" /&amp;amp;gt;-->
        <result column="refund_order_sn" javaType="java.lang.String" jdbcType="VARCHAR" property="refundOrderSn" />
        <!--    &amp;amp;lt;result column="create_time" property="" javaType="java.util.Date" jdbcType="TIMESTAMP" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="create_user_id" property="" javaType="java.lang.Long" jdbcType="BIGINT" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="update_time" property="" javaType="java.util.Date" jdbcType="TIMESTAMP" /&amp;amp;gt;-->
        <!--    &amp;amp;lt;result column="update_user_id" property="" javaType="java.lang.Long" jdbcType="BIGINT" /&amp;amp;gt;-->
        <result column="goods_params" javaType="java.lang.String" jdbcType="VARCHAR" property="goodsParams" />
        <result column="sync_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="syncTime" />
        <result column="storage_status" javaType="java.lang.Integer" jdbcType="TINYINT" property="storageStatus" />
        <result column="storage_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="storageTime" />
    </resultMap>

    <select id="getTodoList" parameterType="java.lang.Long" resultMap="customerStatementResMap">
        SELECT t1.*,
               t2.id                               AS o_id,
               t2.unified_id                       AS o_unified_id,
               t2.customer_accounting_order_sn     AS o_accounting_order_sn,
               t2.order_sn                         AS o_order_sn,
               t2.order_sn_out_trade               AS o_order_sn_out_trade,
               t2.out_snapshot_order_id            AS o_out_snapshot_order_id,
               t2.service_name                     AS o_service_name,
               t2.service_no                       AS o_service_no,
               t2.project_id                       AS o_project_id,
               t2.project_name                     AS o_project_name,
               t2.purchase_virt_id                 AS o_purchase_virt_id,
               t2.purchase_virt_name               AS o_purchase_virt_name,
               t2.purchase_department_name         AS o_purchase_department_name,
               t2.purchase_user_id                 AS o_purchase_user_id,
               t2.purchase_user_name               AS o_purchase_user_name,
               t2.purchase_phone                   AS o_purchase_phone,
               t2.sale_id                          AS o_sale_id,
               t2.sale_name                        AS o_sale_name,
               t2.amount                           AS o_amount,
               t2.cost_amount                      AS o_cost_amount,
               t2.transport_amount                 AS o_transport_amount,
               t2.transport_merchant_assume_amount AS o_transport_merchant_assume_amount,
               t2.goods_amount                     AS o_goods_amount,
               t2.goods_cost_amount                AS o_goods_cost_amount,
               t2.refund_goods_amount              AS o_refund_goods_amount,
               t2.refund_goods_cost_amount         AS o_refund_goods_cost_amount,
               t2.complet_state                    AS o_complet_state,
               t2.order_locking_customer           AS o_order_locking_customer,
               t2.order_locking_supplier           AS o_order_locking_supplier,
               t2.pay_type                         AS o_pay_type,
               t2.pay_type_name                    AS o_pay_type_name,
               t2.pay_state                        AS o_pay_state,
               t2.pay_state_name                   AS o_pay_state_name,
               t2.order_state                      AS o_order_state,
               t2.order_state_name                 AS o_order_state_name,
               t2.settlement_type                  AS o_settlement_type,
               t2.appraise_state                   AS o_appraise_state,
               t2.source_channel                   AS o_source_channel,
               t2.other_params                     AS o_other_params,
               t2.user_type                        AS o_user_type,
               t2.user_name                        AS o_user_name,
               t2.create_time                      AS o_create_time,
               t2.create_user_id                   AS o_create_user_id,
               t2.update_time                      AS o_update_time,
               t2.update_user_id                   AS o_update_user_id,
               t2.order_type                       AS o_order_type,
               t2.refund_order_sn                  AS o_refund_order_sn,
               t2.rec_user_name                    AS o_rec_user_name,
               t2.rec_user_id                      AS o_rec_user_id,
               t2.rec_user_phone                   AS o_rec_user_phone,
               t2.rec_address                      AS o_rec_address,
               t2.express_sn                       AS o_express_sn,
               t2.express                          AS o_express,
               t2.express_company                  AS o_express_company,
               t2.remarks                          AS o_remarks,
               t2.accounting_state_supplier        AS o_accounting_state_supplier,
               t2.accounting_state_customer        AS o_accounting_state_customer,
               t2.invoice_status                   AS o_invoice_status,
               t2.invoice_apply_sn                 AS o_invoice_apply_sn,
               t2.invoice_number                   AS o_invoice_number,
               t2.oper_account                     AS o_oper_account,
               t2.oper_name                        AS o_oper_name,
               t2.pay_time                         AS o_pay_time,
               t2.send_time                        AS o_send_time,
               t2.finish_time                      AS o_finish_time,
               t2.accounting_time                  AS o_accounting_time,
               t2.back_account_status              AS o_back_account_status,
               t2.sync_time                        AS o_sync_time,
               t2.storage_status                   AS o_storage_status,
               t2.storage_time                     AS o_storage_time,
               t3.id                               as o_g_id,
               t3.unified_id                       as o_g_unified_id,
               t3.order_sn                         as o_g_order_sn,
               t3.goods_name                       as o_g_goods_name,
               t3.goods_alias                      as o_g_goods_alias,
               t3.goods_id                         as o_g_goods_id,
               t3.out_snapshot_order_goods_id      as o_g_out_snapshot_order_goods_id,
               t3.goods_type                       as o_g_goods_type,
               t3.quantity                         as o_g_quantity,
               t3.unit                             as o_g_unit,
               t3.selling_price                    as o_g_selling_price,
               t3.cost_price                       as o_g_cost_price,
               t3.fiscal_code                      as o_g_fiscal_code,
               t3.tax_code                         as o_g_tax_code,
               t3.tax_rate                         as o_g_tax_rate,
               t3.merch_tax_id                     as o_g_merch_tax_id,
               t3.merch_tax_code                   as o_g_merch_tax_code,
               t3.merch_tax_rate                   as o_g_merch_tax_rate,
               t3.operation_tax_id                 as o_g_operation_tax_id,
               t3.operation_tax_code               as o_g_operation_tax_code,
               t3.operation_tax_rate               as o_g_operation_tax_rate,
               t3.cate_id_lv1                      as o_g_cate_id_lv1,
               t3.cate_name_lv1                    as o_g_cate_name_lv1,
               t3.cate_id_lv2                      as o_g_cate_id_lv2,
               t3.cate_name_lv2                    as o_g_cate_name_lv2,
               t3.cate_id_lv3                      as o_g_cate_id_lv3,
               t3.cate_name_lv3                    as o_g_cate_name_lv3,
               t3.self_option                      as o_g_self_option,
               t3.direction                        as o_g_direction,
               t3.goods_locking_customer           as o_g_goods_locking_customer,
               t3.goods_locking_supplier           as o_g_goods_locking_supplier,
               t3.accounting_state_customer        as o_g_accounting_state_customer,
               t3.accounting_state_supplier        as o_g_accounting_state_supplier,
               t3.back_account_status              as o_g_back_account_status,
               t3.refund_order_sn                  as o_g_refund_order_sn,
               t3.create_time                      as o_g_create_time,
               t3.create_user_id                   as o_g_create_user_id,
               t3.update_time                      as o_g_update_time,
               t3.update_user_id                   as o_g_update_user_id,
               t3.goods_params                     as o_g_goods_params,
               t3.sync_time                        as o_g_sync_time,
               t3.storage_status                   as o_g_storage_status,
               t3.storage_time                     as o_g_storage_time
        FROM qchjc_accounting_score_customer t1
                 LEFT JOIN qchjc_order t2 ON t1.accounting_order_sn = t2.customer_accounting_order_sn
                 LEFT JOIN qchjc_order_goods t3 ON t2.order_sn = t3.order_sn
        WHERE t1.storage_status = 0 and t1.id = #{id} and t3.customer_accounting_order_sn is not null
    </select>
    <select id="selectByAccountingOrderSn" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from qchjc_accounting_score_customer
        where accounting_order_sn = #{accountingOrderSn}
    </select>
    <select id="queryQchjcCustomerStatementList" resultType="cn.superdesk.uniorder.dto.vo.thirdpart.qchjc.accounting.QchjcCustomerStatementVo">
        SELECT
        id,
        unified_id as unifiedId,
        storage_time as storageTime,
        storage_status as storageStatus,
        accounting_order_sn as accountingOrderSn,
        purchase_virt_name as purchaseVirtName,
        create_user_name as applyUserName,
        accounting_amount as accountingAmount,
        statistics_total_amount as statisticsTotalAmount,
        un_accounting_amount as unAccountingAmount,
        concat( DATE_FORMAT(start_time,'%Y-%m-%d'), '~', DATE_FORMAT(end_time,'%Y-%m-%d') ) AS billCycle,
        accounting_status as accountingStatus,
        invoice_status as invoiceStatus,
        receive_invoice_status as receiveInvoiceStatus,
        back_account_status as backAccountStatus,
        remark,
        case storage_status when 0 then '' when 1 then '入库成功' else IF ( LENGTH( storage_reason ) &lt; 100, storage_reason, '入库失败：请联系技术人员排查问题' )  end as storageReason,
        create_user_name as createUserName,
        create_time as createTime,
        update_user_name as updateUserName,
        update_time as updateTime
        FROM
        qchjc_accounting_score_customer
        where 1 = 1
        <if test="accountingOrderSn != null and accountingOrderSn != ''">
            and accounting_order_sn = #{accountingOrderSn}
        </if>
        <if test="customerName != null and customerName != ''">
            and purchase_virt_name = #{customerName}
        </if>
        <if test="applyUserName != null and applyUserName != ''">
            and create_user_name like concat('%',#{applyUserName},'%')
        </if>
        <if test="createUserName != null and createUserName != ''">
            and create_user_name like concat('%',#{createUserName},'%')
        </if>
        <if test="updateUserName != null and updateUserName != ''">
            and update_user_name like concat('%',#{updateUserName},'%')
        </if>
        <if test="storageStatus != null">
            and storage_status = #{storageStatus}
        </if>
        <if test="accountingStatus != null">
            and accounting_status = #{accountingStatus}
        </if>
        <if test="invoiceStatus != null">
            and invoice_status = #{invoiceStatus}
        </if>
        <if test="receiveInvoiceStatus != null">
            and receive_invoice_status = #{receiveInvoiceStatus}
        </if>
        <if test="backAccountStatus != null">
            and back_account_status = #{backAccountStatus}
        </if>
        <if test="storageStartTime != null and storageStartTime != ''">
            and storage_time &gt; concat(#{storageStartTime}, ' 00:00:00')
        </if>
        <if test="storageEndTime != null and storageEndTime != ''">
            and storage_time &lt; concat(#{storageEndTime}, ' 23:59:59')
        </if>
        <if test="createStartTime != null and createStartTime != ''">
            and create_time &gt; concat(#{createStartTime}, ' 00:00:00')
        </if>
        <if test="createEndTime != null and createEndTime != ''">
            and create_time &lt; concat(#{createEndTime}, ' 23:59:59')
        </if>
        order by create_time desc
    </select>
  <select id="queryQchjcCustomerStatementVoById" resultType="cn.superdesk.uniorder.dto.vo.thirdpart.qchjc.accounting.QchjcCustomerStatementVo">
    SELECT
      t1.accounting_order_sn AS accountingOrderSn,
      t1.storage_status AS storageStatus,
      t1.storage_time AS storageTime,
      t1.purchase_virt_name AS purchaseVirtName,
      t1.accounting_amount AS accountingAmount,
      t1.statistics_total_amount AS statisticsTotalAmount,
      t1.order_goods_count AS orderCount,
      t1.accounting_status AS accountingStatus,
      concat( DATE_FORMAT( t1.start_time, '%Y-%m-%d' ), '~', DATE_FORMAT( t1.end_time, '%Y-%m-%d' ) ) AS billCycle,
      t1.invoice_status AS invoiceStatus,
      t1.receive_invoice_status AS receiveInvoiceStatus,
      t1.back_account_status AS backAccountStatus,
      t1.remark,
      t1.create_user_name AS createUserName,
      t1.create_time AS createTime,
      t1.update_user_name AS updateUserName,
      t1.update_time AS updateTime
    FROM
      qchjc_accounting_score_customer t1
    WHERE
      t1.id = #{id}
  </select>
  <select id="getTodoIdList" resultType="java.lang.Long">
    select id from qchjc_accounting_score_customer where storage_status = 0;
  </select>
</mapper>