| | |
| | | import com.yeshi.buwan.service.inter.live.TVLiveCategoryService; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<TVLiveCategory> list(String detailSystemId, String nameKey, int page, int pageSize) { |
| | | public List<TVLiveCategory> list(String detailSystemId, String systemId, String nameKey, int page, int pageSize) { |
| | | if (detailSystemId != null) { |
| | | List<SuperTVLiveCategory> superTVLiveCategoryList = superTVLiveCategoryDao.listByDetailSystemId(detailSystemId, page, pageSize); |
| | | List<SuperTVLiveCategory> superTVLiveCategoryList = superTVLiveCategoryDao.listByDetailSystemId(detailSystemId, (page - 1) * pageSize, pageSize); |
| | | if (superTVLiveCategoryList == null || superTVLiveCategoryList.size() == 0) |
| | | return null; |
| | | List<String> cids = new ArrayList<>(); |
| | |
| | | return resultList; |
| | | } else { |
| | | TVLiveCategoryDao.DaoQuery daoQuery = new TVLiveCategoryDao.DaoQuery(); |
| | | daoQuery.systemId = systemId; |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | daoQuery.name = nameKey; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public long count(String detailSystemId, String nameKey) { |
| | | public long count(String detailSystemId, String systemId, String nameKey) { |
| | | if (detailSystemId != null) { |
| | | return superTVLiveCategoryDao.countByDetailSystemId(detailSystemId); |
| | | } else { |
| | | TVLiveCategoryDao.DaoQuery daoQuery = new TVLiveCategoryDao.DaoQuery(); |
| | | daoQuery.name = nameKey; |
| | | daoQuery.systemId = systemId; |
| | | return tvLiveCategoryDao.count(daoQuery); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<TVLiveCategory> listByIds(List<String> idList) { |
| | | Criteria[] ors = new Criteria[idList.size()]; |
| | | for (int i = 0; i < idList.size(); i++) { |
| | | ors[i] = Criteria.where("_id").is(idList.get(i)); |
| | | } |
| | | Query query = new Query(); |
| | | query.addCriteria(new Criteria().orOperator(ors)); |
| | | return tvLiveCategoryDao.findList(query); |
| | | } |
| | | |
| | | @Override |
| | | public List<SuperTVLiveCategory> listSuper(String detailSystemId, int page, int pageSize) { |
| | | |
| | | return superTVLiveCategoryDao.listByDetailSystemId(detailSystemId, (page - 1) * pageSize, pageSize); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (sc != null) |
| | | deleteSuperCategory(sc.getId()); |
| | | } |
| | | |
| | | @Override |
| | | public List<SuperTVLiveCategory> listSuper(String cid) { |
| | | return superTVLiveCategoryDao.listByCid(cid); |
| | | } |
| | | |
| | | @Override |
| | | public TVLiveCategory selectCategoryBuPrimaryKey(String id) { |
| | | return tvLiveCategoryDao.get(id); |
| | | } |
| | | |
| | | |
| | | } |