| | |
| | | package com.yeshi.buwan.service.imp; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.buwan.dao.system.DetailSystemDao; |
| | | import com.yeshi.buwan.dao.system.SystemInfoDao; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.special.Special; |
| | | import com.yeshi.buwan.domain.special.SuperSpecial; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import org.apache.log4j.Logger; |
| | | import org.hibernate.HibernateException; |
| | | import org.hibernate.Session; |
| | |
| | | import org.springframework.orm.hibernate4.HibernateCallback; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.buwan.dao.DetailSystemDao; |
| | | import com.yeshi.buwan.dao.SystemInfoDao; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeAd; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HotSearch; |
| | | import com.yeshi.buwan.domain.HotStar; |
| | | import com.yeshi.buwan.domain.HotVideoType; |
| | | import com.yeshi.buwan.domain.ShareContent; |
| | | import com.yeshi.buwan.domain.SuperHomeAd; |
| | | import com.yeshi.buwan.domain.SuperHomeNotice; |
| | | import com.yeshi.buwan.domain.SuperHomeType; |
| | | import com.yeshi.buwan.domain.SuperHotSearch; |
| | | import com.yeshi.buwan.domain.SuperHotStar; |
| | | import com.yeshi.buwan.domain.SuperHotType; |
| | | import com.yeshi.buwan.domain.SuperRecommendAd; |
| | | import com.yeshi.buwan.domain.SuperUserBanner; |
| | | import com.yeshi.buwan.domain.SuperVideoType; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.UserBanner; |
| | | import com.yeshi.buwan.domain.VideoBanQuan; |
| | | import com.yeshi.buwan.domain.VideoBanQuanVideo; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | | import com.yeshi.buwan.domain.special.Special; |
| | | import com.yeshi.buwan.domain.special.SuperSpecial; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 系统分类服务 |
| | |
| | | @Resource |
| | | private SpecialService specialService; |
| | | |
| | | public ClassService getClassService() { |
| | | return classService; |
| | | } |
| | | |
| | | public void setClassService(ClassService classService) { |
| | | this.classService = classService; |
| | | } |
| | | |
| | | public StarService getStarService() { |
| | | return starService; |
| | | } |
| | | |
| | | public void setStarService(StarService starService) { |
| | | this.starService = starService; |
| | | } |
| | | |
| | | public SpecialService getSpecialService() { |
| | | return specialService; |
| | | } |
| | | |
| | | public void setSpecialService(SpecialService specialService) { |
| | | this.specialService = specialService; |
| | | } |
| | | |
| | | public SystemInfoDao getSystemInfoDao() { |
| | | return systemInfoDao; |
| | | } |
| | | |
| | | public void setSystemInfoDao(SystemInfoDao systemInfoDao) { |
| | | this.systemInfoDao = systemInfoDao; |
| | | } |
| | | |
| | | public DetailSystemDao getDetailSystemDao() { |
| | | return detailSystemDao; |
| | | } |
| | | |
| | | public void setDetailSystemDao(DetailSystemDao detailSystemDao) { |
| | | this.detailSystemDao = detailSystemDao; |
| | | } |
| | | |
| | | public List<DetailSystem> getDetailSystemList() { |
| | | List<DetailSystem> list = detailSystemDao.list("from DetailSystem"); |
| | | public List<DetailSystem> getDetailSystemList(String systemId) { |
| | | List<DetailSystem> list = detailSystemDao.list("from DetailSystem ds where ds.system.id=?", systemId); |
| | | return list; |
| | | } |
| | | |
| | | public List<DetailSystem> getDetailSystemList(String key, int pageIndex) { |
| | | public List<DetailSystem> getDetailSystemList(String key, String systemId, int pageIndex) { |
| | | List<DetailSystem> list = detailSystemDao.list( |
| | | "from DetailSystem ds where ds.appName like ? order by ds.createtime desc", |
| | | (pageIndex - 1) * Constant.pageCount, Constant.pageCount, new String[]{"%" + key + "%"}); |
| | | "from DetailSystem ds where ds.appName like ? and ds.system.id=? order by ds.createtime desc", |
| | | (pageIndex - 1) * Constant.pageCount, Constant.pageCount, new String[]{"%" + key + "%", systemId}); |
| | | return list; |
| | | } |
| | | |
| | | public long getDetailSystemListCount(String key) { |
| | | return detailSystemDao.getCount("select count(*) from DetailSystem d where d.appName like ?", |
| | | new String[]{"%" + key + "%"}); |
| | | public long getDetailSystemListCount(String key, String systemId) { |
| | | return detailSystemDao.getCount("select count(*) from DetailSystem d where d.appName like ? and d.system.id=?", |
| | | new String[]{"%" + key + "%", systemId}); |
| | | } |
| | | |
| | | @Cacheable(value = "homeCache", key = "'getDetailSystemByPackage'+'-'+#packageName") |