Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
foc_manage
Overview
Overview
Details
Activity
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
首航-临时账号
foc_manage
Commits
18c2ff27
Commit
18c2ff27
authored
Sep 20, 2017
by
Java-金吉宝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重复记录
parent
1d43b2c7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
10 deletions
+98
-10
SoundRecordingDao.xml
resources/mappings/modules/contact/SoundRecordingDao.xml
+80
-10
SoundRecordingDao.java
src/com/ejweb/modules/contact/dao/SoundRecordingDao.java
+4
-0
SoundRecordingService.java
src/com/ejweb/modules/contact/service/SoundRecordingService.java
+5
-0
SoundRecordingController.java
src/com/ejweb/modules/contact/web/SoundRecordingController.java
+9
-0
No files found.
resources/mappings/modules/contact/SoundRecordingDao.xml
View file @
18c2ff27
...
...
@@ -2,13 +2,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ejweb.modules.contact.dao.SoundRecordingDao"
>
<select
id=
"findList"
resultType=
"com.ejweb.modules.contact.entity.SoundRecordingEntity"
>
<!-- <select id="findList" resultType="com.ejweb.modules.contact.entity.SoundRecordingEntity">
select *
from (
SELECT CONCAT(ac.create_name,ap.username,(UNIX_TIMESTAMP(ac.end_time)-ac.duration)) as b,
create_phone AS callNo,ac.create_name AS callName,ap.phone AS acceptNo,ap.username AS acceptName,
ac.start_time AS beginTime, ac.end_time AS endTime, ac.download_url ,ac.duration,end_status AS result
FROM foc_sound_records ac
LEFT JOIN foc_sound_phones ap ON ac.id=ap.record_id
<where>
where
ac.end_status !='INIT'
<if test="seatList.size() > 0">
and (ac.create_by in
...
...
@@ -40,21 +42,88 @@
<if test="dbName == 'mssql'">'%'+#{acceptNo}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{acceptNo}, '%')</if>
</if>
<if
test=
"acceptName != null and acceptName != ''"
>
<if test='acceptName != null and acceptName != ""'>
AND ap.username LIKE
<if test="dbName == 'oracle'">'%'||#{acceptName}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{acceptName}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{acceptName}, '%')</if>
</if>
<if
test=
"beginTime != null and beginTime != ''"
>
AND (ac.start_time BETWEEN #{beginTime} AND #{endTime})
<!-- AND ac.start_time <![CDATA[>]]> #{beginTime} -->
<if test='beginTime != null and beginTime != ""'>
AND ac.start_time <![CDATA[<=]]>#{endTime} and ac.start_time <![CDATA[>=]]> #{beginTime}
AND ac.start_time <![CDATA[>]]> #{beginTime}
</if>
<if
test=
"endTime != null and endTime != ''"
>
<if test='endTime != null and endTime != ""'>
AND ( ac.end_time <![CDATA[<]]> #{endTime} OR ac.end_time is NULL)
</if>
</where>
group by b
ORDER BY ac.start_time desc
GROUP BY b
) er
ORDER BY beginTime DESC
</select> -->
<select
id=
"findList"
resultType=
"com.ejweb.modules.contact.entity.SoundRecordingEntity"
>
SELECT
create_phone AS callNo,ac.create_name AS callName,ap.phone AS acceptNo,ap.username AS acceptName,
ac.start_time AS beginTime, ac.end_time AS endTime, ac.download_url ,ac.duration,end_status AS result
FROM foc_sound_records ac
LEFT JOIN foc_sound_phones ap ON ac.id=ap.record_id
where
ac.end_status !='INIT'
<if
test=
"seatList.size() > 0"
>
and (ac.create_by in
<foreach
item=
"item"
collection=
"seatList"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item.id}
</foreach>
or
ap.user_id in
<foreach
item=
"item"
collection=
"seatList"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item.id}
</foreach>
)
</if>
<if
test=
"callNo != null and callNo != ''"
>
AND ac.create_phone LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{callNo}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{callNo}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{callNo}, '%')
</if>
</if>
<if
test=
"callName != null and callName != ''"
>
AND ac.create_name LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{callName}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{callName}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{callName}, '%')
</if>
</if>
<if
test=
"acceptNo != null and acceptNo != ''"
>
AND ap.phone LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{acceptNo}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{acceptNo}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{acceptNo}, '%')
</if>
</if>
<if
test=
'acceptName != null and acceptName != ""'
>
AND ap.username LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{acceptName}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{acceptName}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{acceptName}, '%')
</if>
</if>
<if
test=
'beginTime != null and beginTime != ""'
>
AND ac.start_time
<![CDATA[<=]]>
#{endTime} and ac.start_time
<![CDATA[>=]]>
#{beginTime}
AND ac.start_time
<![CDATA[>]]>
#{beginTime}
</if>
<if
test=
'endTime != null and endTime != ""'
>
AND ( ac.end_time
<![CDATA[<]]>
#{endTime} OR ac.end_time is NULL)
</if>
ORDER BY beginTime DESC
</select>
<select
id=
"findRecordingList"
resultType=
"com.ejweb.modules.contact.entity.SoundRecordingEntity"
>
SELECT
create_phone AS callNo,ac.create_name AS callName,ap.phone AS acceptNo,ap.username AS acceptName,
ac.start_time AS beginTime, ac.end_time AS endTime, ac.download_url ,ac.duration,end_status AS result
FROM foc_sound_records ac
LEFT JOIN foc_sound_phones ap ON ac.id=ap.record_id
where
ac.end_status !='INIT'
and ac.create_name=#{callName}
and ap.username=#{acceptName}
and ac.start_time=#{endTime}
</select>
</mapper>
\ No newline at end of file
src/com/ejweb/modules/contact/dao/SoundRecordingDao.java
View file @
18c2ff27
package
com
.
ejweb
.
modules
.
contact
.
dao
;
import
java.util.List
;
import
com.ejweb.core.persistence.CrudDao
;
import
com.ejweb.core.persistence.annotation.MyBatisDao
;
import
com.ejweb.modules.contact.entity.SoundRecordingEntity
;
...
...
@@ -7,4 +9,6 @@ import com.ejweb.modules.contact.entity.SoundRecordingEntity;
@MyBatisDao
public
interface
SoundRecordingDao
extends
CrudDao
<
SoundRecordingEntity
>
{
List
<
SoundRecordingEntity
>
findRecordingList
(
SoundRecordingEntity
entityTmp
);
}
src/com/ejweb/modules/contact/service/SoundRecordingService.java
View file @
18c2ff27
...
...
@@ -69,4 +69,9 @@ public class SoundRecordingService extends CrudService<SoundRecordingDao, SoundR
System
.
out
.
print
(
res
);
return
page
;
}
public
List
<
SoundRecordingEntity
>
findRecordingList
(
SoundRecordingEntity
entityTmp
)
{
// TODO Auto-generated method stub
return
dao
.
findRecordingList
(
entityTmp
);
}
}
src/com/ejweb/modules/contact/web/SoundRecordingController.java
View file @
18c2ff27
...
...
@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.*
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -82,10 +83,18 @@ public class SoundRecordingController extends BaseController {
if
(
StringUtils
.
isNoneBlank
(
proxy
)){
proxy
=
"https://ifos.jdair.net/sounds/"
;
}
List
<
SoundRecordingEntity
>
templist
=
new
ArrayList
<
SoundRecordingEntity
>();
for
(
SoundRecordingEntity
entityTmp
:
page
.
getList
())
{
if
(
StringUtils
.
isNotBlank
(
entityTmp
.
getDownloadUrl
()))
{
entityTmp
.
setDownloadUrl
(
entityTmp
.
getDownloadUrl
().
replaceAll
(
".{4,5}://.*?(/|\\\\)"
,
proxy
).
replaceAll
(
"\\\\"
,
"/"
));
}
List
<
SoundRecordingEntity
>
entity
=
soundRecordingService
.
findRecordingList
(
entityTmp
);
if
(
entity
.
size
()>
0
){
templist
.
add
(
entityTmp
);
}
}
if
(
templist
.
size
()>
0
){
page
.
getList
().
removeAll
(
templist
);
}
}
model
.
addAttribute
(
"page"
,
page
);
...
...
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