Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls_rent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
congweijing
hls_rent
Commits
edfc3f32
Commit
edfc3f32
authored
Aug 24, 2018
by
congweijing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加JOB事件判断合同到期和房屋到期
parent
a2cb82d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
HLS_Contract_info_pkg.pck
package/HLS_Contract_info_pkg.pck
+30
-11
房屋合同到期JOB.png
房屋合同到期JOB.png
+0
-0
No files found.
package/HLS_Contract_info_pkg.pck
View file @
edfc3f32
...
...
@@ -29,12 +29,13 @@ create or replace package HLS_Contract_info_pkg is
p_remark varchar2,
p_contract_remark varchar2) ;
procedure modifi_contract_condition(p_h_contract_number varchar2);
procedure contract_room_status_update;
end HLS_Contract_info_pkg;
/
create or replace package body HLS_Contract_info_pkg is
--
Function and procedure implementations
--
新增一条合同信息
procedure insert_contract_info(p_contract_start_date date,
p_contract_finish_date date,
p_room_id number,
...
...
@@ -92,6 +93,7 @@ create or replace package body HLS_Contract_info_pkg is
sysdate);
end;
--更新合同信息
procedure update_contract_info(p_h_contract_number varchar2,
p_contract_start_date date,
p_contract_finish_date date,
...
...
@@ -110,10 +112,7 @@ create or replace package body HLS_Contract_info_pkg is
into v_old_room_id
from hls_contract_info
where h_contract_number = p_h_contract_number;
--更新原来合同中的房屋状态为“空闲”
update hls_room_info
set room_status = 'status1'
where room_id = v_old_room_id;
--更新合同信息
update HLS_Contract_info
set contract_start_date = p_contract_start_date,
...
...
@@ -131,21 +130,41 @@ create or replace package body HLS_Contract_info_pkg is
last_updated_by = -1,
last_update_date = sysdate
where h_contract_number = p_h_contract_number;
--更新新合同中房屋状态为“已租住”
update hls_room_info
set room_status = 'status2'
where room_id = p_room_id;
end;
--合同信息确认(将将合同状态变成合同确认、合同中的房屋ID对应的状态变成已租住)
procedure modifi_contract_condition(p_h_contract_number varchar2) is
begin
update HLS_Contract_info
set contract_condition = 'type2'
where h_contract_number = p_h_contract_number;
--更新房屋状态
update hls_room_info
set room_status = 'status2'
where room_id IN (select room_id from hls_contract_info where h_contract_number = p_h_contract_number);
end;
--合同到期 和 房屋到期
procedure contract_room_status_update is
cursor room_id_cursor is
select hr.room_id
from hls_room_info hr,hls_contract_info hc
where hr.room_id = hc.room_id
and months_between(sysdate,hc.contract_finish_date) >0
and hc.contract_condition='type2';
begin
for room_item in room_id_cursor loop
if room_item.room_id is not null then
update hls_contract_info hc
set hc.contract_condition = 'type3'
where hc.room_id = room_item.room_id;
update hls_room_info hr
set hr.room_status = 'status3'
where hr.room_id = room_item.room_id;
end if;
end loop;
end;
end HLS_Contract_info_pkg;
/
房屋合同到期JOB.png
0 → 100644
View file @
edfc3f32
13.2 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment