<?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.organisation.SysEnterpriseExtAccountingMapperEx">

	<insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.organisation.SysEnterpriseExtAccounting">

		<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
			SELECT LAST_INSERT_ID()
		</selectKey>
		insert into sys_enterprise_ext_accounting
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="id != null">
				id,
			</if>
			<if test="serviceNo != null">
				service_no,
			</if>
			<if test="sysOrgId != null">
				sys_org_id,
			</if>
			<if test="sysVirtId != null">
				sys_virt_id,
			</if>
			<if test="outOrgId != null">
				out_org_id,
			</if>
			<if test="outVirtId != null">
				out_virt_id,
			</if>
			<if test="ruleOfAccount != null">
				rule_of_account,
			</if>
			<if test="dayOfMonth != null">
				day_of_month,
			</if>
			<if test="accountPeriod != null">
				account_period,
			</if>
			<if test="isDefault != null">
				is_default,
			</if>
			<if test="deleted != null">
				deleted,
			</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="serviceNo != null">
				#{serviceNo,jdbcType=INTEGER},
			</if>
			<if test="sysOrgId != null">
				#{sysOrgId,jdbcType=BIGINT},
			</if>
			<if test="sysVirtId != null">
				#{sysVirtId,jdbcType=BIGINT},
			</if>
			<if test="outOrgId != null">
				#{outOrgId,jdbcType=BIGINT},
			</if>
			<if test="outVirtId != null">
				#{outVirtId,jdbcType=BIGINT},
			</if>
			<if test="ruleOfAccount != null">
				#{ruleOfAccount,jdbcType=INTEGER},
			</if>
			<if test="dayOfMonth != null">
				#{dayOfMonth,jdbcType=INTEGER},
			</if>
			<if test="accountPeriod != null">
				#{accountPeriod,jdbcType=INTEGER},
			</if>
			<if test="isDefault != null">
				#{isDefault,jdbcType=BIT},
			</if>
			<if test="deleted != null">
				#{deleted,jdbcType=BIT},
			</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>