mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 10:16:38 +08:00
adding productsearchTag select
This commit is contained in:
parent
3cde853f9e
commit
6060715361
@ -72,34 +72,49 @@ public class GoodController {
|
||||
int count = 0;
|
||||
String categoryName = "";
|
||||
for (String categoryKey : paramMap.keySet()) {
|
||||
switch (categoryKey) {
|
||||
case "categoryName":
|
||||
categoryName = "专区";
|
||||
break;
|
||||
case "tagFunction":
|
||||
categoryName = "功能";
|
||||
break;
|
||||
case "tagUsedAge":
|
||||
categoryName = "年龄";
|
||||
break;
|
||||
case "tagBreed":
|
||||
categoryName = "品种";
|
||||
break;
|
||||
if(categoryKey == "categoryName" || categoryKey == "tagFunction" || categoryKey == "tagUsedAge" || categoryKey == "tagBreed") {
|
||||
switch (categoryKey) {
|
||||
case "categoryName":
|
||||
categoryName = "专区";
|
||||
break;
|
||||
case "tagFunction":
|
||||
categoryName = "功能";
|
||||
break;
|
||||
case "tagUsedAge":
|
||||
categoryName = "年龄";
|
||||
break;
|
||||
case "tagBreed":
|
||||
categoryName = "品种";
|
||||
break;
|
||||
}
|
||||
brandNameList.add(categoryName);
|
||||
count++;
|
||||
for (String tagName : paramMap.get(categoryKey).split(",")) {
|
||||
tagNameList.add(tagName);
|
||||
}
|
||||
}
|
||||
brandNameList.add(categoryName);
|
||||
count ++ ;
|
||||
for(String tagName : paramMap.get(categoryKey).split(",")){
|
||||
tagNameList.add(tagName);
|
||||
}
|
||||
}
|
||||
List<ProductSearchTagEntity> productSearchTagList = productSearchTagService.findAllByCondition(brandNameList,productQueryEntity.getPetType(),tagNameList,productQueryEntity.getTagStatus());
|
||||
List<String> tagCodeList = new ArrayList<>();
|
||||
for (ProductSearchTagEntity productSearchTagEntity:productSearchTagList){
|
||||
tagCodeList.add(productSearchTagEntity.getTagCode());
|
||||
if(count > 0) {
|
||||
List<ProductSearchTagEntity> productSearchTagList = productSearchTagService.findAllByCondition(brandNameList, productQueryEntity.getPetType(), tagNameList, productQueryEntity.getTagStatus());
|
||||
List<String> tagCodeList = new ArrayList<>();
|
||||
for (ProductSearchTagEntity productSearchTagEntity : productSearchTagList) {
|
||||
tagCodeList.add(productSearchTagEntity.getTagCode());
|
||||
}
|
||||
String tagCode = String.join(",", tagCodeList);
|
||||
productQueryEntity.setTags(tagCode);
|
||||
}
|
||||
String tagCode = String.join(",",tagCodeList);
|
||||
productQueryEntity.setTags(tagCode);
|
||||
productQueryEntity.setCount(StringUtil.toString(count));
|
||||
if(productQueryEntity.getTagStatus() != null && productQueryEntity.getTagStatus() != "") {
|
||||
if (productQueryEntity.getTagStatus().equals("1") || productQueryEntity.getTagStatus().equals("0")) {
|
||||
productQueryEntity.setCount("4");
|
||||
}else{
|
||||
productQueryEntity.setCount("1");
|
||||
}
|
||||
}else{
|
||||
productQueryEntity.setCount(StringUtil.toString(count));
|
||||
}
|
||||
|
||||
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
String result = goodService.brandQuery(productQueryEntity);
|
||||
long acceptTime = System.currentTimeMillis() ;
|
||||
|
@ -40,11 +40,12 @@ public class GoodService {
|
||||
|
||||
public String brandQuery(ProductQueryEntity productQueryEntity) throws Exception {
|
||||
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(productQueryEntity);
|
||||
paramMap.remove("petType");
|
||||
// paramMap.remove("petType");
|
||||
paramMap.remove("categoryName");
|
||||
paramMap.remove("tagUsedAge");
|
||||
paramMap.remove("tagFunction");
|
||||
paramMap.remove("tagBreed");
|
||||
paramMap.remove("tagStatus");
|
||||
MapRemoveNullUtil.removeNullEntry(paramMap);
|
||||
paramMap.put("secret","H5@2021");
|
||||
paramMap.put("channelId","15");
|
||||
|
@ -62,6 +62,6 @@ public class MemberAddressUpdateEntity {
|
||||
/**
|
||||
* 是否默认地址
|
||||
*/
|
||||
private boolean isDefault;
|
||||
private String isDefault;
|
||||
|
||||
}
|
||||
|
@ -24,11 +24,11 @@
|
||||
#{tagName}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="tagStatus != null and tagStatus == '1'">
|
||||
OR tagName not like '%湿粮%'
|
||||
<if test="tagStatus != null and tagStatus == 1">
|
||||
AND tag_name not like '%湿粮%'
|
||||
</if>
|
||||
<if test="tagStatus != null and tagStatus == '2'">
|
||||
OR tagName like '%湿粮%'
|
||||
<if test="tagStatus != null and tagStatus == 2">
|
||||
AND tag_name like '%湿粮%'
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user