|
@@ -0,0 +1,55 @@
|
|
|
|
|
+package com.happy.service.impl;
|
|
|
|
|
+
|
|
|
|
|
+import com.happy.Model.HotelDict;
|
|
|
|
|
+import com.happy.dao.HotelDictDao;
|
|
|
|
|
+import com.happy.dto.IPage;
|
|
|
|
|
+import com.happy.service.HotelDictService;
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
+
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+@Service("HotelDictService")
|
|
|
|
|
+public class HotelDictImplService implements HotelDictService {
|
|
|
|
|
+
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ public HotelDictDao hotelDictDao;
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int insertHotelDict(HotelDict hotelDict) {
|
|
|
|
|
+ return hotelDictDao.insertHotelDict(hotelDict);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int updateHotelDict(HotelDict hotelDict) {
|
|
|
|
|
+ return hotelDictDao.updateHotelDict(hotelDict);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int delHotelDict(int id) {
|
|
|
|
|
+ return hotelDictDao.delHotelDict(id);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public HotelDict getById(int id) {
|
|
|
|
|
+ return hotelDictDao.getById(id);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public IPage<HotelDict> queryPage(String sqlx, int page, int rows) {
|
|
|
|
|
+ IPage<HotelDict> iPage = new IPage();
|
|
|
|
|
+ List<HotelDict> hotelDictList = hotelDictDao.queryPage(sqlx,page,rows);
|
|
|
|
|
+ int total = hotelDictDao.queryTotal(sqlx);
|
|
|
|
|
+ iPage.setPageList(hotelDictList);
|
|
|
|
|
+ iPage.setPage(page);
|
|
|
|
|
+ iPage.setTotalPage( (int)Math.ceil((double)total/rows));
|
|
|
|
|
+ iPage.setRows(rows);
|
|
|
|
|
+ iPage.setTotal(total);
|
|
|
|
|
+ return iPage;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<HotelDict> queryList(String sqlx) {
|
|
|
|
|
+ return hotelDictDao.queryList(sqlx);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|