<?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.base.UnifiedOrderReturnCreditMapperEx">

	<insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderReturnCredit">
		<!--


		  This element was generated on Fri Oct 16 16:53:56 CST 2020.
		-->
		<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
			SELECT LAST_INSERT_ID()
		</selectKey>
		insert into unified_order_return_credit
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="id != null">
				id,
			</if>
			<if test="orderSn != null">
				order_sn,
			</if>
			<if test="orderId != null">
				order_id,
			</if>
			<if test="goodsId != null">
				goods_id,
			</if>
			<if test="outSnapshotOrderCreditId != null">
				out_snapshot_order_credit_id,
			</if>
			<if test="creditType != null">
				credit_type,
			</if>
			<if test="creditName != null">
				credit_name,
			</if>
			<if test="dailyAccountType != null">
				daily_account_type,
			</if>
			<if test="batchs != null">
				batchs,
			</if>
			<if test="balance != null">
				balance,
			</if>
			<if test="enterpriseId != null">
				enterprise_id,
			</if>
			<if test="memberId != null">
				member_id,
			</if>
			<if test="payStatus != null">
				pay_status,
			</if>
			<if test="payType != null">
				pay_type,
			</if>
			<if test="accountingStateCustomer != null">
				accounting_state_customer,
			</if>
			<if test="accountingStateSupplier != null">
				accounting_state_supplier,
			</if>
			<if test="invoiceApplyStatus != null">
				invoice_apply_status,
			</if>
			<if test="invoiceMakeStatus != null">
				invoice_make_status,
			</if>
			<if test="backStatus != null">
				back_status,
			</if>
			<if test="createTime != null">
				create_time,
			</if>
			<if test="createUserId != null">
				create_user_id,
			</if>
			<if test="updateTime != null">
				update_time,
			</if>
			<if test="updateUserId != null">
				update_user_id,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="id != null">
				#{id,jdbcType=BIGINT},
			</if>
			<if test="orderSn != null">
				#{orderSn,jdbcType=VARCHAR},
			</if>
			<if test="orderId != null">
				#{orderId,jdbcType=BIGINT},
			</if>
			<if test="goodsId != null">
				#{goodsId,jdbcType=BIGINT},
			</if>
			<if test="outSnapshotOrderCreditId != null">
				#{outSnapshotOrderCreditId,jdbcType=BIGINT},
			</if>
			<if test="creditType != null">
				#{creditType,jdbcType=INTEGER},
			</if>
			<if test="creditName != null">
				#{creditName,jdbcType=VARCHAR},
			</if>
			<if test="dailyAccountType != null">
				#{dailyAccountType,jdbcType=INTEGER},
			</if>
			<if test="batchs != null">
				#{batchs,jdbcType=VARCHAR},
			</if>
			<if test="balance != null">
				#{balance,jdbcType=DECIMAL},
			</if>
			<if test="enterpriseId != null">
				#{enterpriseId,jdbcType=BIGINT},
			</if>
			<if test="memberId != null">
				#{memberId,jdbcType=BIGINT},
			</if>
			<if test="payStatus != null">
				#{payStatus,jdbcType=INTEGER},
			</if>
			<if test="payType != null">
				#{payType,jdbcType=INTEGER},
			</if>
			<if test="accountingStateCustomer != null">
				#{accountingStateCustomer,jdbcType=TINYINT},
			</if>
			<if test="accountingStateSupplier != null">
				#{accountingStateSupplier,jdbcType=TINYINT},
			</if>
			<if test="invoiceApplyStatus != null">
				#{invoiceApplyStatus,jdbcType=TINYINT},
			</if>
			<if test="invoiceMakeStatus != null">
				#{invoiceMakeStatus,jdbcType=TINYINT},
			</if>
			<if test="backStatus != null">
				#{backStatus,jdbcType=TINYINT},
			</if>
			<if test="createTime != null">
				#{createTime,jdbcType=TIMESTAMP},
			</if>
			<if test="createUserId != null">
				#{createUserId,jdbcType=BIGINT},
			</if>
			<if test="updateTime != null">
				#{updateTime,jdbcType=TIMESTAMP},
			</if>
			<if test="updateUserId != null">
				#{updateUserId,jdbcType=BIGINT},
			</if>
		</trim>
	</insert>
</mapper>