| | |
| | | PageHelper.startPage(xcxGoodsListDto.getPageNo(), xcxGoodsListDto.getPageSize()); |
| | | List<XcxGoodsListVo> data = scoreGoodsMapper.selectXcxGoodsList(xcxGoodsListDto); |
| | | if(StrUtil.isNotEmpty(xcxGoodsListDto.getName())){ |
| | | ScoreGoodsSearch scoreGoodsSearch = new ScoreGoodsSearch(); |
| | | scoreGoodsSearch.setUserId(xcxGoodsListDto.getUserId()); |
| | | scoreGoodsSearch.setContents(xcxGoodsListDto.getName()); |
| | | scoreGoodsSearch.setCreatedTime(new Date()); |
| | | scoreGoodsSearchMapper.insert(scoreGoodsSearch); |
| | | Example exampleSearch = new Example(ScoreGoodsSearch.class); |
| | | Example.Criteria criteriaSearch = exampleSearch.createCriteria(); |
| | | criteriaSearch.andEqualTo("contents",xcxGoodsListDto.getName()); |
| | | criteriaSearch.andEqualTo("userId",xcxGoodsListDto.getUserId()); |
| | | List<ScoreGoodsSearch> scoreGoodsSearches = scoreGoodsSearchMapper.selectByExample(exampleSearch); |
| | | if(CollUtil.isNotEmpty(scoreGoodsSearches)){ |
| | | ScoreGoodsSearch scoreGoodsSearch = new ScoreGoodsSearch(); |
| | | scoreGoodsSearch.setUserId(xcxGoodsListDto.getUserId()); |
| | | scoreGoodsSearch.setContents(xcxGoodsListDto.getName()); |
| | | scoreGoodsSearch.setCreatedTime(new Date()); |
| | | scoreGoodsSearchMapper.insert(scoreGoodsSearch); |
| | | } |
| | | } |
| | | return new PageInfo<>(data); |
| | | } |