mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-03 02:36:39 +08:00
commit
2741a41024
@ -70,27 +70,27 @@ public class GoodController {
|
|||||||
List<String> brandNameList = new ArrayList<>();
|
List<String> brandNameList = new ArrayList<>();
|
||||||
List<String> tagNameList = new ArrayList<>();
|
List<String> tagNameList = new ArrayList<>();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
String categoryName = "";
|
|
||||||
for (String categoryKey : paramMap.keySet()) {
|
for (String categoryKey : paramMap.keySet()) {
|
||||||
if(categoryKey == "categoryName" || categoryKey == "tagFunction" || categoryKey == "tagUsedAge" || categoryKey == "tagBreed") {
|
if(categoryKey == "categoryName" || categoryKey == "tagFunction" || categoryKey == "tagUsedAge" || categoryKey == "tagBreed" || categoryKey == "tagStatus") {
|
||||||
switch (categoryKey) {
|
switch (categoryKey) {
|
||||||
case "categoryName":
|
case "categoryName":
|
||||||
categoryName = "专区";
|
brandNameList.add("专区");
|
||||||
break;
|
break;
|
||||||
case "tagFunction":
|
case "tagFunction":
|
||||||
categoryName = "功能";
|
brandNameList.add("功能");
|
||||||
break;
|
break;
|
||||||
case "tagUsedAge":
|
case "tagUsedAge":
|
||||||
categoryName = "年龄";
|
brandNameList.add("年龄");
|
||||||
break;
|
break;
|
||||||
case "tagBreed":
|
case "tagBreed":
|
||||||
categoryName = "品种";
|
brandNameList.add("品种");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
brandNameList.add(categoryName);
|
|
||||||
count++;
|
count++;
|
||||||
for (String tagName : paramMap.get(categoryKey).split(",")) {
|
for (String tagName : paramMap.get(categoryKey).split(",")) {
|
||||||
tagNameList.add(tagName);
|
if (categoryKey != "tagStatus") {
|
||||||
|
tagNameList.add(tagName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -103,14 +103,19 @@ public class GoodController {
|
|||||||
String tagCode = String.join(",", tagCodeList);
|
String tagCode = String.join(",", tagCodeList);
|
||||||
productQueryEntity.setTags(tagCode);
|
productQueryEntity.setTags(tagCode);
|
||||||
}
|
}
|
||||||
if(productQueryEntity.getTagStatus() != null && productQueryEntity.getTagStatus() != "") {
|
if(brandNameList.size() == 0 && productQueryEntity.getTagStatus() != null && productQueryEntity.getTagStatus() != "") {
|
||||||
if (productQueryEntity.getTagStatus().equals("1") || productQueryEntity.getTagStatus().equals("0")) {
|
|
||||||
productQueryEntity.setCount("4");
|
|
||||||
}else{
|
|
||||||
productQueryEntity.setCount("1");
|
productQueryEntity.setCount("1");
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
productQueryEntity.setCount(StringUtil.toString(count));
|
if (productQueryEntity.getTagStatus() != null && productQueryEntity.getTagStatus() != "" && brandNameList.size() != 0) {
|
||||||
|
if(productQueryEntity.getCategoryName() != "" &&productQueryEntity.getCategoryName() != null) {
|
||||||
|
productQueryEntity.setCount(StringUtil.toString(count -1));
|
||||||
|
}else{
|
||||||
|
productQueryEntity.setCount(StringUtil.toString(count));
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
productQueryEntity.setCount(StringUtil.toString(count));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ public class GoodService {
|
|||||||
|
|
||||||
public String brandQuery(ProductQueryEntity productQueryEntity) throws Exception {
|
public String brandQuery(ProductQueryEntity productQueryEntity) throws Exception {
|
||||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(productQueryEntity);
|
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(productQueryEntity);
|
||||||
// paramMap.remove("petType");
|
|
||||||
paramMap.remove("categoryName");
|
paramMap.remove("categoryName");
|
||||||
paramMap.remove("tagUsedAge");
|
paramMap.remove("tagUsedAge");
|
||||||
paramMap.remove("tagFunction");
|
paramMap.remove("tagFunction");
|
||||||
|
@ -8,9 +8,6 @@
|
|||||||
<select id="findAllByCondition" resultMap="ProductSearchTagEntity">
|
<select id="findAllByCondition" resultMap="ProductSearchTagEntity">
|
||||||
select tag_code,brand_name,tag_name from t_royalcanin_productsearchtag WHERE
|
select tag_code,brand_name,tag_name from t_royalcanin_productsearchtag WHERE
|
||||||
is_delete = 0
|
is_delete = 0
|
||||||
<if test="petType != null and petType != ''">
|
|
||||||
AND pet_type = #{petType}
|
|
||||||
</if>
|
|
||||||
<if test="brandNameList != null and brandNameList.size > 0">
|
<if test="brandNameList != null and brandNameList.size > 0">
|
||||||
AND brand_name in
|
AND brand_name in
|
||||||
<foreach collection="brandNameList" open="(" close=")" separator="," item="brandName">
|
<foreach collection="brandNameList" open="(" close=")" separator="," item="brandName">
|
||||||
@ -25,10 +22,13 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="tagStatus != null and tagStatus == 1">
|
<if test="tagStatus != null and tagStatus == 1">
|
||||||
AND tag_name not like '%湿粮%'
|
or brand_name in ( '专区' ) and tag_name not like '%湿粮%'
|
||||||
</if>
|
</if>
|
||||||
<if test="tagStatus != null and tagStatus == 2">
|
<if test="tagStatus != null and tagStatus == 2">
|
||||||
AND tag_name like '%湿粮%'
|
or brand_name in ( '专区' ) and tag_name like '%湿粮%'
|
||||||
|
</if>
|
||||||
|
<if test="petType != null and petType != ''">
|
||||||
|
AND pet_type = #{petType}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue
Block a user