<?xml version="1.0" encoding="UTF-8"?>
	<hibernate-mapping xmlns="http://www.hibernate.org/xsd/hibernate-mapping"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping
		http://www.hibernate.org/xsd/hibernate-mapping/hibernate-mapping-4.0.xsd">
	<class entity-name="com.xyst.dinas.sales.datamodel.NeedPlan" table="xyst_dinas_sales_need_plan" optimistic-lock="version">
		<tuplizer entity-mode="dynamic-map" class="com.beecode.bcp.store.hibernate.KObjectEntityTuplizer"/>
		<id name="id" type="uuid-binary" column="id" length="16">
			<generator class="assigned" />
		</id>
		<version name="version" type="int" column="version"/>
		<property name="createTime" type="timestamp" not-null="false">
			<column name="create_time"></column>
		</property>
		<many-to-one name="creator" entity-name="com.beecode.bap.staff.datamodel.Staff" fetch="select">
			<column name="creator_id"  not-null="false"/>
		</many-to-one>
		<property name="modifyTime" type="timestamp" not-null="false">
			<column name="modify_time"></column>
		</property>
		<many-to-one name="modifier" entity-name="com.beecode.bap.staff.datamodel.Staff" fetch="select">
			<column name="modifier_id"  not-null="false"/>
		</many-to-one>
		<property name="billState" type="nstring" not-null="false">
			<column name="bill_state" length="100"></column>
		</property>
		<many-to-one name="bizProcess" entity-name="com.beecode.bap.workflow.datamodel.BizProcess" fetch="select">
			<column name="biz_process_id"  not-null="false"/>
		</many-to-one>
		<property name="billCode" type="nstring" not-null="false">
			<column name="bill_code" length="200"></column>
		</property>
		<property name="discard" type="boolean" not-null="false">
			<column name="discard"></column>
		</property>
		<property name="del" type="boolean" not-null="false">
			<column name="del"></column>
		</property>
		<property name="approveState" type="integer" not-null="false">
			<column name="approve_state"></column>
		</property>
		<many-to-one name="regionalCompany" entity-name="com.xyst.dinas.biz.datamodel.xystOrganization" fetch="select">
			<column name="regional_company" not-null="false"></column>
		</many-to-one>
		<many-to-one name="project" entity-name="com.xyst.dinas.project.datamodel.ProjectFiled" fetch="select">
			<column name="project" not-null="false"></column>
		</many-to-one>
		<many-to-one name="contract" entity-name="com.xyst.dinas.contract.datamodel.Contract" fetch="select">
			<column name="contract" not-null="false"></column>
		</many-to-one>
		<many-to-one name="purchaseSandUnit" entity-name="com.xyst.dinas.project.datamodel.PurchaseSandCompany" fetch="select">
            <column name="purchase_sand_unit"  not-null="false"/>
        </many-to-one>
		<many-to-one name="planningCycle" entity-name="com.xyst.dinas.biz.datamodel.PlanningCycle" fetch="select">
			<column name="planning_cycle" not-null="false"></column>
		</many-to-one>
		<property name="projectBalance" type="big_decimal" not-null="false">
			<column name="project_balance" precision="12" scale="2"></column>
		</property>
		<property name="transportMode" type="nstring" not-null="false">
			<column name="transport_mode" length="100"></column>
		</property>
		<property name="submitState" type="nstring" not-null="false">
			<column name="submit_state" length="100"></column>
		</property>
		<property name="transportLicensePlateNumber" type="nstring" not-null="false">
			<column name="transport_license_plate_number" length="100"></column>
		</property>
		<property name="needPlanTotalAmount" type="big_decimal" not-null="false">
			<column name="need_plan_total_amount" precision="12" scale="4"></column>
		</property>
		<property name="createUser" type="nstring" not-null="false">
			<column name="create_user" length="100"></column>
		</property>
		<property name="modifyUser" type="nstring" not-null="false">
			<column name="modify_user" length="100"></column>
		</property>
		<bag name="NeedPlanDetails" lazy="true" fetch="select" inverse="true">
			<key column="master_id" not-null="true" />
			<one-to-many entity-name="com.xyst.dinas.sales.datamodel.NeedPlanAssociatedNeedPlanDetail" />
		</bag>
	</class>
	<class entity-name="com.xyst.dinas.sales.datamodel.NeedPlanAssociatedNeedPlanDetail" table="xyst_dinas_sales_need_plan_detail">
		<tuplizer entity-mode="dynamic-map" class="com.beecode.bcp.store.hibernate.KObjectEntityTuplizer"/>
		<id name="id" type="uuid-binary" column="id" length="16">
			<generator class="assigned" />
		</id>
		<many-to-one name="dinasType" entity-name="com.xyst.dinas.biz.datamodel.DinasType" fetch="select">
			<column name="dinas_type" not-null="false"></column>
		</many-to-one>
        <property name="needPlanAmount" type="big_decimal" not-null="false">
			<column name="need_plan_amount" precision="12" scale="4"></column>
		</property>
		<property name="contractAvailableAllowance" type="big_decimal" not-null="false">
			<column name="contract_available_allowance" precision="12" scale="4"></column>
		</property>
		<property name="effectiveSale" type="big_decimal" not-null="false">
			<column name="effective_sale" precision="12" scale="4"></column>
		</property>
		<many-to-one name="master" entity-name="com.xyst.dinas.sales.datamodel.NeedPlan" fetch="select">
			<column name="master_id"  not-null="false"/>
		</many-to-one>
	</class>
</hibernate-mapping>