|
|
@@ -35,9 +35,9 @@ public class HotelDictImplDao implements HotelDictDao {
|
|
|
sps.addValue("name",hotelDict.getName());
|
|
|
sps.addValue("file_url",hotelDict.getFileUrl());
|
|
|
sps.addValue("create_id",hotelDict.getCreateId());
|
|
|
- sps.addValue("create_date",hotelDict.getCreateDate());
|
|
|
+ sps.addValue("create_date",UUIDUtil.getNewDate());
|
|
|
sps.addValue("modify_date",hotelDict.getModifyDate());
|
|
|
- sps.addValue("status",hotelDict.getStatus());
|
|
|
+ sps.addValue("status",1);
|
|
|
if(hotelDict.getId()==null){
|
|
|
sps.addValue("id", UUIDUtil.generateID());
|
|
|
}
|
|
|
@@ -59,7 +59,7 @@ public class HotelDictImplDao implements HotelDictDao {
|
|
|
sps.addValue("name",hotelDict.getName());
|
|
|
sps.addValue("file_url",hotelDict.getFileUrl());
|
|
|
sps.addValue("create_id",hotelDict.getCreateId());
|
|
|
- sps.addValue("modify_date",hotelDict.getModifyDate());
|
|
|
+ sps.addValue("modify_date",UUIDUtil.getNewDate());
|
|
|
sps.addValue("status",hotelDict.getStatus());
|
|
|
sps.addValue("id", hotelDict.getId());
|
|
|
int num = 0;
|
|
|
@@ -74,7 +74,7 @@ public class HotelDictImplDao implements HotelDictDao {
|
|
|
|
|
|
@Override
|
|
|
public int delHotelDict(int id) {
|
|
|
- String sql = "DELETE FROM `hotel_dict` WHERE id = :id ";
|
|
|
+ String sql = "UPDATE `hotel_dict` SET status=0 WHERE id = :id ";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
sps.addValue("id",id);
|
|
|
int num = 0;
|
|
|
@@ -105,7 +105,7 @@ public class HotelDictImplDao implements HotelDictDao {
|
|
|
@Override
|
|
|
public List<HotelDict> queryPage(String sqlx, int page, int rows) {
|
|
|
int start = (page - 1) * rows;// 每页的起始下标
|
|
|
- String sql = "SELECT * FROM `hotel_dict` WHERE 1=1 "+sqlx+" ORDER BY id DESC limit :start,:rows ";
|
|
|
+ String sql = "SELECT * FROM `hotel_dict` WHERE status=1 "+sqlx+" ORDER BY id DESC limit :start,:rows ";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
sps.addValue("start", start);
|
|
|
sps.addValue("rows", rows);
|
|
|
@@ -117,14 +117,14 @@ public class HotelDictImplDao implements HotelDictDao {
|
|
|
|
|
|
@Override
|
|
|
public int queryTotal(String sqlx) {
|
|
|
- String sql = "SELECT count(*) FROM`hotel_dict` where 1=1 "+sqlx;
|
|
|
+ String sql = "SELECT count(*) FROM`hotel_dict` where status=1 "+sqlx;
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
return namedParameterJdbcTemplate.queryForInt(sql, sps);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<HotelDict> queryList(String sqlx) {
|
|
|
- String sql = "SELECT * FROM `hotel_dict` WHERE 1=1 "+sqlx;
|
|
|
+ String sql = "SELECT * FROM `hotel_dict` WHERE status=1 "+sqlx;
|
|
|
List<HotelDict> list = null;
|
|
|
try{
|
|
|
list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(HotelDict.class));
|