Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
service-campaign
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyen Ha
service-campaign
Commits
b2e6cdb5
Commit
b2e6cdb5
authored
Aug 17, 2019
by
=
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hungtt-commit reallocation customer
parent
9ed37467
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
229 deletions
+104
-229
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
...pository/ccms_full/impl/CampaignExecuteRepositoryImp.java
+39
-205
src/main/resources/sql/campaign-execute/get-execute-interactive.sql
...esources/sql/campaign-execute/get-execute-interactive.sql
+65
-24
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
View file @
b2e6cdb5
This diff is collapsed.
Click to expand it.
src/main/resources/sql/campaign-execute/get-execute-interactive.sql
View file @
b2e6cdb5
select
b
.
campaign_code
campaignCode
,
b
.
campaign_name
campaignName
,
c
.
user_name
userName
,
a
.
phone_number
phoneNumber
,
d
.
name
customerName
,
to_date
(
a
.
start_call
,
'DD/MM/YYYY'
)
startCall
,
e
.
complete_name
contactStatus
,
f
.
complete_name
surveyStatus
,
g
.
status
status
,
a
.
status
recordStatus
,
(
a
.
end_time
-
a
.
start_call
)
*
24
*
60
callTime
from
contact_cust_result
a
left
join
campaign
b
on
a
.
campaign_id
=
b
.
campaign_id
left
join
vsa_users
c
on
a
.
agent_id
=
c
.
user_id
left
join
customer
d
on
a
.
customer_id
=
d
.
customer_id
left
join
campaign_complete_code
e
on
a
.
contact_status
=
e
.
complete_value
left
join
campaign_complete_code
f
on
a
.
call_status
=
e
.
complete_value
left
join
campaign
g
on
a
.
campaign_id
=
g
.
campaign_id
where
a
.
status
<>
0
and
a
.
company_site_id
=
:
p_company_site_id
and
a
.
create_time
>=
to_date
(:
p_date_from
,
'DD/MM/YYYY'
)
and
a
.
create_time
<=
to_date
(:
p_date_to
,
'DD/MM/YYYY'
)
and
a
.
duration_call
>=
:
p_call_time_from
and
a
.
duration_call
<=
:
p_call_time_to
with
campaign_type_list
as
(
select
trim
(
regexp_substr
(:
p_list_compaign_type
,
'[^,]+'
,
1
,
level
))
campaign_type
from
dual
connect
by
level
<=
regexp_count
(:
p_list_compaign_type
,
','
)
+
1
),
contact_status_list
as
(
select
trim
(
regexp_substr
(:
p_list_contact_status
,
'[^,]+'
,
1
,
level
))
contact_status
from
dual
connect
by
level
<=
regexp_count
(:
p_list_contact_status
,
','
)
+
1
),
survey_status_list
as
(
select
trim
(
regexp_substr
(:
p_list_survey_status
,
'[^,]+'
,
1
,
level
))
survey_status
from
dual
connect
by
level
<=
regexp_count
(:
p_list_survey_status
,
','
)
+
1
),
record_status_list
as
(
select
trim
(
regexp_substr
(:
p_list_record_status
,
'[^,]+'
,
1
,
level
))
record_status
from
dual
connect
by
level
<=
regexp_count
(:
p_list_record_status
,
','
)
+
1
),
campaign_id_list
as
(
select
trim
(
regexp_substr
(:
p_list_campaign_id
,
'[^,]+'
,
1
,
level
))
campaign_id
from
dual
connect
by
level
<=
regexp_count
(:
p_list_campaign_id
,
','
)
+
1
),
data_temp
as
(
select
b
.
campaign_code
campaignCode
,
b
.
campaign_name
campaignName
,
c
.
user_name
userName
,
a
.
phone_number
phoneNumber
,
d
.
name
customerName
,
to_date
(
a
.
start_call
,
'DD/MM/YYYY'
)
startCall
,
e
.
complete_name
contactStatus
,
f
.
complete_name
surveyStatus
,
g
.
status
status
,
a
.
status
recordStatus
,
(
a
.
end_time
-
a
.
start_call
)
*
24
*
60
callTime
from
contact_cust_result
a
left
join
campaign
b
on
a
.
campaign_id
=
b
.
campaign_id
left
join
vsa_users
c
on
a
.
agent_id
=
c
.
user_id
left
join
customer
d
on
a
.
customer_id
=
d
.
customer_id
left
join
campaign_complete_code
e
on
a
.
contact_status
=
e
.
complete_value
left
join
campaign_complete_code
f
on
a
.
call_status
=
e
.
complete_value
left
join
campaign
g
on
a
.
campaign_id
=
g
.
campaign_id
where
a
.
status
<>
0
and
a
.
company_site_id
=
:
p_company_site_id
and
a
.
create_time
>=
to_date
(:
p_date_from
,
'DD/MM/YYYY'
)
and
a
.
create_time
<=
to_date
(:
p_date_to
,
'DD/MM/YYYY'
)
and
a
.
duration_call
>=
:
p_call_time_from
and
a
.
duration_call
<=
:
p_call_time_to
and
to_char
(
a
.
customer_id
)
like
'%'
||
:
p_customer_id
||
'%'
and
b
.
campaign_type
in
(
select
campaign_type
from
campaign_type_list
)
and
to_char
(
a
.
contact_status
)
in
(
select
contact_status
from
contact_status_list
)
and
to_char
(
a
.
call_status
)
in
(
select
survey_status
from
survey_status_list
)
and
to_char
(
a
.
status
)
in
(
select
record_status
from
record_status_list
)
and
(:
p_phone_number
is
null
or
to_char
(
a
.
phone_number
)
like
'%'
||
:
p_phone_number
||
'%'
)
and
(:
p_list_campaign_id
is
null
or
b
.
campaign_code
in
(
select
campaign_id
from
campaign_id_list
))
and
(:
p_campaign_name
is
null
or
upper
(
b
.
campaign_name
)
like
'%'
||
:
p_campaign_name
||
'%'
)
and
(:
p_user_name
is
null
or
upper
(
c
.
user_name
)
like
'%'
||
:
p_user_name
||
'%'
)
),
data
as
(
select
a
.
*
,
rownum
row_
from
data_temp
a
)
select
*
from
data
where
:
p_page_size
=
0
or
(
row_
>=
((:
p_page_number
-
1
)
*
:
p_page_size
+
1
)
and
row_
<
(:
p_page_number
*
:
p_page_size
+
1
))
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