<?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._statistics.StReceivableDetailDataEntityMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDetailDataEntity">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="credit_id" jdbcType="BIGINT" property="creditId" />
    <result column="settlement_id" jdbcType="BIGINT" property="settlementId" />
    <result column="settlement_name" jdbcType="VARCHAR" property="settlementName" />
    <result column="order_sn" jdbcType="VARCHAR" property="orderSn" />
    <result column="credit_no" jdbcType="VARCHAR" property="creditNo" />
    <result column="refund_order_sn" jdbcType="VARCHAR" property="refundOrderSn" />
    <result column="service_no" jdbcType="VARCHAR" property="serviceNo" />
    <result column="service_no_name" jdbcType="VARCHAR" property="serviceNoName" />
    <result column="order_state" jdbcType="TINYINT" property="orderState" />
    <result column="order_state_name" jdbcType="VARCHAR" property="orderStateName" />
    <result column="bill_created_at" jdbcType="TIMESTAMP" property="billCreatedAt" />
    <result column="finish_time" jdbcType="TIMESTAMP" property="finishTime" />
    <result column="goods_id" jdbcType="BIGINT" property="goodsId" />
    <result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
    <result column="goods_unit" jdbcType="VARCHAR" property="goodsUnit" />
    <result column="goods_quantity" jdbcType="BIGINT" property="goodsQuantity" />
    <result column="goods_price" jdbcType="DECIMAL" property="goodsPrice" />
    <result column="goods_total_amount" jdbcType="DECIMAL" property="goodsTotalAmount" />
    <result column="credit_type" jdbcType="TINYINT" property="creditType" />
    <result column="credit_name" jdbcType="VARCHAR" property="creditName" />
    <result column="balance" jdbcType="DECIMAL" property="balance" />
    <result column="operation_tax_rate" jdbcType="DECIMAL" property="operationTaxRate" />
    <result column="operation_tax_code" jdbcType="VARCHAR" property="operationTaxCode" />
    <result column="accounting_order_sn" jdbcType="VARCHAR" property="accountingOrderSn" />
    <result column="accounting_state" jdbcType="TINYINT" property="accountingState" />
    <result column="make_invoice_status" jdbcType="TINYINT" property="makeInvoiceStatus" />
    <result column="back_status" jdbcType="TINYINT" property="backStatus" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="income_no_tax" jdbcType="DECIMAL" property="incomeNoTax" />
    <result column="tax_amount" jdbcType="DECIMAL" property="taxAmount" />
    <result column="receivable_amount" jdbcType="DECIMAL" property="receivableAmount" />
    <result column="account_at" jdbcType="TIMESTAMP" property="accountAt" />
    <result column="update_user_id" jdbcType="BIGINT" property="updateUserId" />
    <result column="update_user_name" jdbcType="VARCHAR" property="updateUserName" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
    <result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
    <result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
    <result column="receivable_day_id" jdbcType="BIGINT" property="receivableDayId" />
    <result column="charge_receivable_day_id" jdbcType="BIGINT" property="chargeReceivableDayId" />
    <result column="collection_order_sn" jdbcType="VARCHAR" property="collectionOrderSn" />
    <result column="charge_status" jdbcType="TINYINT" property="chargeStatus" />
    <result column="charge_user_id" jdbcType="BIGINT" property="chargeUserId" />
    <result column="charge_created_at" jdbcType="TIMESTAMP" property="chargeCreatedAt" />
    <result column="charge_user_name" jdbcType="VARCHAR" property="chargeUserName" />
    <result column="account_state" jdbcType="TINYINT" property="accountState" />
  </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, credit_id, settlement_id, settlement_name, order_sn, credit_no, refund_order_sn, 
    service_no, service_no_name, order_state, order_state_name, bill_created_at, finish_time, 
    goods_id, goods_name, goods_unit, goods_quantity, goods_price, goods_total_amount, 
    credit_type, credit_name, balance, operation_tax_rate, operation_tax_code, accounting_order_sn, 
    accounting_state, make_invoice_status, back_status, remark, income_no_tax, tax_amount, 
    receivable_amount, account_at, update_user_id, update_user_name, update_time, created_at, 
    create_user_id, create_user_name, receivable_day_id, charge_receivable_day_id, collection_order_sn, 
    charge_status, charge_user_id, charge_created_at, charge_user_name, account_state
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDetailDataEntityExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from st_receivable_detail_data
    <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 st_receivable_detail_data
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from st_receivable_detail_data
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDetailDataEntityExample">
    delete from st_receivable_detail_data
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDetailDataEntity">
    insert into st_receivable_detail_data (id, credit_id, settlement_id, 
      settlement_name, order_sn, credit_no, 
      refund_order_sn, service_no, service_no_name, 
      order_state, order_state_name, bill_created_at, 
      finish_time, goods_id, goods_name, 
      goods_unit, goods_quantity, goods_price, 
      goods_total_amount, credit_type, credit_name, 
      balance, operation_tax_rate, operation_tax_code, 
      accounting_order_sn, accounting_state, make_invoice_status, 
      back_status, remark, income_no_tax, 
      tax_amount, receivable_amount, account_at, 
      update_user_id, update_user_name, update_time, 
      created_at, create_user_id, create_user_name, 
      receivable_day_id, charge_receivable_day_id, collection_order_sn, 
      charge_status, charge_user_id, charge_created_at, 
      charge_user_name, account_state)
    values (#{id,jdbcType=BIGINT}, #{creditId,jdbcType=BIGINT}, #{settlementId,jdbcType=BIGINT}, 
      #{settlementName,jdbcType=VARCHAR}, #{orderSn,jdbcType=VARCHAR}, #{creditNo,jdbcType=VARCHAR}, 
      #{refundOrderSn,jdbcType=VARCHAR}, #{serviceNo,jdbcType=VARCHAR}, #{serviceNoName,jdbcType=VARCHAR}, 
      #{orderState,jdbcType=TINYINT}, #{orderStateName,jdbcType=VARCHAR}, #{billCreatedAt,jdbcType=TIMESTAMP}, 
      #{finishTime,jdbcType=TIMESTAMP}, #{goodsId,jdbcType=BIGINT}, #{goodsName,jdbcType=VARCHAR}, 
      #{goodsUnit,jdbcType=VARCHAR}, #{goodsQuantity,jdbcType=BIGINT}, #{goodsPrice,jdbcType=DECIMAL}, 
      #{goodsTotalAmount,jdbcType=DECIMAL}, #{creditType,jdbcType=TINYINT}, #{creditName,jdbcType=VARCHAR}, 
      #{balance,jdbcType=DECIMAL}, #{operationTaxRate,jdbcType=DECIMAL}, #{operationTaxCode,jdbcType=VARCHAR}, 
      #{accountingOrderSn,jdbcType=VARCHAR}, #{accountingState,jdbcType=TINYINT}, #{makeInvoiceStatus,jdbcType=TINYINT}, 
      #{backStatus,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, #{incomeNoTax,jdbcType=DECIMAL}, 
      #{taxAmount,jdbcType=DECIMAL}, #{receivableAmount,jdbcType=DECIMAL}, #{accountAt,jdbcType=TIMESTAMP}, 
      #{updateUserId,jdbcType=BIGINT}, #{updateUserName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{createdAt,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=BIGINT}, #{createUserName,jdbcType=VARCHAR}, 
      #{receivableDayId,jdbcType=BIGINT}, #{chargeReceivableDayId,jdbcType=BIGINT}, #{collectionOrderSn,jdbcType=VARCHAR}, 
      #{chargeStatus,jdbcType=TINYINT}, #{chargeUserId,jdbcType=BIGINT}, #{chargeCreatedAt,jdbcType=TIMESTAMP}, 
      #{chargeUserName,jdbcType=VARCHAR}, #{accountState,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDetailDataEntity">
    insert into st_receivable_detail_data
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="creditId != null">
        credit_id,
      </if>
      <if test="settlementId != null">
        settlement_id,
      </if>
      <if test="settlementName != null">
        settlement_name,
      </if>
      <if test="orderSn != null">
        order_sn,
      </if>
      <if test="creditNo != null">
        credit_no,
      </if>
      <if test="refundOrderSn != null">
        refund_order_sn,
      </if>
      <if test="serviceNo != null">
        service_no,
      </if>
      <if test="serviceNoName != null">
        service_no_name,
      </if>
      <if test="orderState != null">
        order_state,
      </if>
      <if test="orderStateName != null">
        order_state_name,
      </if>
      <if test="billCreatedAt != null">
        bill_created_at,
      </if>
      <if test="finishTime != null">
        finish_time,
      </if>
      <if test="goodsId != null">
        goods_id,
      </if>
      <if test="goodsName != null">
        goods_name,
      </if>
      <if test="goodsUnit != null">
        goods_unit,
      </if>
      <if test="goodsQuantity != null">
        goods_quantity,
      </if>
      <if test="goodsPrice != null">
        goods_price,
      </if>
      <if test="goodsTotalAmount != null">
        goods_total_amount,
      </if>
      <if test="creditType != null">
        credit_type,
      </if>
      <if test="creditName != null">
        credit_name,
      </if>
      <if test="balance != null">
        balance,
      </if>
      <if test="operationTaxRate != null">
        operation_tax_rate,
      </if>
      <if test="operationTaxCode != null">
        operation_tax_code,
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn,
      </if>
      <if test="accountingState != null">
        accounting_state,
      </if>
      <if test="makeInvoiceStatus != null">
        make_invoice_status,
      </if>
      <if test="backStatus != null">
        back_status,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="incomeNoTax != null">
        income_no_tax,
      </if>
      <if test="taxAmount != null">
        tax_amount,
      </if>
      <if test="receivableAmount != null">
        receivable_amount,
      </if>
      <if test="accountAt != null">
        account_at,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
      <if test="updateUserName != null">
        update_user_name,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="createdAt != null">
        created_at,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="createUserName != null">
        create_user_name,
      </if>
      <if test="receivableDayId != null">
        receivable_day_id,
      </if>
      <if test="chargeReceivableDayId != null">
        charge_receivable_day_id,
      </if>
      <if test="collectionOrderSn != null">
        collection_order_sn,
      </if>
      <if test="chargeStatus != null">
        charge_status,
      </if>
      <if test="chargeUserId != null">
        charge_user_id,
      </if>
      <if test="chargeCreatedAt != null">
        charge_created_at,
      </if>
      <if test="chargeUserName != null">
        charge_user_name,
      </if>
      <if test="accountState != null">
        account_state,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="creditId != null">
        #{creditId,jdbcType=BIGINT},
      </if>
      <if test="settlementId != null">
        #{settlementId,jdbcType=BIGINT},
      </if>
      <if test="settlementName != null">
        #{settlementName,jdbcType=VARCHAR},
      </if>
      <if test="orderSn != null">
        #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="creditNo != null">
        #{creditNo,jdbcType=VARCHAR},
      </if>
      <if test="refundOrderSn != null">
        #{refundOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="serviceNoName != null">
        #{serviceNoName,jdbcType=VARCHAR},
      </if>
      <if test="orderState != null">
        #{orderState,jdbcType=TINYINT},
      </if>
      <if test="orderStateName != null">
        #{orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="billCreatedAt != null">
        #{billCreatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="finishTime != null">
        #{finishTime,jdbcType=TIMESTAMP},
      </if>
      <if test="goodsId != null">
        #{goodsId,jdbcType=BIGINT},
      </if>
      <if test="goodsName != null">
        #{goodsName,jdbcType=VARCHAR},
      </if>
      <if test="goodsUnit != null">
        #{goodsUnit,jdbcType=VARCHAR},
      </if>
      <if test="goodsQuantity != null">
        #{goodsQuantity,jdbcType=BIGINT},
      </if>
      <if test="goodsPrice != null">
        #{goodsPrice,jdbcType=DECIMAL},
      </if>
      <if test="goodsTotalAmount != null">
        #{goodsTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="creditType != null">
        #{creditType,jdbcType=TINYINT},
      </if>
      <if test="creditName != null">
        #{creditName,jdbcType=VARCHAR},
      </if>
      <if test="balance != null">
        #{balance,jdbcType=DECIMAL},
      </if>
      <if test="operationTaxRate != null">
        #{operationTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="operationTaxCode != null">
        #{operationTaxCode,jdbcType=VARCHAR},
      </if>
      <if test="accountingOrderSn != null">
        #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="accountingState != null">
        #{accountingState,jdbcType=TINYINT},
      </if>
      <if test="makeInvoiceStatus != null">
        #{makeInvoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="backStatus != null">
        #{backStatus,jdbcType=TINYINT},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="incomeNoTax != null">
        #{incomeNoTax,jdbcType=DECIMAL},
      </if>
      <if test="taxAmount != null">
        #{taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="receivableAmount != null">
        #{receivableAmount,jdbcType=DECIMAL},
      </if>
      <if test="accountAt != null">
        #{accountAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=BIGINT},
      </if>
      <if test="updateUserName != null">
        #{updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createdAt != null">
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="createUserName != null">
        #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="receivableDayId != null">
        #{receivableDayId,jdbcType=BIGINT},
      </if>
      <if test="chargeReceivableDayId != null">
        #{chargeReceivableDayId,jdbcType=BIGINT},
      </if>
      <if test="collectionOrderSn != null">
        #{collectionOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="chargeStatus != null">
        #{chargeStatus,jdbcType=TINYINT},
      </if>
      <if test="chargeUserId != null">
        #{chargeUserId,jdbcType=BIGINT},
      </if>
      <if test="chargeCreatedAt != null">
        #{chargeCreatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="chargeUserName != null">
        #{chargeUserName,jdbcType=VARCHAR},
      </if>
      <if test="accountState != null">
        #{accountState,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDetailDataEntityExample" resultType="java.lang.Long">
    select count(*) from st_receivable_detail_data
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update st_receivable_detail_data
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.creditId != null">
        credit_id = #{record.creditId,jdbcType=BIGINT},
      </if>
      <if test="record.settlementId != null">
        settlement_id = #{record.settlementId,jdbcType=BIGINT},
      </if>
      <if test="record.settlementName != null">
        settlement_name = #{record.settlementName,jdbcType=VARCHAR},
      </if>
      <if test="record.orderSn != null">
        order_sn = #{record.orderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.creditNo != null">
        credit_no = #{record.creditNo,jdbcType=VARCHAR},
      </if>
      <if test="record.refundOrderSn != null">
        refund_order_sn = #{record.refundOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceNo != null">
        service_no = #{record.serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceNoName != null">
        service_no_name = #{record.serviceNoName,jdbcType=VARCHAR},
      </if>
      <if test="record.orderState != null">
        order_state = #{record.orderState,jdbcType=TINYINT},
      </if>
      <if test="record.orderStateName != null">
        order_state_name = #{record.orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="record.billCreatedAt != null">
        bill_created_at = #{record.billCreatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.finishTime != null">
        finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.goodsId != null">
        goods_id = #{record.goodsId,jdbcType=BIGINT},
      </if>
      <if test="record.goodsName != null">
        goods_name = #{record.goodsName,jdbcType=VARCHAR},
      </if>
      <if test="record.goodsUnit != null">
        goods_unit = #{record.goodsUnit,jdbcType=VARCHAR},
      </if>
      <if test="record.goodsQuantity != null">
        goods_quantity = #{record.goodsQuantity,jdbcType=BIGINT},
      </if>
      <if test="record.goodsPrice != null">
        goods_price = #{record.goodsPrice,jdbcType=DECIMAL},
      </if>
      <if test="record.goodsTotalAmount != null">
        goods_total_amount = #{record.goodsTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.creditType != null">
        credit_type = #{record.creditType,jdbcType=TINYINT},
      </if>
      <if test="record.creditName != null">
        credit_name = #{record.creditName,jdbcType=VARCHAR},
      </if>
      <if test="record.balance != null">
        balance = #{record.balance,jdbcType=DECIMAL},
      </if>
      <if test="record.operationTaxRate != null">
        operation_tax_rate = #{record.operationTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="record.operationTaxCode != null">
        operation_tax_code = #{record.operationTaxCode,jdbcType=VARCHAR},
      </if>
      <if test="record.accountingOrderSn != null">
        accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.accountingState != null">
        accounting_state = #{record.accountingState,jdbcType=TINYINT},
      </if>
      <if test="record.makeInvoiceStatus != null">
        make_invoice_status = #{record.makeInvoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="record.backStatus != null">
        back_status = #{record.backStatus,jdbcType=TINYINT},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.incomeNoTax != null">
        income_no_tax = #{record.incomeNoTax,jdbcType=DECIMAL},
      </if>
      <if test="record.taxAmount != null">
        tax_amount = #{record.taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.receivableAmount != null">
        receivable_amount = #{record.receivableAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.accountAt != null">
        account_at = #{record.accountAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      </if>
      <if test="record.updateUserName != null">
        update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createdAt != null">
        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=BIGINT},
      </if>
      <if test="record.createUserName != null">
        create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.receivableDayId != null">
        receivable_day_id = #{record.receivableDayId,jdbcType=BIGINT},
      </if>
      <if test="record.chargeReceivableDayId != null">
        charge_receivable_day_id = #{record.chargeReceivableDayId,jdbcType=BIGINT},
      </if>
      <if test="record.collectionOrderSn != null">
        collection_order_sn = #{record.collectionOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.chargeStatus != null">
        charge_status = #{record.chargeStatus,jdbcType=TINYINT},
      </if>
      <if test="record.chargeUserId != null">
        charge_user_id = #{record.chargeUserId,jdbcType=BIGINT},
      </if>
      <if test="record.chargeCreatedAt != null">
        charge_created_at = #{record.chargeCreatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.chargeUserName != null">
        charge_user_name = #{record.chargeUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.accountState != null">
        account_state = #{record.accountState,jdbcType=TINYINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update st_receivable_detail_data
    set id = #{record.id,jdbcType=BIGINT},
      credit_id = #{record.creditId,jdbcType=BIGINT},
      settlement_id = #{record.settlementId,jdbcType=BIGINT},
      settlement_name = #{record.settlementName,jdbcType=VARCHAR},
      order_sn = #{record.orderSn,jdbcType=VARCHAR},
      credit_no = #{record.creditNo,jdbcType=VARCHAR},
      refund_order_sn = #{record.refundOrderSn,jdbcType=VARCHAR},
      service_no = #{record.serviceNo,jdbcType=VARCHAR},
      service_no_name = #{record.serviceNoName,jdbcType=VARCHAR},
      order_state = #{record.orderState,jdbcType=TINYINT},
      order_state_name = #{record.orderStateName,jdbcType=VARCHAR},
      bill_created_at = #{record.billCreatedAt,jdbcType=TIMESTAMP},
      finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
      goods_id = #{record.goodsId,jdbcType=BIGINT},
      goods_name = #{record.goodsName,jdbcType=VARCHAR},
      goods_unit = #{record.goodsUnit,jdbcType=VARCHAR},
      goods_quantity = #{record.goodsQuantity,jdbcType=BIGINT},
      goods_price = #{record.goodsPrice,jdbcType=DECIMAL},
      goods_total_amount = #{record.goodsTotalAmount,jdbcType=DECIMAL},
      credit_type = #{record.creditType,jdbcType=TINYINT},
      credit_name = #{record.creditName,jdbcType=VARCHAR},
      balance = #{record.balance,jdbcType=DECIMAL},
      operation_tax_rate = #{record.operationTaxRate,jdbcType=DECIMAL},
      operation_tax_code = #{record.operationTaxCode,jdbcType=VARCHAR},
      accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      accounting_state = #{record.accountingState,jdbcType=TINYINT},
      make_invoice_status = #{record.makeInvoiceStatus,jdbcType=TINYINT},
      back_status = #{record.backStatus,jdbcType=TINYINT},
      remark = #{record.remark,jdbcType=VARCHAR},
      income_no_tax = #{record.incomeNoTax,jdbcType=DECIMAL},
      tax_amount = #{record.taxAmount,jdbcType=DECIMAL},
      receivable_amount = #{record.receivableAmount,jdbcType=DECIMAL},
      account_at = #{record.accountAt,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      receivable_day_id = #{record.receivableDayId,jdbcType=BIGINT},
      charge_receivable_day_id = #{record.chargeReceivableDayId,jdbcType=BIGINT},
      collection_order_sn = #{record.collectionOrderSn,jdbcType=VARCHAR},
      charge_status = #{record.chargeStatus,jdbcType=TINYINT},
      charge_user_id = #{record.chargeUserId,jdbcType=BIGINT},
      charge_created_at = #{record.chargeCreatedAt,jdbcType=TIMESTAMP},
      charge_user_name = #{record.chargeUserName,jdbcType=VARCHAR},
      account_state = #{record.accountState,jdbcType=TINYINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDetailDataEntity">
    update st_receivable_detail_data
    <set>
      <if test="creditId != null">
        credit_id = #{creditId,jdbcType=BIGINT},
      </if>
      <if test="settlementId != null">
        settlement_id = #{settlementId,jdbcType=BIGINT},
      </if>
      <if test="settlementName != null">
        settlement_name = #{settlementName,jdbcType=VARCHAR},
      </if>
      <if test="orderSn != null">
        order_sn = #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="creditNo != null">
        credit_no = #{creditNo,jdbcType=VARCHAR},
      </if>
      <if test="refundOrderSn != null">
        refund_order_sn = #{refundOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        service_no = #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="serviceNoName != null">
        service_no_name = #{serviceNoName,jdbcType=VARCHAR},
      </if>
      <if test="orderState != null">
        order_state = #{orderState,jdbcType=TINYINT},
      </if>
      <if test="orderStateName != null">
        order_state_name = #{orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="billCreatedAt != null">
        bill_created_at = #{billCreatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="finishTime != null">
        finish_time = #{finishTime,jdbcType=TIMESTAMP},
      </if>
      <if test="goodsId != null">
        goods_id = #{goodsId,jdbcType=BIGINT},
      </if>
      <if test="goodsName != null">
        goods_name = #{goodsName,jdbcType=VARCHAR},
      </if>
      <if test="goodsUnit != null">
        goods_unit = #{goodsUnit,jdbcType=VARCHAR},
      </if>
      <if test="goodsQuantity != null">
        goods_quantity = #{goodsQuantity,jdbcType=BIGINT},
      </if>
      <if test="goodsPrice != null">
        goods_price = #{goodsPrice,jdbcType=DECIMAL},
      </if>
      <if test="goodsTotalAmount != null">
        goods_total_amount = #{goodsTotalAmount,jdbcType=DECIMAL},
      </if>
      <if test="creditType != null">
        credit_type = #{creditType,jdbcType=TINYINT},
      </if>
      <if test="creditName != null">
        credit_name = #{creditName,jdbcType=VARCHAR},
      </if>
      <if test="balance != null">
        balance = #{balance,jdbcType=DECIMAL},
      </if>
      <if test="operationTaxRate != null">
        operation_tax_rate = #{operationTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="operationTaxCode != null">
        operation_tax_code = #{operationTaxCode,jdbcType=VARCHAR},
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="accountingState != null">
        accounting_state = #{accountingState,jdbcType=TINYINT},
      </if>
      <if test="makeInvoiceStatus != null">
        make_invoice_status = #{makeInvoiceStatus,jdbcType=TINYINT},
      </if>
      <if test="backStatus != null">
        back_status = #{backStatus,jdbcType=TINYINT},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="incomeNoTax != null">
        income_no_tax = #{incomeNoTax,jdbcType=DECIMAL},
      </if>
      <if test="taxAmount != null">
        tax_amount = #{taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="receivableAmount != null">
        receivable_amount = #{receivableAmount,jdbcType=DECIMAL},
      </if>
      <if test="accountAt != null">
        account_at = #{accountAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=BIGINT},
      </if>
      <if test="updateUserName != null">
        update_user_name = #{updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createdAt != null">
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="createUserName != null">
        create_user_name = #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="receivableDayId != null">
        receivable_day_id = #{receivableDayId,jdbcType=BIGINT},
      </if>
      <if test="chargeReceivableDayId != null">
        charge_receivable_day_id = #{chargeReceivableDayId,jdbcType=BIGINT},
      </if>
      <if test="collectionOrderSn != null">
        collection_order_sn = #{collectionOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="chargeStatus != null">
        charge_status = #{chargeStatus,jdbcType=TINYINT},
      </if>
      <if test="chargeUserId != null">
        charge_user_id = #{chargeUserId,jdbcType=BIGINT},
      </if>
      <if test="chargeCreatedAt != null">
        charge_created_at = #{chargeCreatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="chargeUserName != null">
        charge_user_name = #{chargeUserName,jdbcType=VARCHAR},
      </if>
      <if test="accountState != null">
        account_state = #{accountState,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDetailDataEntity">
    update st_receivable_detail_data
    set credit_id = #{creditId,jdbcType=BIGINT},
      settlement_id = #{settlementId,jdbcType=BIGINT},
      settlement_name = #{settlementName,jdbcType=VARCHAR},
      order_sn = #{orderSn,jdbcType=VARCHAR},
      credit_no = #{creditNo,jdbcType=VARCHAR},
      refund_order_sn = #{refundOrderSn,jdbcType=VARCHAR},
      service_no = #{serviceNo,jdbcType=VARCHAR},
      service_no_name = #{serviceNoName,jdbcType=VARCHAR},
      order_state = #{orderState,jdbcType=TINYINT},
      order_state_name = #{orderStateName,jdbcType=VARCHAR},
      bill_created_at = #{billCreatedAt,jdbcType=TIMESTAMP},
      finish_time = #{finishTime,jdbcType=TIMESTAMP},
      goods_id = #{goodsId,jdbcType=BIGINT},
      goods_name = #{goodsName,jdbcType=VARCHAR},
      goods_unit = #{goodsUnit,jdbcType=VARCHAR},
      goods_quantity = #{goodsQuantity,jdbcType=BIGINT},
      goods_price = #{goodsPrice,jdbcType=DECIMAL},
      goods_total_amount = #{goodsTotalAmount,jdbcType=DECIMAL},
      credit_type = #{creditType,jdbcType=TINYINT},
      credit_name = #{creditName,jdbcType=VARCHAR},
      balance = #{balance,jdbcType=DECIMAL},
      operation_tax_rate = #{operationTaxRate,jdbcType=DECIMAL},
      operation_tax_code = #{operationTaxCode,jdbcType=VARCHAR},
      accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      accounting_state = #{accountingState,jdbcType=TINYINT},
      make_invoice_status = #{makeInvoiceStatus,jdbcType=TINYINT},
      back_status = #{backStatus,jdbcType=TINYINT},
      remark = #{remark,jdbcType=VARCHAR},
      income_no_tax = #{incomeNoTax,jdbcType=DECIMAL},
      tax_amount = #{taxAmount,jdbcType=DECIMAL},
      receivable_amount = #{receivableAmount,jdbcType=DECIMAL},
      account_at = #{accountAt,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=BIGINT},
      update_user_name = #{updateUserName,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      create_user_name = #{createUserName,jdbcType=VARCHAR},
      receivable_day_id = #{receivableDayId,jdbcType=BIGINT},
      charge_receivable_day_id = #{chargeReceivableDayId,jdbcType=BIGINT},
      collection_order_sn = #{collectionOrderSn,jdbcType=VARCHAR},
      charge_status = #{chargeStatus,jdbcType=TINYINT},
      charge_user_id = #{chargeUserId,jdbcType=BIGINT},
      charge_created_at = #{chargeCreatedAt,jdbcType=TIMESTAMP},
      charge_user_name = #{chargeUserName,jdbcType=VARCHAR},
      account_state = #{accountState,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>