|
|
@@ -96,6 +96,31 @@ public class HouseNumberImplDao implements HouseNumberDao {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * »ñÈ¡Èëס·¿¼ä
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<HouseNumber> queryCheckRoom(Booking book) {
|
|
|
+ String sql = "select `id`,`house_id`,`number_name`,`create_id`,`create_date`,`modify_date`from\n" +
|
|
|
+ "(select * from house_number where house_id = :house_id and status != 0) a\n" +
|
|
|
+ "where not exists\n" +
|
|
|
+ "(select number_id from house_number_status where DATE_FORMAT(set_date,'%Y-%m-%d') >= :order_start_time and DATE_FORMAT(set_date,'%Y-%m-%d') <= :order_end_time and booking_id != :booking_id and `status` >1 and number_id = a.id group by number_id)";
|
|
|
+ MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
+ sps.addValue("house_id", book.getHouseId());
|
|
|
+ sps.addValue("booking_id", book.getId());
|
|
|
+ sps.addValue("order_start_time", book.getOrderStartTime().substring(0, 10));
|
|
|
+ sps.addValue("order_end_time", book.getOrderEndTime().substring(0, 10));
|
|
|
+ List<HouseNumber> list = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ list = namedParameterJdbcTemplate.query(sql, sps, new BeanPropertyRowMapper<>(HouseNumber.class));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ if (list != null && list.size() > 0) return list;
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public List<HouseNumberDto> queryListOne(HouseNumberDto houseNumberDto) {
|
|
|
final String SQL_HEAD = "select id, house_id, number_name, create_id, create_date, modify_date, status, house_status from house_number where status in (1, 2) and house_id in (:houseIdList)";
|