|
@@ -2,6 +2,7 @@ package com.happy.dao.impl;
|
|
|
|
|
|
|
|
import com.happy.Model.AdminManager;
|
|
import com.happy.Model.AdminManager;
|
|
|
import com.happy.Model.HotelDict;
|
|
import com.happy.Model.HotelDict;
|
|
|
|
|
+import com.happy.Model.HouseNumber;
|
|
|
import com.happy.Until.Func;
|
|
import com.happy.Until.Func;
|
|
|
import com.happy.Until.SqlUtil;
|
|
import com.happy.Until.SqlUtil;
|
|
|
import com.happy.Until.UUIDUtil;
|
|
import com.happy.Until.UUIDUtil;
|
|
@@ -11,9 +12,12 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.namedparam.EmptySqlParameterSource;
|
|
import org.springframework.jdbc.core.namedparam.EmptySqlParameterSource;
|
|
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
|
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
|
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
|
|
|
|
+import org.springframework.jdbc.core.namedparam.SqlParameterSource;
|
|
|
import org.springframework.stereotype.Repository;
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
|
|
@Repository("HotelDictDao")
|
|
@Repository("HotelDictDao")
|
|
|
public class HotelDictImplDao implements HotelDictDao {
|
|
public class HotelDictImplDao implements HotelDictDao {
|
|
@@ -155,6 +159,21 @@ public class HotelDictImplDao implements HotelDictDao {
|
|
|
return config;
|
|
return config;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int saveBacth(List<HotelDict> dicts) {
|
|
|
|
|
+ String sql = " update `hotel_dict` set name=:name,modify_date = :modify_date where id=:id ";
|
|
|
|
|
+ List<MapSqlParameterSource> houseNumberList = new ArrayList<>();
|
|
|
|
|
+ for (HotelDict h1 : dicts) {
|
|
|
|
|
+ MapSqlParameterSource mapSqlParameterSource = new MapSqlParameterSource();
|
|
|
|
|
+ mapSqlParameterSource.addValue("id", h1.getId());
|
|
|
|
|
+ mapSqlParameterSource.addValue("name", h1.getName());
|
|
|
|
|
+ mapSqlParameterSource.addValue("modify_date", UUIDUtil.getNewDate());
|
|
|
|
|
+ houseNumberList.add(mapSqlParameterSource);
|
|
|
|
|
+ }
|
|
|
|
|
+ int[] m = namedParameterJdbcTemplate.batchUpdate(sql, houseNumberList.toArray(new SqlParameterSource[0]));
|
|
|
|
|
+ return m.length;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public void appendValue(HotelDict hotelDict, StringBuffer stringBuffer, MapSqlParameterSource sps){
|
|
public void appendValue(HotelDict hotelDict, StringBuffer stringBuffer, MapSqlParameterSource sps){
|
|
|
if (!Func.checkNull(String.valueOf(hotelDict.getCode()))){
|
|
if (!Func.checkNull(String.valueOf(hotelDict.getCode()))){
|
|
|
stringBuffer.append(" code=:code ,");
|
|
stringBuffer.append(" code=:code ,");
|