| | |
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class SuperHotSearchSerivceImpl implements SuperHotSearchService {
|
| | |
| | | strat, count, new Serializable[] { id, key });
|
| | |
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | @SuppressWarnings({ "unchecked", "rawtypes" })
|
| | | public List<SuperHotSearch> listSuperHotSearch(List<Long> list) {
|
| | | |
| | | List<SuperHotSearch> listObj = (List<SuperHotSearch>) superHotSearchDao.excute(new HibernateCallback<List<SuperHotSearch>>() {
|
| | | public List<SuperHotSearch> doInHibernate(Session session) throws HibernateException {
|
| | | Query query = session.createQuery("from SuperHotSearch srs where srs.hotSearch.id in (:array)");
|
| | | query.setParameterList("array",list); |
| | | return query.list();
|
| | | }
|
| | | });
|
| | | |
| | | return listObj;
|
| | | }
|
| | | |
| | | |
| | | public Integer deleteSuperHotSearch(final long hsid, final String platform, final String packageName) {
|
| | | return (Integer) superHotSearchDao.excute(new HibernateCallback<Integer>() {
|
| | |
|
| | |
| | | return getSuperHotSearchBySystemId(id);
|
| | | }
|
| | |
|
| | | |
| | | @SuppressWarnings({ "unchecked", "rawtypes" })
|
| | | @Override
|
| | | public List<SuperHotSearch> getHotSearchSystem(Long id, Long systemId) {
|
| | | |
| | | List<SuperHotSearch> listObj = (List<SuperHotSearch>) superHotSearchDao.excute(new HibernateCallback<List<SuperHotSearch>>() {
|
| | | public List<SuperHotSearch> doInHibernate(Session session) throws HibernateException {
|
| | | |
| | | Query query = session.createQuery("from SuperHotSearch shs " + " where shs.hotSearch.id=? and shs.system.id=?");
|
| | | query.setLong(0, id);
|
| | | query.setLong(1,systemId);
|
| | | |
| | | return query.list();
|
| | | }
|
| | | });
|
| | | |
| | | return listObj;
|
| | | }
|
| | | |
| | | @Override
|
| | | public Integer deleteSuper(Long id, Long systemId) {
|
| | | return (Integer) superHotSearchDao.excute(new HibernateCallback<Integer>() {
|
| | | public Integer doInHibernate(Session session) throws HibernateException {
|
| | | Transaction transaction = session.beginTransaction();
|
| | | Query query = session
|
| | | .createQuery("delete SuperHotSearch shs " + " where shs.hotSearch.id=? and shs.system.id=?");
|
| | | query.setLong(0, id);
|
| | | query.setLong(1, systemId);
|
| | | int i = query.executeUpdate();
|
| | | transaction.commit();
|
| | | return i;
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | @Override
|
| | | public void addSuper(Long id, System system) {
|
| | | SuperHotSearch superHotSearch = new SuperHotSearch();
|
| | | HotSearch hotSearch = new HotSearch();
|
| | | hotSearch.setId(id);
|
| | | superHotSearch.setHotSearch(hotSearch);
|
| | | superHotSearch.setSystem(system);
|
| | | superHotSearchDao.create(superHotSearch);
|
| | | }
|
| | | }
|