Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
api
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
首航-临时账号
api
Commits
c774bcc4
Commit
c774bcc4
authored
Nov 19, 2020
by
java-温文海
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出,及查询逻辑修改
parent
da56fc60
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
163 additions
and
52 deletions
+163
-52
StatisticalDao.xml
resources/mapper/modules/airport/StatisticalDao.xml
+26
-49
StatisticalController.java
src/com/ejweb/modules/airport/api/StatisticalController.java
+40
-3
TypeBean.java
src/com/ejweb/modules/airport/bean/TypeBean.java
+37
-0
StatisticalListEntity.java
src/com/ejweb/modules/airport/entity/StatisticalListEntity.java
+60
-0
No files found.
resources/mapper/modules/airport/StatisticalDao.xml
View file @
c774bcc4
...
@@ -193,56 +193,32 @@
...
@@ -193,56 +193,32 @@
foc_airline_sta favt
foc_airline_sta favt
WHERE
WHERE
favt.del_flag = #{DEL_FLAG_NORMAL}
favt.del_flag = #{DEL_FLAG_NORMAL}
<choose>
<!--当出发地不为空,目的地不为空 -->
<when
test=
"(depIata != null and depIata != '') and (arrIata != null and arrIata != '')"
>
AND ( favt.dep_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{depIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{depIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{depIata}, '%')
</if>
or favt.arr_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{depIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{depIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{depIata}, '%')
</if>
)
or ( favt.dep_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{arrIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{arrIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{arrIata}, '%')
</if>
or favt.arr_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{arrIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{arrIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{arrIata}, '%')
</if>
)
</when>
<!--当出发地不为空,目的地为空 -->
<when
test=
"(depIata != null and depIata != '') and (arrIata == null and arrIata == '')"
>
AND ( favt.dep_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{depIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{depIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{depIata}, '%')
</if>
or favt.arr_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{depIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{depIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{depIata}, '%')
</if>
)
</when>
<!--当出发地为空,目的地不为空 -->
<when
test=
"(depIata == null and depIata == '') and (arrIata != null and arrIata != '')"
>
and ( favt.dep_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{arrIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{arrIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{arrIata}, '%')
</if>
or favt.arr_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{arrIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{arrIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{arrIata}, '%')
</if>
)
</when>
<otherwise>
</otherwise>
<!--当出发地不为空,目的地为空 -->
</choose>
<if
test=
"(depIata != null and depIata != '') "
>
AND ( favt.dep_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{depIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{depIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{depIata}, '%')
</if>
or favt.arr_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{depIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{depIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{depIata}, '%')
</if>
)
</if>
<!--当出发地为空,目的地不为空 -->
<if
test=
" (arrIata != null and arrIata != '')"
>
and ( favt.dep_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{arrIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{arrIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{arrIata}, '%')
</if>
or favt.arr_iata LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{arrIata}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{arrIata}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{arrIata}, '%')
</if>
)
</if>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
src/com/ejweb/modules/airport/api/StatisticalController.java
View file @
c774bcc4
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
*/
*/
package
com
.
ejweb
.
modules
.
airport
.
api
;
package
com
.
ejweb
.
modules
.
airport
.
api
;
import
com.alibaba.fastjson.JSON
;
import
com.ejweb.core.api.RequestBean
;
import
com.ejweb.core.api.RequestBean
;
import
com.ejweb.core.api.ResponseBean
;
import
com.ejweb.core.api.ResponseBean
;
import
com.ejweb.core.base.PageEntity
;
import
com.ejweb.core.base.PageEntity
;
...
@@ -11,6 +12,7 @@ import com.ejweb.core.conf.GConstants;
...
@@ -11,6 +12,7 @@ import com.ejweb.core.conf.GConstants;
import
com.ejweb.core.utils.excel.ExportExcel
;
import
com.ejweb.core.utils.excel.ExportExcel
;
import
com.ejweb.modules.airport.bean.StatisticalBean
;
import
com.ejweb.modules.airport.bean.StatisticalBean
;
import
com.ejweb.modules.airport.bean.StatisticalListBean
;
import
com.ejweb.modules.airport.bean.StatisticalListBean
;
import
com.ejweb.modules.airport.bean.TypeBean
;
import
com.ejweb.modules.airport.entity.StatisticalEntity
;
import
com.ejweb.modules.airport.entity.StatisticalEntity
;
import
com.ejweb.modules.airport.entity.StatisticalListEntity
;
import
com.ejweb.modules.airport.entity.StatisticalListEntity
;
import
com.ejweb.modules.airport.service.StatisticalService
;
import
com.ejweb.modules.airport.service.StatisticalService
;
...
@@ -136,10 +138,25 @@ public class StatisticalController {
...
@@ -136,10 +138,25 @@ public class StatisticalController {
List
<
StatisticalListEntity
>
list
=
new
ArrayList
<
StatisticalListEntity
>();
List
<
StatisticalListEntity
>
list
=
new
ArrayList
<
StatisticalListEntity
>();
if
(
page
!=
null
)
{
// 查询结果为空
if
(
page
!=
null
)
{
// 查询结果为空
list
=
page
.
getList
();
list
=
page
.
getList
();
for
(
StatisticalListEntity
s:
list
String
fileName
=
"航线论证数据统计.xlsx"
;
)
{
//航线状态自定义
if
(
s
.
getAirlineStatus
()
==
0
){
s
.
setStatus
(
"失效"
);
}
if
(
s
.
getAirlineStatus
()
==
1
){
s
.
setStatus
(
"有效"
);
}
//机型状态自定义
List
<
TypeBean
>
typeBeans
=
JSON
.
parseArray
(
s
.
getAirlineJson
(),
TypeBean
.
class
);
s
.
setTypeOne
(
typeInfo
(
typeBeans
.
get
(
typeBeans
.
size
()-
typeBeans
.
size
()),
s
.
getAirlineStatus
()));
s
.
setTypeTwo
(
typeInfo
(
typeBeans
.
get
(
typeBeans
.
size
()-
3
),
s
.
getAirlineStatus
()));
s
.
setTypeThree
(
typeInfo
(
typeBeans
.
get
(
typeBeans
.
size
()-
2
),
s
.
getAirlineStatus
()));
s
.
setTypeFour
(
typeInfo
(
typeBeans
.
get
(
typeBeans
.
size
()-
1
),
s
.
getAirlineStatus
()));
}
String
fileName
=
"航线执行期监控统计.xlsx"
;
try
{
try
{
new
ExportExcel
(
"航线
论证数据统计"
,
Statistical
Entity
.
class
).
setDataList
(
list
).
write
(
response
,
fileName
).
dispose
();
new
ExportExcel
(
"航线
执行期监控统计"
,
StatisticalList
Entity
.
class
).
setDataList
(
list
).
write
(
response
,
fileName
).
dispose
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
responseBean
.
setMessage
(
"导出数据失败"
+
e
.
getMessage
());
responseBean
.
setMessage
(
"导出数据失败"
+
e
.
getMessage
());
return
responseBean
;
return
responseBean
;
...
@@ -154,4 +171,24 @@ public class StatisticalController {
...
@@ -154,4 +171,24 @@ public class StatisticalController {
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4001
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4001
);
return
responseBean
;
return
responseBean
;
}
}
private
String
typeInfo
(
TypeBean
s
,
Integer
status
){
if
(
status
==
0
){
if
(
s
.
getStatus
()
==
3
){
return
"不可用"
;
}
return
"论证失效"
;
}
else
{
if
(
s
.
getStatus
()
==
1
){
return
s
.
getLastTime
();
}
if
(
s
.
getStatus
()
==
2
){
return
"可用"
;
}
if
(
s
.
getStatus
()
==
3
){
return
"不可用"
;
}
}
return
null
;
}
}
}
src/com/ejweb/modules/airport/bean/TypeBean.java
0 → 100644
View file @
c774bcc4
package
com
.
ejweb
.
modules
.
airport
.
bean
;
import
com.ejweb.core.base.BaseEntity
;
public
class
TypeBean
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
-
4211749532324022040L
;
private
String
type
;
private
Integer
status
;
private
String
lastTime
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
String
getLastTime
()
{
return
lastTime
;
}
public
void
setLastTime
(
String
lastTime
)
{
this
.
lastTime
=
lastTime
;
}
}
src/com/ejweb/modules/airport/entity/StatisticalListEntity.java
View file @
c774bcc4
package
com
.
ejweb
.
modules
.
airport
.
entity
;
package
com
.
ejweb
.
modules
.
airport
.
entity
;
import
com.ejweb.core.base.BaseEntity
;
import
com.ejweb.core.base.BaseEntity
;
import
com.ejweb.core.utils.excel.annotation.ExcelField
;
import
java.util.List
;
import
java.util.List
;
...
@@ -16,6 +17,16 @@ public class StatisticalListEntity extends BaseEntity {
...
@@ -16,6 +17,16 @@ public class StatisticalListEntity extends BaseEntity {
private
int
airlineStatus
;
private
int
airlineStatus
;
private
String
airlineJson
;
private
String
airlineJson
;
private
String
status
;
private
String
typeOne
;
private
String
typeTwo
;
private
String
typeThree
;
private
String
typeFour
;
public
String
getArrIata
()
{
public
String
getArrIata
()
{
return
arrIata
;
return
arrIata
;
}
}
...
@@ -24,6 +35,7 @@ public class StatisticalListEntity extends BaseEntity {
...
@@ -24,6 +35,7 @@ public class StatisticalListEntity extends BaseEntity {
this
.
arrIata
=
arrIata
;
this
.
arrIata
=
arrIata
;
}
}
@ExcelField
(
title
=
"起飞"
,
type
=
0
,
align
=
1
,
sort
=
19
)
public
String
getArrIataName
()
{
public
String
getArrIataName
()
{
return
arrIataName
;
return
arrIataName
;
}
}
...
@@ -40,6 +52,7 @@ public class StatisticalListEntity extends BaseEntity {
...
@@ -40,6 +52,7 @@ public class StatisticalListEntity extends BaseEntity {
this
.
depIata
=
depIata
;
this
.
depIata
=
depIata
;
}
}
@ExcelField
(
title
=
"终点"
,
type
=
0
,
align
=
1
,
sort
=
20
)
public
String
getDepIataName
()
{
public
String
getDepIataName
()
{
return
depIataName
;
return
depIataName
;
}
}
...
@@ -48,6 +61,7 @@ public class StatisticalListEntity extends BaseEntity {
...
@@ -48,6 +61,7 @@ public class StatisticalListEntity extends BaseEntity {
this
.
depIataName
=
depIataName
;
this
.
depIataName
=
depIataName
;
}
}
@ExcelField
(
title
=
"最后一班航班时间"
,
type
=
0
,
align
=
1
,
sort
=
25
)
public
String
getLastAirlineTime
()
{
public
String
getLastAirlineTime
()
{
return
lastAirlineTime
;
return
lastAirlineTime
;
}
}
...
@@ -72,6 +86,7 @@ public class StatisticalListEntity extends BaseEntity {
...
@@ -72,6 +86,7 @@ public class StatisticalListEntity extends BaseEntity {
this
.
airlineJson
=
airlineJson
;
this
.
airlineJson
=
airlineJson
;
}
}
public
String
getUpdateTime
()
{
public
String
getUpdateTime
()
{
return
updateTime
;
return
updateTime
;
}
}
...
@@ -79,4 +94,49 @@ public class StatisticalListEntity extends BaseEntity {
...
@@ -79,4 +94,49 @@ public class StatisticalListEntity extends BaseEntity {
public
void
setUpdateTime
(
String
updateTime
)
{
public
void
setUpdateTime
(
String
updateTime
)
{
this
.
updateTime
=
updateTime
;
this
.
updateTime
=
updateTime
;
}
}
@ExcelField
(
title
=
"A319/A320"
,
type
=
0
,
align
=
1
,
sort
=
21
)
public
String
getTypeOne
()
{
return
typeOne
;
}
public
void
setTypeOne
(
String
typeOne
)
{
this
.
typeOne
=
typeOne
;
}
@ExcelField
(
title
=
"A321"
,
type
=
0
,
align
=
1
,
sort
=
22
)
public
String
getTypeTwo
()
{
return
typeTwo
;
}
public
void
setTypeTwo
(
String
typeTwo
)
{
this
.
typeTwo
=
typeTwo
;
}
@ExcelField
(
title
=
"A320neo"
,
type
=
0
,
align
=
1
,
sort
=
23
)
public
String
getTypeThree
()
{
return
typeThree
;
}
public
void
setTypeThree
(
String
typeThree
)
{
this
.
typeThree
=
typeThree
;
}
@ExcelField
(
title
=
"A330"
,
type
=
0
,
align
=
1
,
sort
=
24
)
public
String
getTypeFour
()
{
return
typeFour
;
}
public
void
setTypeFour
(
String
typeFour
)
{
this
.
typeFour
=
typeFour
;
}
@ExcelField
(
title
=
"航线状态"
,
type
=
0
,
align
=
1
,
sort
=
26
)
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
}
}
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