sql多參問題解決

這不是一個名字發表於2020-11-13

1、url:

var url = "/cul/trav/trav/getAll?chineseCulturalStatus=--&chineseCulturalStatus=待稽核&chineseCulturalStatus=已下架&chineseCulturalStatus=展示中";

2、controller

public ResponseData getAllTravel(@RequestParam(value = "chineseCulturalStatus")List chineseCulturalStatus){

3、service:

List<ChineseCulturalDO> getTravelList(List<String> chineseCulturalStatus);

實現類:

@Override
public List<ChineseCulturalDO> getTravelList(List<String> chineseCulturalStatus) {
    List<ChineseCulturalDO> chineseCulturalDOList = new ArrayList<>();
    for (String culturalStatus : chineseCulturalStatus) {
        chineseCulturalDOList.addAll(chineseCulturalDOMapper.selectChineseCulturalList("健康旅遊資訊", culturalStatus));
    }
    return chineseCulturalDOList;
}

 

相關文章