| | |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.SearchHistoryMapper; |
| | | import com.doumee.dao.business.model.SearchHistory; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.yaml.snakeyaml.scanner.Constant; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | QueryWrapper<SearchHistory> wrapper = new QueryWrapper<>(searchHistory); |
| | | return searchHistoryMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<SearchHistory> findListByType(Integer type,Integer memberId) { |
| | | return searchHistoryMapper.selectList(new QueryWrapper<SearchHistory>().lambda() |
| | | .eq(SearchHistory::getIsdeleted, Constants.ZERO) |
| | | .eq(SearchHistory::getMemberId,memberId) |
| | | .eq(SearchHistory::getType,type) |
| | | .last("limit 10") |
| | | .orderByDesc(SearchHistory::getId) |
| | | ); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void cleanHistory(Integer type,Integer memberId) { |
| | | searchHistoryMapper.update(new UpdateWrapper<SearchHistory>().lambda() |
| | | .set(SearchHistory::getIsdeleted, Constants.ONE) |
| | | .eq(SearchHistory::getMemberId,memberId) |
| | | .eq(SearchHistory::getType,type) |
| | | ); |
| | | } |
| | | |
| | | } |