Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jyzb_platformV2
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
赵剑炜
jyzb_platformV2
Commits
6d715758
Commit
6d715758
authored
Dec 05, 2023
by
赵剑炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单警柜map修改
parent
23c21216
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
14 行增加
和
22 行删除
+14
-22
CabinetServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
+4
-13
CabinetMapper.xml
jyzb-biz/src/main/resources/mapper/CabinetMapper.xml
+10
-9
没有找到文件。
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/CabinetServiceImpl.java
View file @
6d715758
...
...
@@ -178,9 +178,6 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
*/
@Override
public
List
<
CabinetDto
>
getAllCabinetList
(
CabinetReq
req
)
{
// 判断组织机构是否存在
PubOrg
pubOrg
=
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
List
<
CabinetDto
>
cabinetList
=
new
ArrayList
<>();
List
<
Cabinet
>
list
=
cabinetMapper
.
getAllCabinetsWithSingleCabinet
(
String
.
valueOf
(
req
.
getOrgId
()),
req
.
getContainType
());
...
...
@@ -192,25 +189,19 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
CabinetDto
cabinetDto
=
new
CabinetDto
();
BeanPlusUtil
.
copyProperties
(
cabinet
,
cabinetDto
);
List
<
CabinetBox
>
list1
;
if
(
StringUtils
.
isNotBlank
(
req
.
getContainType
()))
{
list1
=
cabinetBoxService
.
list
(
new
LambdaQueryWrapper
<
CabinetBox
>()
.
eq
(
CabinetBox:
:
getCabinetId
,
cabinet
.
getId
())
.
eq
(
CabinetBox:
:
getContainType
,
req
.
getContainType
())
);
}
else
{
list1
=
cabinetBoxService
.
list
(
new
LambdaQueryWrapper
<
CabinetBox
>()
.
eq
(
CabinetBox:
:
getCabinetId
,
cabinet
.
getId
())
.
orderByAsc
(
CabinetBox:
:
getNum
)
// 根据 Num 字段升序排序
);
}
List
<
CabinetBoxDto
>
cabinetBoxList
=
new
ArrayList
<>();
for
(
CabinetBox
cabinetBox
:
list1
)
{
CabinetBoxDto
cabinetBoxDto
=
new
CabinetBoxDto
();
BeanPlusUtil
.
copyProperties
(
cabinetBox
,
cabinetBoxDto
);
// 查询箱门绑定的警员id和姓名
// List<Policeman> policeList = policemanService.list(new LambdaQueryWrapper<Policeman>()
// .eq(Policeman::getCabinetBoxId, cabinetBox.getId()));
List
<
Policeman
>
policeList
=
cabinetBoxPoliceMapper
.
selectByBoxId
(
cabinetBox
.
getId
());
if
(
policeList
.
size
()
!=
0
)
{
Policeman
policeman
=
policeList
.
get
(
0
);
...
...
jyzb-biz/src/main/resources/mapper/CabinetMapper.xml
View file @
6d715758
...
...
@@ -16,8 +16,10 @@
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"policeName"
column=
"police_name"
/>
<result
property=
"policeId"
column=
"police_id"
/>
<result
property=
"number"
column=
"number"
/>
<result
property=
"updateUser"
column=
"update_user"
/>
<!-- <collection property="list" ofType="com.junmp.jyzb.entity.CabinetBox" column="cabinet_id"-->
<!-- select="com.junmp.jyzb.mapper.CabinetBoxMapper.selectById">-->
...
...
@@ -73,16 +75,15 @@
</foreach>
</select>
<select
id=
"getAllCabinetsWithSingleCabinet"
resultType=
"com.junmp.jyzb.entity.Cabinet"
>
SELECT c.*
SELECT c.*
, cb.num as number,bp.`name` as police_name,bp.id as police_id
FROM base_cabinet c
JOIN pub_org o ON c.org_id_int = o.org_id
WHERE c.org_id_int = #{orgId}
AND (#{containType} IS NULL OR #{containType} = '' OR EXISTS (
SELECT 1
FROM base_cabinet_box cb
WHERE cb.cabinet_id = c.id
AND cb.contain_type = #{containType}
))
LEFT JOIN base_cabinet_box cb ON cb.cabinet_id = c.id
LEFT JOIN base_cabinet_box_police ccp ON ccp.cabinet_box_id = cb.id
LEFT JOIN base_policeman bp ON bp.id = ccp.police_id
WHERE c.org_id_int = #{orgId} and cb.num is not null;
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论