Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
368450a2
Commit
368450a2
authored
Sep 15, 2022
by
wanglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取政务大类最近四季度
parent
8c65d1a1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
158 additions
and
8 deletions
+158
-8
IdxBizXnzsMapper.java
...oin/amos/boot/module/cas/api/mapper/IdxBizXnzsMapper.java
+3
-0
IIdxBizXnzsService.java
.../amos/boot/module/cas/api/service/IIdxBizXnzsService.java
+4
-1
IdxBizXnzsMapper.xml
...le-cas-api/src/main/resources/mapper/IdxBizXnzsMapper.xml
+65
-0
IdxBizXnzsController.java
...amos/boot/module/cas/controller/IdxBizXnzsController.java
+18
-2
IdxBizXnzsServiceImpl.java
...s/boot/module/cas/service/impl/IdxBizXnzsServiceImpl.java
+68
-5
No files found.
amos-boot-system-cas/amos-boot-module-cas-api/src/main/java/com/yeejoin/amos/boot/module/cas/api/mapper/IdxBizXnzsMapper.java
View file @
368450a2
...
@@ -18,4 +18,7 @@ public interface IdxBizXnzsMapper extends BaseMapper<IdxBizXnzs> {
...
@@ -18,4 +18,7 @@ public interface IdxBizXnzsMapper extends BaseMapper<IdxBizXnzs> {
List
<
IdxBizXnzsDto
>
select
();
List
<
IdxBizXnzsDto
>
select
();
List
<
IdxBizXnzsDto
>
selectZwdl
();
}
}
amos-boot-system-cas/amos-boot-module-cas-api/src/main/java/com/yeejoin/amos/boot/module/cas/api/service/IIdxBizXnzsService.java
View file @
368450a2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cas
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cas
.
api
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto
;
import
com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto
;
import
com.yeejoin.amos.boot.module.cas.api.dto.ResultDto
;
import
com.yeejoin.amos.boot.module.cas.api.dto.ResultDto
;
import
com.yeejoin.amos.boot.module.cas.api.entity.IdxBizXnzs
;
import
com.yeejoin.amos.boot.module.cas.api.entity.IdxBizXnzs
;
...
@@ -14,5 +15,7 @@ import java.util.List;
...
@@ -14,5 +15,7 @@ import java.util.List;
* @date 2022-09-14
* @date 2022-09-14
*/
*/
public
interface
IIdxBizXnzsService
extends
IService
<
IdxBizXnzs
>
{
public
interface
IIdxBizXnzsService
extends
IService
<
IdxBizXnzs
>
{
ResultDto
select
();
JSONObject
select
();
JSONObject
selectZwdl
();
}
}
amos-boot-system-cas/amos-boot-module-cas-api/src/main/resources/mapper/IdxBizXnzsMapper.xml
View file @
368450a2
...
@@ -64,4 +64,69 @@
...
@@ -64,4 +64,69 @@
</select>
</select>
<select
id=
"selectZwdl"
resultType=
"com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto"
>
SELECT
a.c_zwdl as `axisData`,
a.`one`,
b.`two`,
c.`three`,
d.`four`
FROM
(
SELECT
c_zwdl,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "one"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 0, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_zwdl
) AS a
LEFT JOIN (
SELECT
c_zwdl,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "two"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 1, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_zwdl
) AS b ON b.c_zwdl = a.c_zwdl
LEFT JOIN (
SELECT
c_zwdl,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "three"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 2, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_zwdl
) AS c ON c.c_zwdl = a.c_zwdl
LEFT JOIN (
SELECT
c_zwdl,
round( SUM(((( `b`.`c_xnzs` * `b`.`c_jdqz` ) * `b`.`c_dsqz` ) * `b`.`c_bbqz` )), 2 ) AS "four"
FROM
idx_biz_xnzs AS b,
( SELECT c_jd, c_nf, c_jddm FROM idx_biz_xnzs GROUP BY c_jd, c_nf ORDER BY c_nf DESC, c_jddm DESC LIMIT 3, 1 ) AS a
WHERE
a.c_nf = b.c_nf
AND a.c_jddm = b.c_jddm
GROUP BY
c_zwdl
) AS d ON d.c_zwdl = a.c_zwdl
</select>
</mapper>
</mapper>
amos-boot-system-cas/amos-boot-module-cas-biz/src/main/java/com/yeejoin/amos/boot/module/cas/controller/IdxBizXnzsController.java
View file @
368450a2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cas
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cas
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -143,10 +144,25 @@ public class IdxBizXnzsController extends BaseController {
...
@@ -143,10 +144,25 @@ public class IdxBizXnzsController extends BaseController {
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/select"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/select"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
根据id查询"
,
notes
=
"根据id查询
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"
查询地市"
,
notes
=
"查询地市
"
)
public
ResponseModel
<
ResultDto
>
select
(){
public
ResponseModel
<
JSONObject
>
select
(){
return
ResponseHelper
.
buildResponse
(
iIdxBizXnzsService
.
select
());
return
ResponseHelper
.
buildResponse
(
iIdxBizXnzsService
.
select
());
}
}
/**
* 查询政务大列
* @author 王龙
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/selectZwdl"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询政务大类"
,
notes
=
"查询政务大类"
)
public
ResponseModel
<
JSONObject
>
selectZwdl
()
{
return
ResponseHelper
.
buildResponse
(
iIdxBizXnzsService
.
selectZwdl
());
}
}
}
amos-boot-system-cas/amos-boot-module-cas-biz/src/main/java/com/yeejoin/amos/boot/module/cas/service/impl/IdxBizXnzsServiceImpl.java
View file @
368450a2
...
@@ -2,11 +2,14 @@ package com.yeejoin.amos.boot.module.cas.service.impl;
...
@@ -2,11 +2,14 @@ package com.yeejoin.amos.boot.module.cas.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto
;
import
com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto
;
import
com.yeejoin.amos.boot.module.cas.api.dto.ResultDto
;
import
com.yeejoin.amos.boot.module.cas.api.dto.ResultDto
;
import
com.yeejoin.amos.boot.module.cas.api.entity.IdxBizXnzs
;
import
com.yeejoin.amos.boot.module.cas.api.entity.IdxBizXnzs
;
import
com.yeejoin.amos.boot.module.cas.api.mapper.IdxBizXnzsMapper
;
import
com.yeejoin.amos.boot.module.cas.api.mapper.IdxBizXnzsMapper
;
import
com.yeejoin.amos.boot.module.cas.api.service.IIdxBizXnzsService
;
import
com.yeejoin.amos.boot.module.cas.api.service.IIdxBizXnzsService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
@@ -25,8 +28,14 @@ public class IdxBizXnzsServiceImpl extends BaseService<IdxBizXnzsDto, IdxBizXnzs
...
@@ -25,8 +28,14 @@ public class IdxBizXnzsServiceImpl extends BaseService<IdxBizXnzsDto, IdxBizXnzs
@Autowired
@Autowired
private
IdxBizXnzsMapper
idxBizXnzsMapper
;
private
IdxBizXnzsMapper
idxBizXnzsMapper
;
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
IdxBizXnzsServiceImpl
.
class
);
@Override
@Override
public
ResultDto
select
()
{
public
JSONObject
select
()
{
/**
* 预返回数据
*/
JSONObject
message
=
new
JSONObject
();
List
<
IdxBizXnzsDto
>
xnzsDtoList
=
idxBizXnzsMapper
.
select
();
List
<
IdxBizXnzsDto
>
xnzsDtoList
=
idxBizXnzsMapper
.
select
();
List
<
String
>
axisData
=
new
ArrayList
<>();
List
<
String
>
axisData
=
new
ArrayList
<>();
...
@@ -57,11 +66,65 @@ public class IdxBizXnzsServiceImpl extends BaseService<IdxBizXnzsDto, IdxBizXnzs
...
@@ -57,11 +66,65 @@ public class IdxBizXnzsServiceImpl extends BaseService<IdxBizXnzsDto, IdxBizXnzs
System
.
out
.
println
(
seriesDataList
);
System
.
out
.
println
(
seriesDataList
);
ResultDto
resultDto
=
new
ResultDto
();
// ResultDto resultDto = new ResultDto();
resultDto
.
setAxisData
(
axisData
);
// resultDto.setAxisData(axisData);
resultDto
.
setSeriesData
(
seriesDataList
);
// resultDto.setSeriesData(seriesDataList);
message
.
put
(
"axisData"
,
axisData
);
message
.
put
(
"seriesData"
,
seriesDataList
);
return
message
;
}
/**
* 查询政务大列
* @return
*/
@Override
public
JSONObject
selectZwdl
()
{
/**
* 预返回数据
*/
JSONObject
message
=
new
JSONObject
();
List
<
String
>
axisData
=
new
ArrayList
<>();
List
<
List
<
Double
>>
seriesDataList
=
new
ArrayList
<>();
/**
* 获取政务大列数据
*/
List
<
IdxBizXnzsDto
>
zwdlDto
=
idxBizXnzsMapper
.
selectZwdl
();
log
.
info
(
zwdlDto
.
toString
());
/**
* 组装返回数据
*/
for
(
IdxBizXnzsDto
idxBizXnzsDto
:
zwdlDto
)
{
//预返回箱线图数据
List
<
Double
>
list
=
new
ArrayList
<>();
//添加政务大类
axisData
.
add
(
idxBizXnzsDto
.
getAxisData
());
//添加最近四季度
Double
[]
ottf
=
{
idxBizXnzsDto
.
getOne
(),
idxBizXnzsDto
.
getTwo
(),
idxBizXnzsDto
.
getThree
(),
idxBizXnzsDto
.
getFour
()};
log
.
info
(
String
.
valueOf
(
idxBizXnzsDto
.
getOne
()));
//排序(从小到大)
Arrays
.
sort
(
ottf
);
/**
* 添加箱线图数据
*/
list
.
add
(
ottf
[
0
]);
list
.
add
((
ottf
[
0
]+
ottf
[
1
])/
2
);
list
.
add
((
ottf
[
1
]+
ottf
[
2
])/
2
);
list
.
add
((
ottf
[
2
]+
ottf
[
3
])/
2
);
list
.
add
(
ottf
[
3
]);
seriesDataList
.
add
(
list
);
}
message
.
put
(
"seriesData"
,
seriesDataList
);
message
.
put
(
"axisData"
,
axisData
);
return
resultDto
;
return
message
;
}
}
}
}
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