1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: chenlingfeng
$Date: 2017-7-14 上午10:10:50
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:s="leaf.plugin.script" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HN_CHANCE_BP" defaultOrderBy="creation_date desc">
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
-- Call the procedure
hn_chance_bp_pkg.hn_chance_bp_save(p_chance_bp_id => ${@chance_bp_id},
p_chance_bp_name => ${@chance_bp_name},
p_hn_industry_classification => ${@hn_industry_classification},
p_binary_classification => ${@binary_classification},
p_orgcrdno => ${@orgcrdno},
p_unit_id => ${@unit_id},
p_contact_person => ${@contact_person},
p_cell_phone => ${@cell_phone},
p_id_card_no => ${@id_card_no},
p_bp_class => ${@bp_class},
p_enabled_flag => ${@enabled_flag},
p_chance_source => ${@chance_source},
p_user_id => ${/session/@user_id},
p_company_id => ${/session/@company_id}
);
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="chance_bp_id" dataType="java.lang.Long" input="true" output="true" outputPath="@chance_bp_id"/>
</bm:parameters>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
-- Call the procedure
hn_chance_bp_pkg.hn_chance_bp_save(p_chance_bp_id => ${@chance_bp_id},
p_chance_bp_name => ${@chance_bp_name},
p_hn_industry_classification => ${@hn_industry_classification},
p_binary_classification => ${@binary_classification},
p_orgcrdno => ${@orgcrdno},
p_unit_id => ${@unit_id},
p_contact_person => ${@contact_person},
p_cell_phone => ${@cell_phone},
p_id_card_no => ${@id_card_no},
p_bp_class => ${@bp_class},
p_enabled_flag => ${@enabled_flag},
p_chance_source => ${@chance_source},
p_user_id => ${/session/@user_id},
p_company_id => ${/session/@company_id}
);
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="chance_bp_id" dataType="java.lang.Long" input="true" output="true" outputPath="@chance_bp_id"/>
</bm:parameters>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="chance_bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CHANCE_BP_ID" prompt="HN_CHANCE_BP.CHANCE_BP_ID"/>
<bm:field name="chance_bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CHANCE_BP_NAME" prompt="HN_CHANCE_BP.CHANCE_BP_NAME"/>
<bm:field name="hn_industry_classification" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="HN_INDUSTRY_CLASSIFICATION" prompt="HN_CHANCE_BP.HN_INDUSTRY_CLASSIFICATION"/>
<bm:field name="binary_classification" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BINARY_CLASSIFICATION" prompt="HN_CHANCE_BP.BINARY_CLASSIFICATION"/>
<bm:field name="orgcrdno" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ORGCRDNO" prompt="HN_CHANCE_BP.ORGCRDNO"/>
<bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="UNIT_ID" prompt="HN_CHANCE_BP.UNIT_ID"/>
<bm:field name="contact_person" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTACT_PERSON" prompt="HN_CHANCE_BP.CONTACT_PERSON"/>
<bm:field name="cell_phone" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CELL_PHONE" prompt="HN_CHANCE_BP.CELL_PHONE"/>
<bm:field name="owner_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OWNER_USER_ID" prompt="HN_CHANCE_BP.OWNER_USER_ID"/>
<bm:field name="id_card_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ID_CARD_NO" prompt="HN_CHANCE_BP.ID_CARD_NO"/>
<bm:field name="bp_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_CLASS" prompt="HN_CHANCE_BP.BP_CLASS"/>
<bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="HN_CHANCE_BP.ENABLED_FLAG"/>
<bm:field name="chance_source" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="owner_user_id_n" expression="(select description from sys_user su where su.user_id = t1.owner_user_id)" forInsert="false" forUpdate="false"/>
<bm:field name="creation_date_desc" databaseType="DATE" datatype="java.util.Date" expression="trunc(creation_date)" forInsert="false" forUpdate="false"/>
<bm:field name="unit_id_n" expression="(select un.unit_name from exp_org_unit_v un where un.unit_id = t1.unit_id)" forInsert="false" forUpdate="false"/>
<bm:field name="is_bp" expression=" nvl((select '商业伙伴' from dual where exists (select 1 from hls_bp_master hbm where hbm.bp_id = t1.bp_id)), '潜在客户')" forInsert="false" forUpdate="false"/>
<bm:field name="bp_id" databaseType="NUMBER" datatype="java.lang.Long"/>
</bm:fields>
<bm:features>
<f:standard-who/>
<s:bm-script><![CDATA[
var cx = Packages.leaf.javascript.Context.getCurrentContext();
Packages.leaf.plugin.script.engine.ScriptImportor.defineExternScript(cx, this, $ctx.getData(), "aut_authority_bm_validate.js");
]]></s:bm-script>
</bm:features>
<bm:primary-key>
<bm:pk-field name="chance_bp_id"/>
</bm:primary-key>
<bm:query-fields>
<bm:query-field name="chance_bp_name" queryExpression="t1.chance_bp_name like '%'||${@chance_bp_name}||'%'"/>
<bm:query-field name="bp_class" queryExpression="t1.bp_class =${@bp_class}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter expression="t1.bp_id is null"/>
</bm:data-filters>
</bm:model>