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
6aad5a32
Commit
6aad5a32
authored
Nov 01, 2022
by
srx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备模糊筛选
parent
5f5e4daa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
15 deletions
+86
-15
EquipmentMapper.java
...join/amos/boot/module/ugp/api/mapper/EquipmentMapper.java
+6
-0
IEquipmentService.java
...n/amos/boot/module/ugp/api/service/IEquipmentService.java
+3
-0
EquipmentMapper.xml
...ule-ugp-api/src/main/resources/mapper/EquipmentMapper.xml
+15
-0
EquipmentController.java
...s/boot/module/ugp/biz/controller/EquipmentController.java
+39
-15
EquipmentServiceImpl.java
...oot/module/ugp/biz/service/impl/EquipmentServiceImpl.java
+23
-0
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/EquipmentMapper.java
View file @
6aad5a32
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
/**
* 设备信息表 Mapper 接口
* 设备信息表 Mapper 接口
*
*
...
@@ -12,5 +17,6 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -12,5 +17,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
*/
@Mapper
@Mapper
public
interface
EquipmentMapper
extends
BaseMapper
<
Equipment
>
{
public
interface
EquipmentMapper
extends
BaseMapper
<
Equipment
>
{
List
<
EquipmentDto
>
queryEquipmentPage
(
Equipment
equipmentParam
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IEquipmentService.java
View file @
6aad5a32
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -14,9 +15,11 @@ import java.util.List;
...
@@ -14,9 +15,11 @@ import java.util.List;
* @author system_generator
* @author system_generator
* @date 2022-09-22
* @date 2022-09-22
*/
*/
public
interface
IEquipmentService
{
public
interface
IEquipmentService
{
//添加设备+附件
//添加设备+附件
EquipmentDto
saveEI
(
JSONObject
object
);
EquipmentDto
saveEI
(
JSONObject
object
);
Page
<
EquipmentDto
>
queryEquipmentPage
(
int
current
,
int
size
,
Equipment
equipment
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/EquipmentMapper.xml
View file @
6aad5a32
...
@@ -2,4 +2,19 @@
...
@@ -2,4 +2,19 @@
<!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.ugp.api.mapper.EquipmentMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper"
>
<select
id=
"queryEquipmentPage"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.entity.Equipment"
>
select * from tz_ugp_equipment
<where>
<if
test=
"name != '' and name != null"
>
and `name` like concat('%',#{name},'%')
</if>
<if
test=
"code != '' and code != null"
>
and `code` like concat('%',#{code},'%')
</if>
<if
test=
"verifyStatus != '' and verifyStatus != null"
>
and `verifyStatus` like concat('%',#{verifyStatus},'%')
</if>
</where>
</select>
</mapper>
</mapper>
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/EquipmentController.java
View file @
6aad5a32
...
@@ -4,8 +4,12 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,8 +4,12 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
...
@@ -20,6 +24,8 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
...
@@ -20,6 +24,8 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.EquipmentServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.EquipmentServiceImpl
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
...
@@ -46,6 +52,7 @@ public class EquipmentController extends BaseController {
...
@@ -46,6 +52,7 @@ public class EquipmentController extends BaseController {
@Autowired
@Autowired
EquipmentServiceImpl
equipmentServiceImpl
;
EquipmentServiceImpl
equipmentServiceImpl
;
@Autowired
@Autowired
EquipmentMapper
equipmentMapper
;
EquipmentMapper
equipmentMapper
;
...
@@ -111,29 +118,46 @@ public class EquipmentController extends BaseController {
...
@@ -111,29 +118,46 @@ public class EquipmentController extends BaseController {
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryBySeq
(
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
}
// /**
// * 列表分页查询
// *
// * @param current 当前页
// * @param current 每页大小
// * @return
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
// @GetMapping(value = "/page")
// @ApiOperation(httpMethod = "GET",value = "设备信息表分页查询", notes = "设备信息表分页查询")
// public ResponseModel<Page<EquipmentDto>> queryForPage(
// @RequestParam(value = "current") int current,
// @RequestParam(value = "size") int size,
// @RequestParam(value = "name",required = false) String name,
// @RequestParam(value = "code",required = false) String code,
// @RequestParam(value = "verifyStatus",required = false)String verifyStatus) {
// Page<EquipmentDto> page = new Page<EquipmentDto>();
// page.setCurrent(current);
// page.setSize(size);
//
// return ResponseHelper.buildResponse(equipmentServiceImpl.queryForEquipmentPage(page,name,code,verifyStatus));
// }
/**
/**
* 列表分页查询
* 列表分页查询
*
*
* @param current 当前页
* @param current 当前页
* @param current 每页大小
* @param current 每页大小
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/page"
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息表分页查询"
,
notes
=
"设备信息表分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息表分页查询"
,
notes
=
"设备信息表分页查询"
)
public
ResponseModel
<
Page
<
EquipmentDto
>>
queryForPage
(
public
ResponseModel
<
Page
<
EquipmentDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"size"
)
int
size
,
Equipment
equipment
)
{
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryEquipmentPage
(
current
,
size
,
equipment
));
@RequestParam
(
value
=
"code"
,
required
=
false
)
String
code
,
@RequestParam
(
value
=
"verifyStatus"
,
required
=
false
)
String
verifyStatus
)
{
Page
<
EquipmentDto
>
page
=
new
Page
<
EquipmentDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryForEquipmentPage
(
page
,
name
,
code
,
verifyStatus
));
}
}
/**
/**
* 列表全部数据查询
* 列表全部数据查询
*
*
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/EquipmentServiceImpl.java
View file @
6aad5a32
...
@@ -7,7 +7,10 @@ import com.alibaba.fastjson.JSON;
...
@@ -7,7 +7,10 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper
;
...
@@ -22,6 +25,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...
@@ -22,6 +25,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -172,6 +176,24 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
...
@@ -172,6 +176,24 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
// BeanUtils.copyProperties(attachmentDto,attachment);
// BeanUtils.copyProperties(attachmentDto,attachment);
}
}
public
Page
<
EquipmentDto
>
queryEquipmentPage
(
int
current
,
int
size
,
Equipment
equipment
)
{
Page
<
EquipmentDto
>
page
=
new
Page
<>();
page
.
setSize
(
size
);
page
.
setCurrent
(
current
);
this
.
list
();
List
<
EquipmentDto
>
equipments
=
equipmentMapper
.
queryEquipmentPage
(
equipment
);
// List<CompanyDto> companyDtos = new ArrayList<>();
// BeanUtils.copyProperties(companies,companyDtos);
page
.
setRecords
(
equipments
);
// if (companyDto.getName() != null) {
// List<CompanyDto> collect = page1.getRecords().stream().filter(a -> a.getName().equals(companyDto.getName())).collect(Collectors.toList());
// page1.setRecords(collect);
// }
return
page
;
}
}
}
\ 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