|
|
package com.yoho.search.consumer.index.fullbuild.tbl;
|
|
|
|
|
|
import com.yoho.search.consumer.index.fullbuild.IIndexBuilder;
|
|
|
import com.yoho.search.dal.TblBrandMapper;
|
|
|
import com.yoho.search.dal.model.TblBrand;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 全球购品牌索引
|
|
|
*
|
|
|
* @author wangnan
|
|
|
* @version 2018/11/13
|
|
|
*/
|
|
|
@Component
|
|
|
public class TblBrandIndexBuilder extends IIndexBuilder {
|
|
|
|
|
|
@Autowired
|
|
|
private TblBrandMapper tblBrandMapper;
|
|
|
|
|
|
@Override
|
|
|
public int getTotalCount() throws Exception {
|
|
|
return tblBrandMapper.selectCount();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<?> getPageLists(int offset, int limit) throws Exception {
|
|
|
List<TblBrand> tblBrandList = tblBrandMapper.selectBrandPageList(offset, limit);
|
|
|
if (CollectionUtils.isEmpty(tblBrandList)) {
|
|
|
return new ArrayList<>(0);
|
|
|
}
|
|
|
return tblBrandList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public String getId(Object object) {
|
|
|
return ((TblBrand) object).getBrandId().toString();
|
|
|
}
|
|
|
} |
...
|
...
|
|