|
@@ -80,7 +80,7 @@ public class HouseNumberImplDao implements HouseNumberDao {
|
|
|
public List<HouseNumber> queryHouseStatus(Booking book) {
|
|
public List<HouseNumber> queryHouseStatus(Booking book) {
|
|
|
String sql = "select `id`,`house_id`,`number_name`,`create_id`,`create_date`,`modify_date`,IF(b.number_id is not null, 3, `status`) as `status` from \n" +
|
|
String sql = "select `id`,`house_id`,`number_name`,`create_id`,`create_date`,`modify_date`,IF(b.number_id is not null, 3, `status`) as `status` from \n" +
|
|
|
"(select * from house_number where house_id = :house_id and status != 0) a\n" +
|
|
"(select * from house_number where house_id = :house_id and status != 0) a\n" +
|
|
|
- "left join (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 group by number_id) b on a.id = b.number_id";
|
|
|
|
|
|
|
+ "inner join (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 group by number_id) b on a.id = b.number_id";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
sps.addValue("house_id", book.getHouseId());
|
|
sps.addValue("house_id", book.getHouseId());
|
|
|
sps.addValue("booking_id", book.getId());
|
|
sps.addValue("booking_id", book.getId());
|