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