Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
E
energyai_java
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
葛齐林
energyai_java
Commits
a9ddea4d
Commit
a9ddea4d
authored
May 31, 2021
by
co_dengxiongwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
点位管理接口
parent
e154941f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
451 additions
and
0 deletions
+451
-0
LiResourcePoints.java
...tform/admin/modules/liresource/bean/LiResourcePoints.java
+69
-0
LiResourcePointsController.java
...les/liresource/controller/LiResourcePointsController.java
+150
-0
LiResourcePointsDao.java
...orm/admin/modules/liresource/dao/LiResourcePointsDao.java
+32
-0
LiResourcePointsModel.java
...admin/modules/liresource/model/LiResourcePointsModel.java
+48
-0
LiResourcePointsService.java
...n/modules/liresource/service/LiResourcePointsService.java
+33
-0
LiResourcePointsServiceImpl.java
.../liresource/service/impl/LiResourcePointsServiceImpl.java
+49
-0
LiResourcePointsMapper.xml
...in/resources/mapper/liResource/LiResourcePointsMapper.xml
+70
-0
No files found.
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/bean/LiResourcePoints.java
0 → 100644
View file @
a9ddea4d
package
com
.
devplatform
.
admin
.
modules
.
liresource
.
bean
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
@ApiModel
(
value
=
"点位维护表对象"
,
description
=
"点位维护表对象"
)
@TableName
(
"li_resource_points"
)
public
class
LiResourcePoints
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** 主键id */
@ApiModelProperty
(
value
=
"主键ID"
,
name
=
"id"
)
@TableId
private
java
.
lang
.
String
id
;
/** 资源点id */
@ApiModelProperty
(
value
=
"资源点id"
,
name
=
"resourceId"
)
private
java
.
lang
.
String
resourceId
;
/** 点位名称 */
@ApiModelProperty
(
value
=
"点位名称"
,
name
=
"name"
)
private
java
.
lang
.
String
name
;
/** slaveID */
@ApiModelProperty
(
value
=
"slaveID"
,
name
=
"slaveId"
)
private
Integer
slaveId
;
/** 功能码类型(1:读线圈 2:读离散量输入 3:读保持寄存器 4:读输入寄存器) */
@ApiModelProperty
(
value
=
"功能码类型(1:读线圈 2:读离散量输入 3:读保持寄存器 4:读输入寄存器)"
,
name
=
"functionCodeType"
)
private
Byte
functionCodeType
;
/** 数据类型(1:INTEGER 2:STRING 3:FLOAT 4:DOUBLE) */
@ApiModelProperty
(
value
=
"数据类型(1:INTEGER 2:STRING 3:FLOAT 4:DOUBLE)"
,
name
=
"dataType"
)
private
Byte
dataType
;
/** 寄存器地址 */
@ApiModelProperty
(
value
=
"寄存器地址"
,
name
=
"registerAddress"
)
private
Integer
registerAddress
;
/** 创建人 */
@ApiModelProperty
(
value
=
"创建人"
,
name
=
"createUserId"
)
private
java
.
lang
.
String
createUserId
;
/** 创建时间 */
@ApiModelProperty
(
value
=
"创建时间"
,
name
=
"createTime"
)
private
java
.
util
.
Date
createTime
;
/** 修改人 */
@ApiModelProperty
(
value
=
"修改人"
,
name
=
"updateUserId"
)
private
java
.
lang
.
String
updateUserId
;
/** 修改时间 */
@ApiModelProperty
(
value
=
"修改时间"
,
name
=
"updateTime"
)
private
java
.
util
.
Date
updateTime
;
/** 是否已删除(0未删除,1已删除) */
@ApiModelProperty
(
value
=
"是否已删除(0未删除,1已删除)"
,
name
=
"deleted"
)
private
Integer
deleted
;
/** 系统标识 */
@ApiModelProperty
(
value
=
"系统标识"
,
name
=
"sysSign"
)
private
java
.
lang
.
String
sysSign
;
/** 站点ID */
@ApiModelProperty
(
value
=
"站点ID"
,
name
=
"stationId"
)
private
java
.
lang
.
String
stationId
;
/** 备用项1 */
@ApiModelProperty
(
value
=
"备用项1"
,
name
=
"byx1"
)
private
java
.
lang
.
String
byx1
;
/** 备用项2 */
@ApiModelProperty
(
value
=
"备用项2"
,
name
=
"byx2"
)
private
java
.
lang
.
String
byx2
;
/** 备用项3 */
@ApiModelProperty
(
value
=
"备用项3"
,
name
=
"byx3"
)
private
java
.
lang
.
String
byx3
;
}
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/controller/LiResourcePointsController.java
0 → 100644
View file @
a9ddea4d
package
com
.
devplatform
.
admin
.
modules
.
liresource
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.devplatform.admin.common.utils.AbstractController
;
import
com.devplatform.admin.modules.liresource.bean.LiResourcePoints
;
import
com.devplatform.admin.modules.liresource.model.LiResourcePointsModel
;
import
com.devplatform.admin.modules.liresource.service.LiResourcePointsService
;
import
com.devplatform.common.base.annotation.SysLog
;
import
com.devplatform.common.base.validator.ValidatorUtils
;
import
com.devplatform.common.util.PageUtils
;
import
com.devplatform.common.util.R
;
import
com.devplatform.common.util.StringUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* <br>
* <b>功能:</b>LiResourcePointsController<br>
* @author 代码生成器产生
*/
@Api
(
tags
={
"点位维护表接口"
})
@RestController
@RequestMapping
(
"/liResourcePoints"
)
public
class
LiResourcePointsController
extends
AbstractController
{
@Autowired
private
LiResourcePointsService
liResourcePointsService
;
/**
* 列表页面列表数据获取
* @param params 承接对象
* @return
*/
@ApiOperation
(
value
=
"根据条件获取点位维护表分页数据列表"
,
notes
=
"根据条件获取点位维护表分页数据列表"
)
@ApiImplicitParam
(
name
=
"params"
,
value
=
"参数"
,
required
=
true
,
dataType
=
"Map<String, Object>"
)
@PostMapping
(
"/list"
)
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
//分页查询
PageUtils
page
=
liResourcePointsService
.
queryPage
(
params
,
null
);
//返回分页结果
return
R
.
ok
().
put
(
"page"
,
page
);
}
/**
* 列表页面列表数据获取
* @param model 承接对象
* @return
*/
@ApiOperation
(
value
=
"根据条件获取点位维护表分页数据列表"
,
notes
=
"根据条件获取点位维护表分页数据列表"
)
@ApiImplicitParam
(
name
=
"model"
,
value
=
"参数"
,
required
=
true
,
dataType
=
"LiResourcePointsModel"
)
@PostMapping
(
"/pageList"
)
public
R
pageList
(
@RequestBody
LiResourcePointsModel
model
)
{
//如果model参数中没有设置排序方式,则默认以创建时间倒序排列
if
(
StringUtil
.
isEmpty
(
model
.
getSort
())){
model
.
setSort
(
"create_time desc"
);
}
//按条件查询分页数据
List
<
LiResourcePoints
>
list
=
liResourcePointsService
.
queryPageList
(
model
);
//将查询结果中数据和数量封装起来做为接口返回值
return
R
.
ok
().
put
(
"page"
,
getMyPage
(
list
,
model
));
}
/**
* 添加
* @param bean 点位维护表对象
* @return
*/
@SysLog
(
"添加点位维护表"
)
@ApiOperation
(
value
=
"新增点位维护表数据"
,
notes
=
"新增点位维护表数据"
)
@PostMapping
(
"/save"
)
public
R
save
(
@RequestBody
@ApiParam
(
value
=
"点位维护表实体对象"
,
required
=
true
)
LiResourcePoints
bean
)
{
ValidatorUtils
.
validateEntity
(
bean
);
bean
.
setCreateUserId
(
getUserId
());
bean
.
setCreateTime
(
new
Date
());
liResourcePointsService
.
save
(
bean
);
return
R
.
ok
();
}
/**
* 修改
* @param bean 点位维护表对象
* @return
*/
@SysLog
(
"修改点位维护表"
)
@ApiOperation
(
value
=
"修改点位维护表数据"
,
notes
=
"修改点位维护表数据"
)
@PostMapping
(
"/update"
)
public
R
update
(
@RequestBody
@ApiParam
(
value
=
"点位维护表实体对象"
,
required
=
true
)
LiResourcePoints
bean
)
{
ValidatorUtils
.
validateEntity
(
bean
);
bean
.
setUpdateUserId
(
getUserId
());
bean
.
setUpdateTime
(
new
Date
());
liResourcePointsService
.
update
(
bean
,
new
QueryWrapper
<
LiResourcePoints
>().
eq
(
StringUtil
.
checkNotNull
(
bean
.
getId
()),
"id"
,
bean
.
getId
()));
return
R
.
ok
();
}
/**
* 根据ID获取点位维护表对象
* @param id 对象主键
* @return
*/
@ApiOperation
(
value
=
"根据ID获取点位维护表对象"
,
notes
=
"根据ID获取点位维护表对象"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
dataType
=
"String"
)
@GetMapping
(
"/getId/{id}"
)
public
R
getId
(
@PathVariable
String
id
)
{
LiResourcePoints
bean
=
liResourcePointsService
.
getById
(
id
);
return
R
.
ok
().
put
(
"bean"
,
bean
);
}
/**
* 根据ID获取点位维护表对象
* @param ids 点位维护表对象主键数组
* @return
*/
@SysLog
(
"删除点位维护表数据"
)
@ApiOperation
(
value
=
"根据ID批量删除点位维护表数据"
,
notes
=
"根据ID批量删除点位维护表数据"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键数组"
,
required
=
true
,
dataType
=
"String"
)
@PostMapping
(
"/delete"
)
public
R
delete
(
@RequestBody
String
[]
ids
)
{
liResourcePointsService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
R
.
ok
();
}
/**
* 逻辑删除
* 根据ID删除点位维护表对象
* @param ids 点位维护表对象主键数组
* @return
*/
@SysLog
(
"删除点位维护表数据"
)
@ApiOperation
(
value
=
"根据ID批量删除点位维护表数据"
,
notes
=
"根据ID批量删除点位维护表数据"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键数组"
,
required
=
true
,
dataType
=
"String[]"
)
@PostMapping
(
"/deleteByFlag"
)
public
R
deleteByFlag
(
@RequestBody
String
[]
ids
)
{
//根据id数组删除
liResourcePointsService
.
deleteByFlagByIds
(
ids
,
getUserId
());
//返回成功
return
R
.
ok
();
}
}
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/dao/LiResourcePointsDao.java
0 → 100644
View file @
a9ddea4d
package
com
.
devplatform
.
admin
.
modules
.
liresource
.
dao
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.devplatform.admin.modules.liresource.model.LiResourcePointsModel
;
import
com.devplatform.admin.modules.liresource.bean.LiResourcePoints
;
import
com.devplatform.common.dao.MyBaseMapper
;
import
java.util.List
;
/**
* LiResourcePoints Mapper
* 用于点位维护表的数据库操作
* @author Administrator
*
*/
@Mapper
public
interface
LiResourcePointsDao
extends
MyBaseMapper
<
LiResourcePoints
>
{
/**
* 查询分页数量
* @param model
* @return
*/
Integer
queryPageByCount
(
LiResourcePointsModel
model
);
/**
* 查询点位维护表分页数据
* @param model
* @return
*/
List
<
LiResourcePoints
>
queryPageList
(
LiResourcePointsModel
model
);
}
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/model/LiResourcePointsModel.java
0 → 100644
View file @
a9ddea4d
package
com
.
devplatform
.
admin
.
modules
.
liresource
.
model
;
import
com.devplatform.admin.common.model.BaseModel
;
import
lombok.Data
;
/**
* 点位维护表的Model
* <br>
* @author 代码生成器产生
*/
@Data
public
class
LiResourcePointsModel
extends
BaseModel
{
/** 主键id */
private
java
.
lang
.
String
id
;
/** 资源点id */
private
java
.
lang
.
String
resourceId
;
/** 点位名称 */
private
java
.
lang
.
String
name
;
/** slaveID */
private
Integer
slaveId
;
/** 功能码类型(1:读线圈 2:读离散量输入 3:读保持寄存器 4:读输入寄存器) */
private
Byte
functionCodeType
;
/** 数据类型(1:INTEGER 2:STRING 3:FLOAT 4:DOUBLE) */
private
Byte
dataType
;
/** 寄存器地址 */
private
Integer
registerAddress
;
/** 创建人 */
private
java
.
lang
.
String
createUserId
;
/** 创建时间 */
private
java
.
util
.
Date
createTime
;
/** 修改人 */
private
java
.
lang
.
String
updateUserId
;
/** 修改时间 */
private
java
.
util
.
Date
updateTime
;
/** 是否已删除(0未删除,1已删除) */
private
Integer
deleted
;
/** 系统标识 */
private
java
.
lang
.
String
sysSign
;
/** 站点ID */
private
java
.
lang
.
String
stationId
;
/** 备用项1 */
private
java
.
lang
.
String
byx1
;
/** 备用项2 */
private
java
.
lang
.
String
byx2
;
/** 备用项3 */
private
java
.
lang
.
String
byx3
;
}
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/service/LiResourcePointsService.java
0 → 100644
View file @
a9ddea4d
package
com
.
devplatform
.
admin
.
modules
.
liresource
.
service
;
import
com.devplatform.common.service.MyBaseService
;
import
com.devplatform.admin.modules.liresource.bean.LiResourcePoints
;
import
com.devplatform.admin.modules.liresource.model.LiResourcePointsModel
;
import
java.util.List
;
/**
* 点位维护表的service接口
* <br>
* <b>功能:</b>LiResourcePointsService<br>
* @author 代码生成器产生
*/
public
interface
LiResourcePointsService
extends
MyBaseService
<
LiResourcePoints
>
{
/**
* 查询点位维护表分页数据
* @param model
* @return
*/
List
<
LiResourcePoints
>
queryPageList
(
LiResourcePointsModel
model
);
/**
* 根据ID删除点位维护表对象
* @param ids
* @param userId
* @return void
*/
void
deleteByFlagByIds
(
String
[]
ids
,
String
userId
);
}
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/service/impl/LiResourcePointsServiceImpl.java
0 → 100644
View file @
a9ddea4d
package
com
.
devplatform
.
admin
.
modules
.
liresource
.
service
.
impl
;
import
org.springframework.stereotype.Service
;
import
com.devplatform.admin.modules.liresource.model.LiResourcePointsModel
;
import
com.devplatform.admin.modules.liresource.bean.LiResourcePoints
;
import
com.devplatform.admin.modules.liresource.dao.LiResourcePointsDao
;
import
com.devplatform.admin.modules.liresource.service.LiResourcePointsService
;
import
com.devplatform.common.service.impl.MyBaseServiceImpl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 点位维护表的service接口实现类
* <br>
* <b>功能:</b>LiResourcePointsServiceImpl<br>
* @author 代码生成器产生
*/
@Service
(
"liResourcePointsService"
)
public
class
LiResourcePointsServiceImpl
extends
MyBaseServiceImpl
<
LiResourcePointsDao
,
LiResourcePoints
>
implements
LiResourcePointsService
{
@Override
public
List
<
LiResourcePoints
>
queryPageList
(
LiResourcePointsModel
model
)
{
Integer
rowCount
=
baseMapper
.
queryPageByCount
(
model
);
model
.
getPager
().
setRowCount
(
rowCount
);
return
baseMapper
.
queryPageList
(
model
);
}
@Override
public
void
deleteByFlagByIds
(
String
[]
ids
,
String
userId
){
//用来暂存所有要删除的对象
List
<
LiResourcePoints
>
beans
=
new
ArrayList
<
LiResourcePoints
>();
//遍历ids数组
for
(
String
id:
ids
){
LiResourcePoints
temp
=
new
LiResourcePoints
();
temp
.
setId
(
id
);
//将数据标记为删除
temp
.
setDeleted
(
1
);
temp
.
setUpdateUserId
(
userId
);
temp
.
setUpdateTime
(
new
Date
());
//将要删除的对象存放在list中
beans
.
add
(
temp
);
}
//调用批量更新操作
updateBatchById
(
beans
);
}
}
microservice-admin/src/main/resources/mapper/liResource/LiResourcePointsMapper.xml
0 → 100644
View file @
a9ddea4d
<?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=
"com.devplatform.admin.modules.liresource.dao.LiResourcePointsDao"
>
<!-- Result Map -->
<resultMap
id=
"BaseResultMap"
type=
"com.devplatform.admin.modules.liresource.bean.LiResourcePoints"
>
<result
column=
"id"
property=
"id"
/>
<result
column=
"resource_id"
property=
"resourceId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"slave_id"
property=
"slaveId"
/>
<result
column=
"function_code_type"
property=
"functionCodeType"
/>
<result
column=
"data_type"
property=
"dataType"
/>
<result
column=
"register_address"
property=
"registerAddress"
/>
<result
column=
"create_user_id"
property=
"createUserId"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_user_id"
property=
"updateUserId"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"deleted"
property=
"deleted"
/>
<result
column=
"sys_sign"
property=
"sysSign"
/>
<result
column=
"station_id"
property=
"stationId"
/>
<result
column=
"byx1"
property=
"byx1"
/>
<result
column=
"byx2"
property=
"byx2"
/>
<result
column=
"byx3"
property=
"byx3"
/>
</resultMap>
<!-- li_resource_points table all fields -->
<sql
id=
"Base_Column_List"
>
id,resource_id,name,slave_id,function_code_type,data_type,register_address,create_user_id,create_time,update_user_id,update_time,deleted,sys_sign,station_id,byx1,byx2,byx3
</sql>
<!-- 公共查询条件 -->
<sql
id=
"Example_Where_Clause"
>
where t.deleted=0
<if
test=
"id!=null and id!=''"
>
and t.id = #{id}
</if>
<if
test=
"resourceId!=null and resourceId!=''"
>
and t.resource_id = #{resourceId}
</if>
<if
test=
"name!=null and name!=''"
>
and t.name = #{name}
</if>
<if
test=
"slaveId!=null "
>
and t.slave_id = #{slaveId}
</if>
<if
test=
"functionCodeType!=null "
>
and t.function_code_type = #{functionCodeType}
</if>
<if
test=
"dataType!=null "
>
and t.data_type = #{dataType}
</if>
<if
test=
"registerAddress!=null "
>
and t.register_address = #{registerAddress}
</if>
<if
test=
"createUserId!=null and createUserId!=''"
>
and t.create_user_id = #{createUserId}
</if>
<if
test=
"createTime!=null "
>
and t.create_time = #{createTime}
</if>
<if
test=
"updateUserId!=null and updateUserId!=''"
>
and t.update_user_id = #{updateUserId}
</if>
<if
test=
"updateTime!=null "
>
and t.update_time = #{updateTime}
</if>
<if
test=
"deleted!=null "
>
and t.deleted = #{deleted}
</if>
<if
test=
"sysSign!=null and sysSign!=''"
>
and t.sys_sign = #{sysSign}
</if>
<if
test=
"stationId!=null and stationId!=''"
>
and t.station_id = #{stationId}
</if>
<if
test=
"byx1!=null and byx1!=''"
>
and t.byx1 = #{byx1}
</if>
<if
test=
"byx2!=null and byx2!=''"
>
and t.byx2 = #{byx2}
</if>
<if
test=
"byx3!=null and byx3!=''"
>
and t.byx3 = #{byx3}
</if>
</sql>
<select
id=
"queryPageByCount"
parameterType=
"Object"
resultType=
"java.lang.Integer"
>
select count(1) from li_resource_points t
<include
refid=
"Example_Where_Clause"
/>
</select>
<select
id=
"queryPageList"
parameterType=
"Object"
resultMap=
"BaseResultMap"
>
select t.* from li_resource_points t
<include
refid=
"Example_Where_Clause"
/>
<if
test=
"pager.orderCondition != null and pager.orderCondition != ''"
>
${pager.orderCondition}
</if>
<if
test=
"pager.mysqlQueryCondition != null and pager.mysqlQueryCondition != ''"
>
${pager.mysqlQueryCondition}
</if>
</select>
</mapper>
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