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
2078683c
Commit
2078683c
authored
Jun 25, 2022
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据换流站统计消防车辆API
parent
8ced8dc8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
0 deletions
+61
-0
FireVehicleMapper.java
...in/amos/boot/module/ccs/api/mapper/FireVehicleMapper.java
+5
-0
CarInfoVO.java
...va/com/yeejoin/amos/boot/module/ccs/api/vo/CarInfoVO.java
+17
-0
FireVehicleMapper.xml
...e-ccs-api/src/main/resources/mapper/FireVehicleMapper.xml
+13
-0
FireStationInfoController.java
.../module/ccs/biz/controller/FireStationInfoController.java
+8
-0
FireStationInfoServiceImpl.java
...dule/ccs/biz/service/impl/FireStationInfoServiceImpl.java
+18
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/mapper/FireVehicleMapper.java
View file @
2078683c
...
@@ -2,6 +2,10 @@ package com.yeejoin.amos.boot.module.ccs.api.mapper;
...
@@ -2,6 +2,10 @@ package com.yeejoin.amos.boot.module.ccs.api.mapper;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireVehicle
;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireVehicle
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.CarInfoVO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
* 消防车辆信息 Mapper 接口
* 消防车辆信息 Mapper 接口
...
@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
FireVehicleMapper
extends
BaseMapper
<
FireVehicle
>
{
public
interface
FireVehicleMapper
extends
BaseMapper
<
FireVehicle
>
{
List
<
CarInfoVO
>
getCarInfoByStationCode
(
@Param
(
"stationCode"
)
String
stationCode
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/java/com/yeejoin/amos/boot/module/ccs/api/vo/CarInfoVO.java
0 → 100644
View file @
2078683c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ccs
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
CarInfoVO
implements
Serializable
{
private
Integer
total
;
private
String
carType
;
private
String
strCarNumber
;
private
List
<
String
>
carList
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-ccs-api/src/main/resources/mapper/FireVehicleMapper.xml
View file @
2078683c
...
@@ -2,4 +2,17 @@
...
@@ -2,4 +2,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ccs.api.mapper.FireVehicleMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.ccs.api.mapper.FireVehicleMapper"
>
<select
id=
"getCarInfoByStationCode"
resultType=
"com.yeejoin.amos.boot.module.ccs.api.vo.CarInfoVO"
>
SELECT
count(*) as total,
`type` as carType,
group_concat( `number` ) AS strCarNumber
FROM
ast_fire_vehicle
WHERE
station_code = #{stationCode,jdbcType=VARCHAR}
GROUP BY
`type`,
`number`
</select>
</mapper>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-ccs-biz/src/main/java/com/yeejoin/amos/boot/module/ccs/biz/controller/FireStationInfoController.java
View file @
2078683c
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DatePattern;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DatePattern;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto
;
import
com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto
;
import
com.yeejoin.amos.boot.module.ccs.api.enums.StationOrderByTypeEnum
;
import
com.yeejoin.amos.boot.module.ccs.api.enums.StationOrderByTypeEnum
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.CarInfoVO
;
import
com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireStationInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireStationInfoServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -105,4 +106,11 @@ public class FireStationInfoController extends BaseController {
...
@@ -105,4 +106,11 @@ public class FireStationInfoController extends BaseController {
@ApiParam
(
value
=
"换流站编号"
)
@RequestParam
(
required
=
false
)
String
stationCode
)
{
@ApiParam
(
value
=
"换流站编号"
)
@RequestParam
(
required
=
false
)
String
stationCode
)
{
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getAlarmTrendByDatePeriod
(
stationCode
,
beginDate
,
endDate
));
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getAlarmTrendByDatePeriod
(
stationCode
,
beginDate
,
endDate
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据换流站code统计消防车"
,
notes
=
"根据换流站code统计消防车"
)
@GetMapping
(
value
=
"/getCarInfoByStationCode"
)
public
ResponseModel
<
List
<
CarInfoVO
>>
getCarInfoByStationCode
(
@ApiParam
(
value
=
"换流站编号"
)
@RequestParam
(
required
=
true
)
String
stationCode
)
{
return
ResponseHelper
.
buildResponse
(
fireStationInfoServiceImpl
.
getCarInfoByStationCode
(
stationCode
));
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-ccs-biz/src/main/java/com/yeejoin/amos/boot/module/ccs/biz/service/impl/FireStationInfoServiceImpl.java
View file @
2078683c
...
@@ -9,10 +9,13 @@ import com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto;
...
@@ -9,10 +9,13 @@ import com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireStationInfo
;
import
com.yeejoin.amos.boot.module.ccs.api.entity.FireStationInfo
;
import
com.yeejoin.amos.boot.module.ccs.api.enums.StationOrderByTypeEnum
;
import
com.yeejoin.amos.boot.module.ccs.api.enums.StationOrderByTypeEnum
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireStationInfoMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireStationInfoMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.mapper.FireVehicleMapper
;
import
com.yeejoin.amos.boot.module.ccs.api.service.IFireStationInfoService
;
import
com.yeejoin.amos.boot.module.ccs.api.service.IFireStationInfoService
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.AlarmCountVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.AlarmCountVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.CarInfoVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.DateAlarmCountVO
;
import
com.yeejoin.amos.boot.module.ccs.api.vo.DateAlarmCountVO
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
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
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
@@ -28,6 +31,9 @@ import java.util.stream.Collectors;
...
@@ -28,6 +31,9 @@ import java.util.stream.Collectors;
*/
*/
@Service
@Service
public
class
FireStationInfoServiceImpl
extends
BaseService
<
FireStationInfoDto
,
FireStationInfo
,
FireStationInfoMapper
>
implements
IFireStationInfoService
{
public
class
FireStationInfoServiceImpl
extends
BaseService
<
FireStationInfoDto
,
FireStationInfo
,
FireStationInfoMapper
>
implements
IFireStationInfoService
{
@Autowired
private
FireVehicleMapper
fireVehicleMapper
;
/**
/**
* 列表查询 示例
* 列表查询 示例
*
*
...
@@ -136,4 +142,15 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,
...
@@ -136,4 +142,15 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,
resultMap
.
put
(
"alarmNum"
,
alarmNumList
);
resultMap
.
put
(
"alarmNum"
,
alarmNumList
);
return
resultMap
;
return
resultMap
;
}
}
public
List
<
CarInfoVO
>
getCarInfoByStationCode
(
String
stationCode
)
{
List
<
CarInfoVO
>
carInfoByStationCode
=
fireVehicleMapper
.
getCarInfoByStationCode
(
stationCode
);
carInfoByStationCode
.
forEach
(
item
->
{
if
(
StrUtil
.
isNotEmpty
(
item
.
getStrCarNumber
()))
{
List
<
String
>
list
=
Arrays
.
asList
(
item
.
getStrCarNumber
().
split
(
","
));
item
.
setCarList
(
list
);
}
});
return
carInfoByStationCode
;
}
}
}
\ No newline at end of file
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