Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
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
竹天卫
tianjin-cement
Commits
f04c907f
Commit
f04c907f
authored
May 13, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备品牌筛选 模糊筛选
设备添加时 保证设备编号的唯一性
parent
8053c30b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
EquipmentMapper.xml
...cn/wise/sc/cement/business/mapper/xml/EquipmentMapper.xml
+1
-2
EquipmentServiceImpl.java
...sc/cement/business/service/impl/EquipmentServiceImpl.java
+4
-4
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EquipmentMapper.xml
View file @
f04c907f
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<where>
<where>
and t.status != 3
and t.status != 3
<if
test=
"params.brand != null and params.brand != ''"
>
<if
test=
"params.brand != null and params.brand != ''"
>
and t.brand
= #{params.brand}
and t.brand
like concat('%', #{params.brand}, '%')
</if>
</if>
<if
test=
"params.supplierId != null"
>
<if
test=
"params.supplierId != null"
>
and t.supplier_id = #{params.supplierId}
and t.supplier_id = #{params.supplierId}
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
<if
test=
"params.type != null"
>
<if
test=
"params.type != null"
>
and t.type = #{params.type}
and t.type = #{params.type}
</if>
</if>
</where>
</where>
</sql>
</sql>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EquipmentServiceImpl.java
View file @
f04c907f
...
@@ -221,10 +221,10 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
...
@@ -221,10 +221,10 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
return
BaseResponse
.
errorMsg
(
"设备名称不能为空!"
);
return
BaseResponse
.
errorMsg
(
"设备名称不能为空!"
);
}
}
QueryWrapper
<
Equipment
>
qw
=
new
QueryWrapper
<>();
QueryWrapper
<
Equipment
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"
name"
,
query
.
getNam
e
());
qw
.
eq
(
"
code"
,
query
.
getCod
e
());
int
count
=
equipmentMapper
.
selectCount
(
qw
);
int
count
=
equipmentMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
get
Nam
e
()
+
"已存在"
);
return
BaseResponse
.
errorMsg
(
query
.
get
Cod
e
()
+
"已存在"
);
}
}
Equipment
equipment
=
new
Equipment
();
Equipment
equipment
=
new
Equipment
();
BeanUtils
.
copyProperties
(
query
,
equipment
);
BeanUtils
.
copyProperties
(
query
,
equipment
);
...
@@ -248,11 +248,11 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
...
@@ -248,11 +248,11 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
return
BaseResponse
.
errorMsg
(
"设备名称不能为空!"
);
return
BaseResponse
.
errorMsg
(
"设备名称不能为空!"
);
}
}
QueryWrapper
<
Equipment
>
qw
=
new
QueryWrapper
<>();
QueryWrapper
<
Equipment
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"
name"
,
query
.
getNam
e
());
qw
.
eq
(
"
code"
,
query
.
getCod
e
());
qw
.
ne
(
"id"
,
query
.
getId
());
qw
.
ne
(
"id"
,
query
.
getId
());
int
count
=
equipmentMapper
.
selectCount
(
qw
);
int
count
=
equipmentMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
get
Nam
e
()
+
"已存在"
);
return
BaseResponse
.
errorMsg
(
query
.
get
Cod
e
()
+
"已存在"
);
}
}
Equipment
equipmentOld
=
equipmentMapper
.
selectById
(
query
.
getId
());
Equipment
equipmentOld
=
equipmentMapper
.
selectById
(
query
.
getId
());
equipmentOld
.
setType
(
query
.
getType
())
equipmentOld
.
setType
(
query
.
getType
())
...
...
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