Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
b8fb7c7a
Commit
b8fb7c7a
authored
May 01, 2022
by
神话
Browse files
给商品查询增加查询条件接口
parent
dd2f7197
Changes
4
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java
View file @
b8fb7c7a
...
@@ -23,6 +23,12 @@ public interface MaterialMapperEx {
...
@@ -23,6 +23,12 @@ public interface MaterialMapperEx {
@Param
(
"name"
)
String
name
,
@Param
(
"name"
)
String
name
,
@Param
(
"standard"
)
String
standard
,
@Param
(
"standard"
)
String
standard
,
@Param
(
"model"
)
String
model
,
@Param
(
"model"
)
String
model
,
@Param
(
"color"
)
String
color
,
@Param
(
"weight"
)
String
weight
,
@Param
(
"expiryNum"
)
String
expiryNum
,
@Param
(
"enableSerialNumber"
)
String
enableSerialNumber
,
@Param
(
"enableBatchNumber"
)
String
enableBatchNumber
,
@Param
(
"remark"
)
String
remark
,
@Param
(
"idList"
)
List
<
Long
>
idList
,
@Param
(
"idList"
)
List
<
Long
>
idList
,
@Param
(
"mpList"
)
String
mpList
,
@Param
(
"mpList"
)
String
mpList
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"offset"
)
Integer
offset
,
...
@@ -33,6 +39,12 @@ public interface MaterialMapperEx {
...
@@ -33,6 +39,12 @@ public interface MaterialMapperEx {
@Param
(
"name"
)
String
name
,
@Param
(
"name"
)
String
name
,
@Param
(
"standard"
)
String
standard
,
@Param
(
"standard"
)
String
standard
,
@Param
(
"model"
)
String
model
,
@Param
(
"model"
)
String
model
,
@Param
(
"color"
)
String
color
,
@Param
(
"weight"
)
String
weight
,
@Param
(
"expiryNum"
)
String
expiryNum
,
@Param
(
"enableSerialNumber"
)
String
enableSerialNumber
,
@Param
(
"enableBatchNumber"
)
String
enableBatchNumber
,
@Param
(
"remark"
)
String
remark
,
@Param
(
"idList"
)
List
<
Long
>
idList
,
@Param
(
"idList"
)
List
<
Long
>
idList
,
@Param
(
"mpList"
)
String
mpList
);
@Param
(
"mpList"
)
String
mpList
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialComponent.java
View file @
b8fb7c7a
...
@@ -38,8 +38,15 @@ public class MaterialComponent implements ICommonQuery {
...
@@ -38,8 +38,15 @@ public class MaterialComponent implements ICommonQuery {
String
name
=
StringUtil
.
getInfo
(
search
,
"name"
);
String
name
=
StringUtil
.
getInfo
(
search
,
"name"
);
String
standard
=
StringUtil
.
getInfo
(
search
,
"standard"
);
String
standard
=
StringUtil
.
getInfo
(
search
,
"standard"
);
String
model
=
StringUtil
.
getInfo
(
search
,
"model"
);
String
model
=
StringUtil
.
getInfo
(
search
,
"model"
);
String
color
=
StringUtil
.
getInfo
(
search
,
"color"
);
String
weight
=
StringUtil
.
getInfo
(
search
,
"weight"
);
String
expiryNum
=
StringUtil
.
getInfo
(
search
,
"expiryNum"
);
String
enableSerialNumber
=
StringUtil
.
getInfo
(
search
,
"enableSerialNumber"
);
String
enableBatchNumber
=
StringUtil
.
getInfo
(
search
,
"enableBatchNumber"
);
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
String
mpList
=
StringUtil
.
getInfo
(
search
,
"mpList"
);
String
mpList
=
StringUtil
.
getInfo
(
search
,
"mpList"
);
return
materialService
.
select
(
barCode
,
name
,
standard
,
model
,
categoryId
,
mpList
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
return
materialService
.
select
(
barCode
,
name
,
standard
,
model
,
color
,
weight
,
expiryNum
,
enableSerialNumber
,
enableBatchNumber
,
remark
,
categoryId
,
mpList
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
}
}
@Override
@Override
...
@@ -50,8 +57,15 @@ public class MaterialComponent implements ICommonQuery {
...
@@ -50,8 +57,15 @@ public class MaterialComponent implements ICommonQuery {
String
name
=
StringUtil
.
getInfo
(
search
,
"name"
);
String
name
=
StringUtil
.
getInfo
(
search
,
"name"
);
String
standard
=
StringUtil
.
getInfo
(
search
,
"standard"
);
String
standard
=
StringUtil
.
getInfo
(
search
,
"standard"
);
String
model
=
StringUtil
.
getInfo
(
search
,
"model"
);
String
model
=
StringUtil
.
getInfo
(
search
,
"model"
);
String
color
=
StringUtil
.
getInfo
(
search
,
"color"
);
String
weight
=
StringUtil
.
getInfo
(
search
,
"weight"
);
String
expiryNum
=
StringUtil
.
getInfo
(
search
,
"expiryNum"
);
String
enableSerialNumber
=
StringUtil
.
getInfo
(
search
,
"enableSerialNumber"
);
String
enableBatchNumber
=
StringUtil
.
getInfo
(
search
,
"enableBatchNumber"
);
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
String
mpList
=
StringUtil
.
getInfo
(
search
,
"mpList"
);
String
mpList
=
StringUtil
.
getInfo
(
search
,
"mpList"
);
return
materialService
.
countMaterial
(
barCode
,
name
,
standard
,
model
,
categoryId
,
mpList
);
return
materialService
.
countMaterial
(
barCode
,
name
,
standard
,
model
,
color
,
weight
,
expiryNum
,
enableSerialNumber
,
enableBatchNumber
,
remark
,
categoryId
,
mpList
);
}
}
@Override
@Override
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java
View file @
b8fb7c7a
...
@@ -106,7 +106,9 @@ public class MaterialService {
...
@@ -106,7 +106,9 @@ public class MaterialService {
return
list
;
return
list
;
}
}
public
List
<
MaterialVo4Unit
>
select
(
String
barCode
,
String
name
,
String
standard
,
String
model
,
String
categoryId
,
String
mpList
,
int
offset
,
int
rows
)
public
List
<
MaterialVo4Unit
>
select
(
String
barCode
,
String
name
,
String
standard
,
String
model
,
String
color
,
String
weight
,
String
expiryNum
,
String
enableSerialNumber
,
String
enableBatchNumber
,
String
remark
,
String
categoryId
,
String
mpList
,
int
offset
,
int
rows
)
throws
Exception
{
throws
Exception
{
String
[]
mpArr
=
new
String
[]{};
String
[]
mpArr
=
new
String
[]{};
if
(
StringUtil
.
isNotEmpty
(
mpList
)){
if
(
StringUtil
.
isNotEmpty
(
mpList
)){
...
@@ -119,7 +121,8 @@ public class MaterialService {
...
@@ -119,7 +121,8 @@ public class MaterialService {
if
(
StringUtil
.
isNotEmpty
(
categoryId
)){
if
(
StringUtil
.
isNotEmpty
(
categoryId
)){
idList
=
getListByParentId
(
Long
.
parseLong
(
categoryId
));
idList
=
getListByParentId
(
Long
.
parseLong
(
categoryId
));
}
}
list
=
materialMapperEx
.
selectByConditionMaterial
(
barCode
,
name
,
standard
,
model
,
idList
,
mpList
,
offset
,
rows
);
list
=
materialMapperEx
.
selectByConditionMaterial
(
barCode
,
name
,
standard
,
model
,
color
,
weight
,
expiryNum
,
enableSerialNumber
,
enableBatchNumber
,
remark
,
idList
,
mpList
,
offset
,
rows
);
if
(
null
!=
list
)
{
if
(
null
!=
list
)
{
for
(
MaterialVo4Unit
m
:
list
)
{
for
(
MaterialVo4Unit
m
:
list
)
{
//扩展信息
//扩展信息
...
@@ -149,14 +152,17 @@ public class MaterialService {
...
@@ -149,14 +152,17 @@ public class MaterialService {
return
resList
;
return
resList
;
}
}
public
Long
countMaterial
(
String
barCode
,
String
name
,
String
standard
,
String
model
,
String
categoryId
,
String
mpList
)
throws
Exception
{
public
Long
countMaterial
(
String
barCode
,
String
name
,
String
standard
,
String
model
,
String
color
,
String
weight
,
String
expiryNum
,
String
enableSerialNumber
,
String
enableBatchNumber
,
String
remark
,
String
categoryId
,
String
mpList
)
throws
Exception
{
Long
result
=
null
;
Long
result
=
null
;
try
{
try
{
List
<
Long
>
idList
=
new
ArrayList
<>();
List
<
Long
>
idList
=
new
ArrayList
<>();
if
(
StringUtil
.
isNotEmpty
(
categoryId
)){
if
(
StringUtil
.
isNotEmpty
(
categoryId
)){
idList
=
getListByParentId
(
Long
.
parseLong
(
categoryId
));
idList
=
getListByParentId
(
Long
.
parseLong
(
categoryId
));
}
}
result
=
materialMapperEx
.
countsByMaterial
(
barCode
,
name
,
standard
,
model
,
idList
,
mpList
);
result
=
materialMapperEx
.
countsByMaterial
(
barCode
,
name
,
standard
,
model
,
color
,
weight
,
expiryNum
,
enableSerialNumber
,
enableBatchNumber
,
remark
,
idList
,
mpList
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
JshException
.
readFail
(
logger
,
e
);
}
}
...
...
jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml
View file @
b8fb7c7a
...
@@ -39,22 +39,42 @@
...
@@ -39,22 +39,42 @@
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
where 1=1
where 1=1
and me.default_flag=1
and me.default_flag=1
<if
test=
"barCode != null"
>
<if
test=
"barCode != null
and barCode !=''
"
>
<bind
name=
"bindBarCode"
value=
"'%'+barCode+'%'"
/>
<bind
name=
"bindBarCode"
value=
"'%'+barCode+'%'"
/>
and me.bar_code like #{bindBarCode}
and me.bar_code like #{bindBarCode}
</if>
</if>
<if
test=
"name != null"
>
<if
test=
"name != null
and name !=''
"
>
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and m.name like #{bindName}
and m.name like #{bindName}
</if>
</if>
<if
test=
"standard != null"
>
<if
test=
"standard != null
and standard !=''
"
>
<bind
name=
"bindStandard"
value=
"'%'+standard+'%'"
/>
<bind
name=
"bindStandard"
value=
"'%'+standard+'%'"
/>
and m.standard like #{bindStandard}
and m.standard like #{bindStandard}
</if>
</if>
<if
test=
"model != null"
>
<if
test=
"model != null
and model !=''
"
>
<bind
name=
"bindModel"
value=
"'%'+model+'%'"
/>
<bind
name=
"bindModel"
value=
"'%'+model+'%'"
/>
and m.model like #{bindModel}
and m.model like #{bindModel}
</if>
</if>
<if
test=
"color != null and color !=''"
>
<bind
name=
"bindColor"
value=
"'%'+color+'%'"
/>
and m.color like #{bindColor}
</if>
<if
test=
"weight != null and weight !=''"
>
and m.weight = #{weight}
</if>
<if
test=
"expiryNum != null and expiryNum !=''"
>
and m.expiry_num = #{expiryNum}
</if>
<if
test=
"enableSerialNumber != null and enableSerialNumber !=''"
>
and m.enable_serial_number = #{enableSerialNumber}
</if>
<if
test=
"enableBatchNumber != null and enableBatchNumber !=''"
>
and m.enable_batch_number = #{enableBatchNumber}
</if>
<if
test=
"remark != null and remark !=''"
>
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and m.remark like #{bindRemark}
</if>
<if
test=
"idList.size()>0"
>
<if
test=
"idList.size()>0"
>
and m.category_id in
and m.category_id in
<foreach
collection=
"idList"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
<foreach
collection=
"idList"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
...
@@ -77,22 +97,42 @@
...
@@ -77,22 +97,42 @@
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
WHERE 1=1
WHERE 1=1
and me.default_flag=1
and me.default_flag=1
<if
test=
"barCode != null"
>
<if
test=
"barCode != null
and barCode !=''
"
>
<bind
name=
"bindBarCode"
value=
"'%'+barCode+'%'"
/>
<bind
name=
"bindBarCode"
value=
"'%'+barCode+'%'"
/>
and me.bar_code like #{bindBarCode}
and me.bar_code like #{bindBarCode}
</if>
</if>
<if
test=
"name != null"
>
<if
test=
"name != null
and name !=''
"
>
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and m.name like #{bindName}
and m.name like #{bindName}
</if>
</if>
<if
test=
"standard != null"
>
<if
test=
"standard != null
and standard !=''
"
>
<bind
name=
"bindStandard"
value=
"'%'+standard+'%'"
/>
<bind
name=
"bindStandard"
value=
"'%'+standard+'%'"
/>
and m.standard like #{bindStandard}
and m.standard like #{bindStandard}
</if>
</if>
<if
test=
"model != null"
>
<if
test=
"model != null
and model !=''
"
>
<bind
name=
"bindModel"
value=
"'%'+model+'%'"
/>
<bind
name=
"bindModel"
value=
"'%'+model+'%'"
/>
and m.model like #{bindModel}
and m.model like #{bindModel}
</if>
</if>
<if
test=
"color != null and color !=''"
>
<bind
name=
"bindColor"
value=
"'%'+color+'%'"
/>
and m.color like #{bindColor}
</if>
<if
test=
"weight != null and weight !=''"
>
and m.weight = #{weight}
</if>
<if
test=
"expiryNum != null and expiryNum !=''"
>
and m.expiry_num = #{expiryNum}
</if>
<if
test=
"enableSerialNumber != null and enableSerialNumber !=''"
>
and m.enable_serial_number = #{enableSerialNumber}
</if>
<if
test=
"enableBatchNumber != null and enableBatchNumber !=''"
>
and m.enable_batch_number = #{enableBatchNumber}
</if>
<if
test=
"remark != null and remark !=''"
>
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and m.remark like #{bindRemark}
</if>
<if
test=
"idList.size()>0"
>
<if
test=
"idList.size()>0"
>
and m.category_id in
and m.category_id in
<foreach
collection=
"idList"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
<foreach
collection=
"idList"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
...
...
Write
Preview
Supports
Markdown
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