Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-evbusiness-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7afd3023
authored
Nov 14, 2023
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
充电站接口
1 parent
a4778b36
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
470 additions
and
0 deletions
platform-evbusiness-api/src/main/java/cn/com/glsx/scrmadmin/modules/entity/ChargingStation.java
platform-evbusiness-api/src/main/java/cn/com/glsx/scrmadmin/modules/mapper/ChargingStationMapper.java
platform-evbusiness-api/src/main/java/cn/com/glsx/scrmadmin/modules/model/ChargingStationSearch.java
platform-evbusiness/src/main/java/cn/com/glsx/scrmadmin/modules/controller/ChargingStationController.java
platform-evbusiness/src/main/java/cn/com/glsx/scrmadmin/modules/service/ChargingStationService.java
platform-evbusiness/src/main/resources/mapper/ChargingStationMapper.xml
platform-evbusiness-api/src/main/java/cn/com/glsx/scrmadmin/modules/entity/ChargingStation.java
0 → 100644
View file @
7afd302
package
cn
.
com
.
glsx
.
scrmadmin
.
modules
.
entity
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.util.Date
;
@Table
(
name
=
"charging_station"
)
public
class
ChargingStation
implements
Serializable
{
/**
* 主键
*/
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
/**
* 充电站名称
*/
@Column
(
name
=
"`name`"
)
private
String
name
;
/**
* 开放开始时间
*/
@Column
(
name
=
"start_time"
)
private
String
startTime
;
/**
* 开放结束时间
*/
@Column
(
name
=
"end_time"
)
private
String
endTime
;
/**
* 计费模型id
*/
@Column
(
name
=
"model_id"
)
private
Integer
modelId
;
/**
* 经度
*/
private
String
longitude
;
/**
* 维度
*/
private
String
latitude
;
/**
* 充电站启用状态,0关闭 1正常
*/
private
Boolean
status
;
/**
* 创建人
*/
@Column
(
name
=
"created_by"
)
private
Integer
createdBy
;
/**
* 更新人
*/
@Column
(
name
=
"updated_by"
)
private
Integer
updatedBy
;
/**
* 创建时间
*/
@Column
(
name
=
"created_time"
)
private
Date
createdTime
;
/**
* 更新时间
*/
@Column
(
name
=
"updated_time"
)
private
Date
updatedTime
;
private
static
final
long
serialVersionUID
=
1L
;
/**
* 获取主键
*
* @return id - 主键
*/
public
Integer
getId
()
{
return
id
;
}
/**
* 设置主键
*
* @param id 主键
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
* 获取充电站名称
*
* @return name - 充电站名称
*/
public
String
getName
()
{
return
name
;
}
/**
* 设置充电站名称
*
* @param name 充电站名称
*/
public
void
setName
(
String
name
)
{
this
.
name
=
name
==
null
?
null
:
name
.
trim
();
}
/**
* 获取开放开始时间
*
* @return start_time - 开放开始时间
*/
public
String
getStartTime
()
{
return
startTime
;
}
/**
* 设置开放开始时间
*
* @param startTime 开放开始时间
*/
public
void
setStartTime
(
String
startTime
)
{
this
.
startTime
=
startTime
;
}
/**
* 获取开放结束时间
*
* @return end_time - 开放结束时间
*/
public
String
getEndTime
()
{
return
endTime
;
}
/**
* 设置开放结束时间
*
* @param endTime 开放结束时间
*/
public
void
setEndTime
(
String
endTime
)
{
this
.
endTime
=
endTime
;
}
/**
* 获取计费模型id
*
* @return model_id - 计费模型id
*/
public
Integer
getModelId
()
{
return
modelId
;
}
/**
* 设置计费模型id
*
* @param modelId 计费模型id
*/
public
void
setModelId
(
Integer
modelId
)
{
this
.
modelId
=
modelId
;
}
/**
* 获取经度
*
* @return longitude - 经度
*/
public
String
getLongitude
()
{
return
longitude
;
}
/**
* 设置经度
*
* @param longitude 经度
*/
public
void
setLongitude
(
String
longitude
)
{
this
.
longitude
=
longitude
==
null
?
null
:
longitude
.
trim
();
}
/**
* 获取维度
*
* @return latitude - 维度
*/
public
String
getLatitude
()
{
return
latitude
;
}
/**
* 设置维度
*
* @param latitude 维度
*/
public
void
setLatitude
(
String
latitude
)
{
this
.
latitude
=
latitude
==
null
?
null
:
latitude
.
trim
();
}
/**
* 获取充电站启用状态,0关闭 1正常
*
* @return status - 充电站启用状态,0关闭 1正常
*/
public
Boolean
getStatus
()
{
return
status
;
}
/**
* 设置充电站启用状态,0关闭 1正常
*
* @param status 充电站启用状态,0关闭 1正常
*/
public
void
setStatus
(
Boolean
status
)
{
this
.
status
=
status
;
}
/**
* 获取创建人
*
* @return created_by - 创建人
*/
public
Integer
getCreatedBy
()
{
return
createdBy
;
}
/**
* 设置创建人
*
* @param createdBy 创建人
*/
public
void
setCreatedBy
(
Integer
createdBy
)
{
this
.
createdBy
=
createdBy
;
}
/**
* 获取更新人
*
* @return updated_by - 更新人
*/
public
Integer
getUpdatedBy
()
{
return
updatedBy
;
}
/**
* 设置更新人
*
* @param updatedBy 更新人
*/
public
void
setUpdatedBy
(
Integer
updatedBy
)
{
this
.
updatedBy
=
updatedBy
;
}
/**
* 获取创建时间
*
* @return created_time - 创建时间
*/
public
Date
getCreatedTime
()
{
return
createdTime
;
}
/**
* 设置创建时间
*
* @param createdTime 创建时间
*/
public
void
setCreatedTime
(
Date
createdTime
)
{
this
.
createdTime
=
createdTime
;
}
/**
* 获取更新时间
*
* @return updated_time - 更新时间
*/
public
Date
getUpdatedTime
()
{
return
updatedTime
;
}
/**
* 设置更新时间
*
* @param updatedTime 更新时间
*/
public
void
setUpdatedTime
(
Date
updatedTime
)
{
this
.
updatedTime
=
updatedTime
;
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", name="
).
append
(
name
);
sb
.
append
(
", startTime="
).
append
(
startTime
);
sb
.
append
(
", endTime="
).
append
(
endTime
);
sb
.
append
(
", modelId="
).
append
(
modelId
);
sb
.
append
(
", longitude="
).
append
(
longitude
);
sb
.
append
(
", latitude="
).
append
(
latitude
);
sb
.
append
(
", status="
).
append
(
status
);
sb
.
append
(
", createdBy="
).
append
(
createdBy
);
sb
.
append
(
", updatedBy="
).
append
(
updatedBy
);
sb
.
append
(
", createdTime="
).
append
(
createdTime
);
sb
.
append
(
", updatedTime="
).
append
(
updatedTime
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
}
\ No newline at end of file
platform-evbusiness-api/src/main/java/cn/com/glsx/scrmadmin/modules/mapper/ChargingStationMapper.java
0 → 100644
View file @
7afd302
package
cn
.
com
.
glsx
.
scrmadmin
.
modules
.
mapper
;
import
cn.com.glsx.scrmadmin.modules.entity.ChargingStation
;
import
cn.com.glsx.scrmadmin.modules.model.ChargingStationSearch
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
public
interface
ChargingStationMapper
extends
CommonBaseMapper
<
ChargingStation
>
{
List
<
ChargingStation
>
page
(
ChargingStationSearch
search
);
}
\ No newline at end of file
platform-evbusiness-api/src/main/java/cn/com/glsx/scrmadmin/modules/model/ChargingStationSearch.java
0 → 100644
View file @
7afd302
package
cn
.
com
.
glsx
.
scrmadmin
.
modules
.
model
;
import
cn.hutool.db.Page
;
import
lombok.Data
;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/14
**/
@Data
public
class
ChargingStationSearch
extends
Page
{
private
String
name
;
@Override
public
int
getPageNumber
()
{
return
super
.
getPageNumber
()
==
0
?
1
:
super
.
getPageNumber
();
}
}
platform-evbusiness/src/main/java/cn/com/glsx/scrmadmin/modules/controller/ChargingStationController.java
0 → 100644
View file @
7afd302
package
cn
.
com
.
glsx
.
scrmadmin
.
modules
.
controller
;
import
cn.com.glsx.scrmadmin.modules.entity.ChargingStation
;
import
cn.com.glsx.scrmadmin.modules.model.ChargingStationSearch
;
import
cn.com.glsx.scrmadmin.modules.service.ChargingStationService
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.core.annotation.ResponseResultBody
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/14
**/
@Slf4j
@Tag
(
name
=
"充电站接口"
)
@RestController
@RequestMapping
(
value
=
"/chargeStations"
)
@ResponseResultBody
public
class
ChargingStationController
{
@Autowired
private
ChargingStationService
stationService
;
@Operation
(
summary
=
"分页查询充电站"
,
description
=
"分页查询充电站"
)
@GetMapping
public
PageInfo
<
ChargingStation
>
page
(
ChargingStationSearch
search
)
{
return
stationService
.
page
(
search
);
}
@Operation
(
summary
=
"查询充电站详情"
,
description
=
"查询充电站详情"
)
@GetMapping
(
"/{id}"
)
public
ChargingStation
detail
(
@PathVariable
(
"id"
)
Long
id
)
{
return
stationService
.
detail
(
id
);
}
}
platform-evbusiness/src/main/java/cn/com/glsx/scrmadmin/modules/service/ChargingStationService.java
0 → 100644
View file @
7afd302
package
cn
.
com
.
glsx
.
scrmadmin
.
modules
.
service
;
import
cn.com.glsx.scrmadmin.modules.entity.ChargingStation
;
import
cn.com.glsx.scrmadmin.modules.mapper.ChargingStationMapper
;
import
cn.com.glsx.scrmadmin.modules.model.ChargingStationSearch
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2023/11/14
**/
@Service
public
class
ChargingStationService
{
@Autowired
private
ChargingStationMapper
stationMapper
;
public
PageInfo
<
ChargingStation
>
page
(
ChargingStationSearch
search
)
{
PageHelper
.
startPage
(
search
.
getPageNumber
(),
search
.
getPageSize
());
List
<
ChargingStation
>
list
=
stationMapper
.
page
(
search
);
return
new
PageInfo
<>(
list
);
}
public
ChargingStation
detail
(
Long
id
)
{
return
stationMapper
.
selectByPrimaryKey
(
id
);
}
}
platform-evbusiness/src/main/resources/mapper/ChargingStationMapper.xml
0 → 100644
View file @
7afd302
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.com.glsx.scrmadmin.modules.mapper.ChargingStationMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.scrmadmin.modules.entity.ChargingStation"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"start_time"
jdbcType=
"VARCHAR"
property=
"startTime"
/>
<result
column=
"end_time"
jdbcType=
"VARCHAR"
property=
"endTime"
/>
<result
column=
"model_id"
jdbcType=
"INTEGER"
property=
"modelId"
/>
<result
column=
"longitude"
jdbcType=
"VARCHAR"
property=
"longitude"
/>
<result
column=
"latitude"
jdbcType=
"VARCHAR"
property=
"latitude"
/>
<result
column=
"status"
jdbcType=
"BIT"
property=
"status"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
<result
column=
"created_time"
jdbcType=
"TIMESTAMP"
property=
"createdTime"
/>
<result
column=
"updated_time"
jdbcType=
"TIMESTAMP"
property=
"updatedTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, `name`, start_time, end_time, model_id, longitude, latitude, `status`, created_by,
updated_by, created_time, updated_time
</sql>
<select
id=
"page"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from charging_station
<where>
<if
test=
"name != null and name != ''"
>
and `name` like concat('%',#{name},'%')
</if>
</where>
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment