|
@@ -6,9 +6,11 @@
|
6
|
6
|
|
7
|
7
|
<resultMap type="CmcContract" id="CmcContractResult">
|
8
|
8
|
<result property="contractId" column="contract_id" />
|
|
9
|
+ <result property="contractName" column="contract_name" />
|
9
|
10
|
<result property="contractCode" column="contract_code" />
|
10
|
11
|
<result property="contractNumber" column="contract_number" />
|
11
|
12
|
<result property="tenderId" column="tender_id" />
|
|
13
|
+ <result property="partyAId" column="party_a_id" />
|
12
|
14
|
<result property="amount" column="amount" />
|
13
|
15
|
<result property="deposit" column="deposit" />
|
14
|
16
|
<result property="contractDocument" column="contract_document" />
|
|
@@ -25,6 +27,7 @@
|
25
|
27
|
<association property="draftUser" javaType="SysUser" resultMap="DraftUserResult" />
|
26
|
28
|
<association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
|
27
|
29
|
<association property="tender" javaType="CmcTender" resultMap="CmcTenderResult" />
|
|
30
|
+ <association property="partyA" javaType="CmcPartyA" resultMap="CmcPartyAResult" />
|
28
|
31
|
</resultMap>
|
29
|
32
|
|
30
|
33
|
<resultMap type="CmcTender" id="CmcTenderResult">
|
|
@@ -48,20 +51,27 @@
|
48
|
51
|
<result property="nickName" column="manager_nick_name" />
|
49
|
52
|
</resultMap>
|
50
|
53
|
|
|
54
|
+ <resultMap type="CmcPartyA" id="CmcPartyAResult">
|
|
55
|
+ <result property="partyAId" column="party_a_id" />
|
|
56
|
+ <result property="partyAName" column="party_a_name" />
|
|
57
|
+ </resultMap>
|
|
58
|
+
|
51
|
59
|
<sql id="selectCmcContractVo">
|
52
|
|
- select c.contract_id, c.contract_code, c.contract_number, c.tender_id, t.project_name as project_name, t.party_a_id as party_a_id, t.a_person as a_person,
|
|
60
|
+ select c.contract_id, c.contract_code, c.contract_name, c.contract_number, c.tender_id, c.party_a_id, pa.party_a_name, t.project_name as project_name, t.party_a_id as party_a_id, t.a_person as a_person,
|
53
|
61
|
t.a_phone as a_phone, t.agent as agent, t.agent_person as agent_person, t.agent_phone as agent_phone, c.amount, c.deposit, c.contract_document,
|
54
|
62
|
c.drafter, u.nick_name as draft_nick_name, c.draft_time, c.remark, c.sign_date, c.sign_remark, c.sign_scan, c.comment_type, c.manager_comment, c.manager_user_id, u1.nick_name as manager_nick_name,
|
55
|
63
|
c.manager_time from cmc_contract as c
|
56
|
64
|
left join sys_user as u on u.user_id = c.drafter
|
57
|
65
|
left join sys_user as u1 on u1.user_id = c.manager_user_id
|
58
|
66
|
left join cmc_tender as t on t.tender_id = c.tender_id
|
|
67
|
+ left join cmc_party_a as pa on pa.party_a_id = c.party_a_id
|
59
|
68
|
</sql>
|
60
|
69
|
|
61
|
70
|
<select id="selectCmcContractList" parameterType="CmcContract" resultMap="CmcContractResult">
|
62
|
71
|
<include refid="selectCmcContractVo"/>
|
63
|
72
|
<where>
|
64
|
73
|
<if test="contractId != null and contractId != ''"> and c.contract_id like concat('%', #{contractId}, '%')</if>
|
|
74
|
+ <if test="contractName!= null and contractName != ''"> and c.contract_name like concat('%', #{contractName}, '%')</if>
|
65
|
75
|
<if test="contractCode!= null and contractCode != ''"> and c.contract_code like concat('%', #{contractCode}, '%')</if>
|
66
|
76
|
<if test="tenderId != null and tenderId != ''"> and c.tender_id = #{tenderId}</if>
|
67
|
77
|
<if test="contractNumber != null and contractNumber != ''"> and c.contract_number = #{contractNumber}</if>
|
|
@@ -87,8 +97,10 @@
|
87
|
97
|
insert into cmc_contract
|
88
|
98
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
89
|
99
|
<if test="contractId != null">contract_id,</if>
|
|
100
|
+ <if test="contractName != null">contract_name,</if>
|
90
|
101
|
<if test="contractCode != null">contract_code,</if>
|
91
|
102
|
<if test="tenderId != null">tender_id,</if>
|
|
103
|
+ <if test="partyAId != null">party_a_id,</if>
|
92
|
104
|
<if test="contractNumber != null">contract_number,</if>
|
93
|
105
|
<if test="amount != null">amount,</if>
|
94
|
106
|
<if test="deposit != null">deposit,</if>
|
|
@@ -106,8 +118,10 @@
|
106
|
118
|
</trim>
|
107
|
119
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
108
|
120
|
<if test="contractId != null">#{contractId},</if>
|
|
121
|
+ <if test="contractName != null">#{contractName},</if>
|
109
|
122
|
<if test="contractCode != null">#{contractCode},</if>
|
110
|
123
|
<if test="tenderId != null">#{tenderId},</if>
|
|
124
|
+ <if test="partyAId != null">#{partyAId},</if>
|
111
|
125
|
<if test="contractNumber != null">#{contractNumber},</if>
|
112
|
126
|
<if test="amount != null">#{amount},</if>
|
113
|
127
|
<if test="deposit != null">#{deposit},</if>
|
|
@@ -129,7 +143,9 @@
|
129
|
143
|
update cmc_contract
|
130
|
144
|
<trim prefix="SET" suffixOverrides=",">
|
131
|
145
|
<if test="contractCode != null">contract_code = #{contractCode},</if>
|
|
146
|
+ <if test="contractName != null">contract_name = #{contractName},</if>
|
132
|
147
|
<if test="tenderId != null">tender_id = #{tenderId},</if>
|
|
148
|
+ <if test="partyAId != null">party_a_id = #{partyAId},</if>
|
133
|
149
|
<if test="contractNumber != null">contract_number = #{contractNumber},</if>
|
134
|
150
|
<if test="amount != null">amount = #{amount},</if>
|
135
|
151
|
<if test="deposit != null">deposit = #{deposit},</if>
|