@ -37,7 +37,6 @@ import java.time.format.DateTimeParseException;
import java.io.* ;
import javax.imageio.ImageIO ;
import javax.imageio.ImageWriteParam ;
import javax.imageio.ImageWriter ;
@ -100,7 +99,6 @@ public class BookingService {
ORDER BY id DESC
"" " ;
try {
Map < String , Object > result = new HashMap < > ( ) ;
@ -165,37 +163,37 @@ public class BookingService {
sql ,
Integer . class ,
today ,
buildingid
) ;
buildingid ) ;
return count ! = null & & count > 0 ;
}
/ *
public Boolean checkAvailabilityByBdate ( int bid , int cid , LocalDate Bdate , int scid , int noOfPerson , int slotId ) {
Map < String , Object > getcalendar = getCalendarBySlotId ( bid , cid , Bdate , slotId ) ;
Map < String , Object > capacity = getCapacity ( scid , cid ) ;
int capsint = Integer . parseInt ( capacity . get ( "limits" ) . toString ( ) ) ;
int capacityint = Integer . parseInt ( capacity . get ( "capacity" ) . toString ( ) ) ;
System . out . println ( "capsint: " + capsint ) ;
System . out . println ( "capacityint: " + capacityint ) ;
if ( capacityint < 1 ) {
return true ;
}
if ( ! getcalendar . isEmpty ( ) ) {
int count = Integer . parseInt ( getcalendar . get ( "filed" ) + "" ) + noOfPerson ;
System . out . println ( "count: " + count ) ;
if ( count > capacityint ) {
return true ;
}
return false ;
}
return false ;
}
* public Boolean checkAvailabilityByBdate ( int bid , int cid , LocalDate Bdate , int
* scid , int noOfPerson , int slotId ) {
*
* Map < String , Object > getcalendar = getCalendarBySlotId ( bid , cid , Bdate , slotId ) ;
* Map < String , Object > capacity = getCapacity ( scid , cid ) ;
*
* int capsint = Integer . parseInt ( capacity . get ( "limits" ) . toString ( ) ) ;
* int capacityint = Integer . parseInt ( capacity . get ( "capacity" ) . toString ( ) ) ;
*
* System . out . println ( "capsint: " + capsint ) ;
* System . out . println ( "capacityint: " + capacityint ) ;
* if ( capacityint < 1 ) {
* return true ;
* }
* if ( ! getcalendar . isEmpty ( ) ) {
* int count = Integer . parseInt ( getcalendar . get ( "filed" ) + "" ) + noOfPerson ;
* System . out . println ( "count: " + count ) ;
* if ( count > capacityint ) {
* return true ;
* }
*
* return false ;
* }
*
* return false ;
* }
* /
private int getacountfromtable ( int bid ) {
@ -222,7 +220,6 @@ public class BookingService {
int capsint = Integer . parseInt ( capacity . get ( "limits" ) . toString ( ) ) ;
int capacityint = Integer . parseInt ( capacity . get ( "capacity" ) . toString ( ) ) ;
System . out . println ( "capsint: " + capsint ) ;
System . out . println ( "capacityint: " + capacityint ) ;
if ( capacityint < 1 ) {
@ -257,16 +254,20 @@ public class BookingService {
return false ;
}
public Map < String , Object > getCapacity ( int sId , int catId ) {
System . out . println ( "sid" + sId ) ;
System . out . println ( "catId" + catId ) ;
String sql = "select limits, capacity from subcategory where scid = ? and cid = ?" ;
System . out . println ( "select limits, capacity from subcategory where scid = '" + sId + "' and cid = '" + catId + "'" ) ;
System . out . println (
"select limits, capacity from subcategory where scid = '" + sId + "' and cid = '" + catId + "'" ) ;
try {
return jdbcTemplate . queryForMap ( sql , sId , catId ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return Collections . singletonMap ( "error" , "An error occurred while getting capacity." ) ;
return Collections . singletonMap ( "error" ,
"An error occurred while getting capacity." ) ;
}
}
public Map < String , Object > getCalendarBySlotId ( int bid , int cid , LocalDate Bdate , int slotId ) {
@ -279,26 +280,27 @@ public class BookingService {
+ "group by bdate" ;
System . out . println ( "select sum(bcount) as filed, bdate "
+ "from calendar where bdate = '" + Bdate + "' and cid = " + cid + " and bid = " + bid + " and slotId IN (" + slotId + ",8,9) "
+ "from calendar where bdate = '" + Bdate + "' and cid = " + cid + " and bid = " + bid
+ " and slotId IN (" + slotId + ",8,9) "
+ "group by bdate" ) ;
}
else {
} else {
sql = "select sum(bcount) as filed, bdate "
+ "from calendar where (bdate = ? and cid = ? and bid = ?) or (0=?) "
+ "group by bdate" ;
System . out . println ( "select slotid, sum(bcount) as filed, bdate "
+ "from calendar where (bdate = '" + Bdate + "' and cid = " + cid + " and bid = " + bid + ") or (0=" + slotId + ") "
+ "from calendar where (bdate = '" + Bdate + "' and cid = " + cid + " and bid = " + bid
+ ") or (0=" + slotId + ") "
+ "group by bdate" ) ;
}
}
else {
} else {
sql = "select sum(bcount) as filed, bdate "
+ "from calendar where bdate = ? and cid = ? and bid = ? and slotId = ? "
+ "group by slotid, bdate" ;
System . out . println ( "select sum(bcount) as filed, bdate "
+ "from calendar where bdate = '" + Bdate + "' and cid = '" + cid + "' and bid = '" + bid + "' and slotId = '" + slotId + "' "
+ "from calendar where bdate = '" + Bdate + "' and cid = '" + cid + "' and bid = '" + bid
+ "' and slotId = '" + slotId + "' "
+ "group by bdate" ) ;
}
@ -318,10 +320,127 @@ public class BookingService {
return result . get ( 0 ) ; / / Return the first ( and expected only ) result
}
/ *
* public boolean checkbuildingbycat ( int cid , int bid , int subid ) {
* String sql =
* "select count(bid) as total from category where (cid = ? and bid = ?) AND (isactive=1 and isdelete=0)"
* ;
* try {
* Map < String , Object > result = jdbcTemplate . queryForMap ( sql , cid , bid ) ;
* return Integer . parseInt ( result . get ( "total" ) + "" ) > 0 ;
* } catch ( Exception e ) {
* e . printStackTrace ( ) ;
* return false ;
* }
* }
* /
public boolean checkCategoryAgainstSubCategory ( int cid , int bid , int subid ) {
String sql = "SELECT COUNT(*) " +
"FROM category c " +
"INNER JOIN subcategory sc ON sc.cid = c.cid " +
"WHERE c.cid = ? " +
"AND c.bid = ? " +
"AND sc.scid = ? " +
"AND c.isactive = 1 " +
"AND c.isdelete = 0 " +
"AND sc.isactive = 1 " +
"AND sc.isdelete = 0" ;
try {
Integer total = jdbcTemplate . queryForObject (
sql ,
Integer . class ,
cid ,
bid ,
subid ) ;
return total ! = null & & total > 0 ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return false ;
}
}
public boolean checkbuildingbycat ( int cid , int bid , int subid ) {
String sql = "SELECT COUNT(*) " +
"FROM subcategory sc " +
"JOIN category c ON c.cid = sc.cid " +
"WHERE sc.scid = ? " +
"AND c.cid = ? " +
"AND c.bid = ? " +
"AND sc.isactive = 1 " +
"AND sc.isdelete = 0 " +
"AND c.isactive = 1 " +
"AND c.isdelete = 0" ;
try {
Integer total = jdbcTemplate . queryForObject (
sql ,
Integer . class ,
subid ,
cid ,
bid ) ;
return total ! = null & & total > 0 ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return false ;
}
}
/ *
* public boolean checkbuildingbycat ( int cid , int bid , int subid ) {
*
* String sql = "SELECT COUNT(c.bid) " +
* "FROM category c " +
* "INNER JOIN subcategory sc ON sc.cid = c.cid " +
* "WHERE c.cid = ? " +
* "AND c.bid = ? " +
* "AND sc.scid = ? " +
* "AND c.isactive = 1 " +
* "AND c.isdelete = 0" ;
*
* try {
* Integer total = jdbcTemplate . queryForObject (
* sql ,
* Integer . class ,
* cid ,
* bid ,
* subid ) ;
*
* return total ! = null & & total > 0 ;
*
* } catch ( Exception e ) {
* e . printStackTrace ( ) ;
* return false ;
* }
* }
* /
/ *
* public boolean checkbuildingbycat ( int cid , int bid ) {
* String sql = "SELECT COUNT(bid) FROM category " +
* "WHERE cid = ? AND bid = ? AND isactive = 1 AND isdelete = 0" ;
*
* try {
* Integer total = jdbcTemplate . queryForObject ( sql , Integer . class , cid , bid ) ;
* return total ! = null & & total > 0 ;
* } catch ( Exception e ) {
* e . printStackTrace ( ) ;
* return false ;
* }
* }
* /
public Map < String , Object > saveTempBooking ( String userName , long userMobile ,
List < Integer > slots , LocalDate fromDate , LocalDate toDate ,
int noOfPeople , int catId , int buildId , int subId ) {
if ( ! checkbuildingbycat ( catId , buildId , subId ) ) {
System . out . println ( "checkbuildingbycat(catId, buildId)" + checkbuildingbycat ( catId , buildId , subId ) ) ;
throw new NoSlotAvailable ( "Selected building is not available for this category" ) ;
}
List < LocalDate > btnDates = getDatesBetween ( fromDate , toDate ) ;
double amount = 0 ;
@ -333,8 +452,7 @@ public class BookingService {
if ( amt ! = null & & ! amt . isEmpty ( ) ) {
if ( catId ! = 3 ) {
amount = amount + ( Double . parseDouble ( amt . get ( "amount" ) + "" ) * noOfPeople ) ;
}
else {
} else {
amount = amount + ( Double . parseDouble ( amt . get ( "amount" ) + "" ) * 1 ) ;
}
for ( LocalDate date : btnDates ) {
@ -376,7 +494,6 @@ public class BookingService {
int noOfPeople , int catId , int buildId , int subId , double amount ) {
/ / Join the slots with commas
String sqlQuery = "INSERT INTO temp_booking (user_name, mobile, slotids, from_date, to_date, no_of_person, amount, cid, bid, sid) "
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
@ -487,6 +604,12 @@ public class BookingService {
if ( affectedRows > 0 ) {
Number generatedId = keyHolder . getKey ( ) ;
bookingId = ( generatedId ! = null ) ? generatedId . intValue ( ) : 0 ;
/ / ak
Map < String , Object > buildingDetails = getBuildingDetails ( bid ) ;
System . out . println ( "buildingDetails :" + buildingDetails ) ;
String smsename = buildingDetails . get ( "smsename" ) . toString ( ) ;
/ / String smstname = buildingDetails . get ( "smstname" ) . toString ( ) ;
paymentService . updateBookingIdInPayment (
tempBooking . get ( "mobile" ) . toString ( ) ,
@ -498,10 +621,12 @@ public class BookingService {
tempBooking . get ( "slotIds" ) . toString ( ) ,
tempBooking . get ( "bid" ) . toString ( ) ,
tempBooking . get ( "cid" ) . toString ( ) ,
tempBooking . get ( "sid" ) . toString ( )
) ;
tempBooking . get ( "sid" ) . toString ( ) ) ;
sendMessage ( user_name , mobile , slotIds , from_date , to_date , no_of_person , amount , cid , bid , sid , bookingId + "" ) ; / / Sending Message to public
/ / sendMessage ( user_name , mobile , slotIds , from_date , to_date , no_of_person , amount , cid , bid , sid , bookingId + "" ) ;
/ / / / Sending Message to public
sendMessage ( user_name , mobile , slotIds , from_date , to_date , no_of_person , amount , cid , bid , sid ,
smsename , bookingId + "" ) ; / / Sending Message to public
return bookingId ;
} else {
@ -524,9 +649,16 @@ public class BookingService {
}
}
/ / ak
public Map < String , Object > getBuildingDetails ( String bid ) {
String sql = "SELECT smsename FROM buildings WHERE bid = ?" ;
return jdbcTemplate . queryForMap ( sql , bid ) ;
}
@Transactional
public void sendMessage ( String user_name , String mobile , String slotIds , String from_date , String to_date ,
String no_of_person , String amount , String cid , String bid , String sid , String bookingId ) {
String no_of_person , String amount , String cid , String bid , String sid , String smsename , String bookingId ) {
/ / System . out . println ( "smsename :" + smsename ) ;
String slottxt = "" ;
slottxt = calendarService . getSlotText ( slotIds ) ;
@ -534,29 +666,70 @@ public class BookingService {
/ / System . out . println ( "cid :" + cid ) ;
/ / System . out . println ( "sid :" + sid ) ;
/ / convert dates here
String fromDateFormatted = convertToDDMMYYYY ( from_date ) ;
String toDateFormatted = convertToDDMMYYYY ( to_date ) ;
/ *
* if ( cid . equals ( "1" ) | | cid . equals ( "4" ) ) {
* whatsAppService . sendELearnNmsg ( mobile , no_of_person , from_date , slottxt ,
* amount , bookingId ) ;
* whatsAppService . sendTLearnNmsg ( mobile , no_of_person , from_date , slottxt ,
* amount , bookingId ) ;
* }
* else if ( cid . equals ( "2" ) ) {
* if ( sid . equals ( "4" ) ) {
* whatsAppService . sendEMonthDeskspaceNmsg ( mobile , no_of_person , from_date ,
* to_date , slottxt , amount , bookingId ) ;
* whatsAppService . sendTMonthDeskspaceNmsg ( mobile , no_of_person , from_date ,
* to_date , slottxt , amount , bookingId ) ;
* }
* else {
* whatsAppService . sendEDeskspaceNmsg ( mobile , no_of_person , from_date , slottxt ,
* amount , bookingId ) ;
* whatsAppService . sendTDeskspaceNmsg ( mobile , no_of_person , from_date , slottxt ,
* amount , bookingId ) ;
* }
* }
* else if ( cid . equals ( "3" ) ) {
* whatsAppService . sendEConfeNmsg ( mobile , from_date , slottxt , amount , bookingId ) ;
* whatsAppService . sendTConfeNmsg ( mobile , from_date , slottxt , amount , bookingId ) ;
* }
* /
if ( cid . equals ( "1" ) | | cid . equals ( "4" ) ) {
whatsAppService . sendELearnNmsg ( mobile , no_of_person , from_date , slottxt , amount , bookingId ) ;
whatsAppService . sendTLearnNmsg ( mobile , no_of_person , from_date , slottxt , amount , bookingId ) ;
}
else if ( cid . equals ( "2" ) ) {
whatsAppService . sendELearnNmsg ( mobile , no_of_person , fromDateFormatted , slottxt , smsename , amount ,
bookingId ) ;
whatsAppService . sendTLearnNmsg ( mobile , no_of_person , fromDateFormatted , slottxt , amount , bookingId ) ;
} else if ( cid . equals ( "2" ) ) {
if ( sid . equals ( "4" ) ) {
whatsAppService . sendEMonthDeskspaceNmsg ( mobile , no_of_person , from_date , to_date , slottxt , amount , bookingId ) ;
whatsAppService . sendTMonthDeskspaceNmsg ( mobile , no_of_person , from_date , to_date , slottxt , amount , bookingId ) ;
whatsAppService . sendEMonthDeskspaceNmsg ( mobile , no_of_person , fromDateFormatted , toDateFormatted ,
slottxt , smsename , amount , bookingId ) ;
whatsAppService . sendTMonthDeskspaceNmsg ( mobile , no_of_person , fromDateFormatted , toDateFormatted ,
slottxt , amount , bookingId ) ;
} else {
whatsAppService . sendEDeskspaceNmsg ( mobile , no_of_person , fromDateFormatted , slottxt , smsename , amount ,
bookingId ) ;
whatsAppService . sendTDeskspaceNmsg ( mobile , no_of_person , fromDateFormatted , slottxt , amount , bookingId ) ;
}
else {
whatsAppService . sendEDeskspaceNmsg ( mobile , no_of_person , from_date , slottxt , amount , bookingId ) ;
whatsAppService . sendTDeskspaceNmsg ( mobile , no_of_person , from_date , slottxt , amount , bookingId ) ;
} else if ( cid . equals ( "3" ) ) {
whatsAppService . sendEConf eNmsg ( mobile , fromDateFormatted , slottxt , smsename , amount , bookingId ) ;
whatsAppService . sendTConf eNmsg ( mobile , fromDateFormatted , slottxt , amount , bookingId ) ;
}
}
else if ( cid . equals ( "3" ) ) {
whatsAppService . sendEConfeNmsg ( mobile , from_date , slottxt , amount , bookingId ) ;
whatsAppService . sendTConfeNmsg ( mobile , from_date , slottxt , amount , bookingId ) ;
/ / ak
private String convertToDDMMYYYY ( String date ) {
try {
LocalDate parsed = LocalDate . parse ( date ) ; / / expects yyyy - MM - dd
return parsed . format ( DateTimeFormatter . ofPattern ( "dd-MM-yyyy" ) ) ;
} catch ( Exception e ) {
return date ; / / fallback if format is unexpected
}
}
@Transactional
public void saveInBookingInCalendar ( int bookingId , String fromDat , String toDat , String persons , String slotIds , String bid , String cid , String sid ) {
public void saveInBookingInCalendar ( int bookingId , String fromDat , String toDat , String persons , String slotIds ,
String bid , String cid , String sid ) {
LocalDate fromDate = LocalDate . parse ( fromDat ) ;
LocalDate toDate = LocalDate . parse ( toDat ) ;
int noOfPeople = Integer . parseInt ( persons ) ;
@ -576,8 +749,7 @@ public class BookingService {
for ( LocalDate date : btnDates ) {
if ( checkAvailabilityByBdate ( buildId , catId , date , subId , noOfPeople , slot ) ) {
throw new NoSlotAvailable ( "Slot Occupied" ) ;
}
else {
} else {
saveInCalendar ( buildId , catId , slot , bookingId , date , noOfPeople ) ;
}
}
@ -587,7 +759,6 @@ public class BookingService {
updateBookingStatus ( bookingId , "success" ) ;
}
}
public int saveInCalendar ( int bid , int cid , int slotId , int bookId , LocalDate bDate , int noOfPeople ) {
@ -639,7 +810,6 @@ public class BookingService {
}
}
@Transactional
public int updateBookingStatus ( int bookingId , String bookingStatus ) {
/ / SQL UPDATE query with placeholders
@ -702,12 +872,10 @@ public class BookingService {
"JOIN category c ON bd.cid = c.cid " +
"WHERE bd.mobile = ? " ;
return jdbcTemplate . queryForList ( sqlQuery , mobile ) ;
}
/ / "AND (bd.from_date = CURDATE() OR bd.to_date = CURDATE()) " ;
public List < Map < String , Object > > getBookingByMobileNo ( long mobile ) {
String sqlQuery = "SELECT " +
"DATE_FORMAT(bd.from_date, '%d-%m-%Y') AS from_date, " +
@ -779,66 +947,68 @@ public class BookingService {
"JOIN category c ON bd.cid = c.cid " +
"WHERE bd.booking_id = ?" ;
return jdbcTemplate . queryForList ( sqlQuery , booking_id ) ;
}
/ *
public List < Map < String , Object > > getQrPageByBookingId ( int booking_id ) {
String sqlQuery = "SELECT " +
"bd.from_date, " +
"bd.to_date, " +
"bd.booking_id, " +
"bd.user_name, " +
"bd.mobile, " +
"bd.amount, " +
"bd.payment_status, " +
"bd.no_of_person, " +
"bd.slotids, " +
"bu.name AS buildingname, " +
"st.name AS duration, " +
"c.name AS type, " +
"c.display_name AS type_name, " +
"SUBSTRING_INDEX(st.name, ' to ', 1) AS checkin, " +
"SUBSTRING_INDEX(st.name, ' to ', -1) AS checkout, " +
"TIMESTAMPDIFF(HOUR, " +
" STR_TO_DATE(SUBSTRING_INDEX(st.name, ' to ', 1), '%h:%i %p'), " +
" STR_TO_DATE(SUBSTRING_INDEX(st.name, ' to ', -1), '%h:%i %p')" +
") AS duration_hours, " +
"CASE " +
" WHEN bd.to_date < CURDATE() THEN 'Completed' " +
" WHEN (bd.from_date > CURDATE() or bd.to_date>CURDATE()) THEN 'Upcoming' " +
" ELSE 'Ongoing' " +
"END AS status " +
"FROM booking bd " +
"JOIN slots st ON bd.slotids = st.slotid " +
"JOIN buildings bu ON bd.bid = bu.bid " +
"JOIN category c ON bd.cid = c.cid " +
"WHERE bd.booking_id = ?" ;
return jdbcTemplate . queryForList ( sqlQuery , booking_id ) ;
}
* public List < Map < String , Object > > getQrPageByBookingId ( int booking_id ) {
* String sqlQuery = "SELECT " +
* "bd.from_date, " +
* "bd.to_date, " +
* "bd.booking_id, " +
* "bd.user_name, " +
* "bd.mobile, " +
* "bd.amount, " +
* "bd.payment_status, " +
* "bd.no_of_person, " +
* "bd.slotids, " +
* "bu.name AS buildingname, " +
* "st.name AS duration, " +
* "c.name AS type, " +
* "c.display_name AS type_name, " +
* "SUBSTRING_INDEX(st.name, ' to ', 1) AS checkin, " +
* "SUBSTRING_INDEX(st.name, ' to ', -1) AS checkout, " +
* "TIMESTAMPDIFF(HOUR, " +
* " STR_TO_DATE(SUBSTRING_INDEX(st.name, ' to ', 1), '%h:%i %p'), " +
* " STR_TO_DATE(SUBSTRING_INDEX(st.name, ' to ', -1), '%h:%i %p')" +
* ") AS duration_hours, " +
* "CASE " +
* " WHEN bd.to_date < CURDATE() THEN 'Completed' " +
* " WHEN (bd.from_date > CURDATE() or bd.to_date>CURDATE()) THEN 'Upcoming' "
* +
* " ELSE 'Ongoing' " +
* "END AS status " +
* "FROM booking bd " +
* "JOIN slots st ON bd.slotids = st.slotid " +
* "JOIN buildings bu ON bd.bid = bu.bid " +
* "JOIN category c ON bd.cid = c.cid " +
* "WHERE bd.booking_id = ?" ;
*
* return jdbcTemplate . queryForList ( sqlQuery , booking_id ) ;
* }
*
* /
/ / public String validateLogin ( String usernametxt , String pin ) {
/ / / / SQL query
/ / String sql = "SELECT * FROM login WHERE user_name = ? AND password = ? LIMIT 0,1" ;
/ / String sql = " SELECT * FROM login WHERE user_name = ? AND password = ? LIMIT
/ / 0 , 1 " ;
/ / / / Execute the query and pass mobileNo and pin as parameters
/ / List < Map < String , Object > > results = jdbcTemplate . queryForList ( sql , usernametxt , pin ) ;
/ / List < Map < String , Object > > results = jdbcTemplate . queryForList ( sql ,
/ / usernametxt , pin ) ;
/ / / / Check if any results were found
/ / if ( ! results . isEmpty ( ) ) {
/ / Map < String , Object > login = results . get ( 0 ) ;
/ / return ( String ) login . get ( "user_name" ) ; / / Assuming ' reference_name ' is a column
/ / return ( String ) login . get ( "user_name" ) ; / / Assuming ' reference_name ' is a
/ / column
/ / } else {
/ / return null ; / / Return null if no matching record was found
/ / }
/ / }
public Map < String , Object > validateLogin ( String username , String password ) {
String sql = "SELECT user_name, bid FROM login WHERE user_name = ? AND password = ? LIMIT 1" ;
@ -860,57 +1030,60 @@ public class BookingService {
return jdbcTemplate . queryForList ( sql , selectedDate , scid ) ;
}
/ * public List < Map < String , Object > > getbookingdetailDashBoard ( String fromDate , String toDate , String status ) {
StringBuilder sql = new StringBuilder (
"SELECT " +
"concat('#', bd.booking_id) AS booking_id, " +
"bd.user_name, " +
"bd.mobile, " +
"c.display_name AS type_name, " +
"st.name AS duration, " +
"DATE_FORMAT(bd.cdate, '%d-%m-%Y') AS booked_date, " +
"DATE_FORMAT(bd.from_date, '%d-%m-%Y') AS from_date, " +
"DATE_FORMAT(bd.to_date, '%d-%m-%Y') AS to_date, " +
"SUBSTRING_INDEX(st.name, ' to ', 1) AS checkin, " +
"SUBSTRING_INDEX(st.name, ' to ', -1) AS checkout, " +
"bd.no_of_person AS no_of_seats, " +
"bd.amount, " +
"CASE " +
" WHEN bd.to_date < CURDATE() THEN 'Completed' " +
" WHEN bd.from_date > CURDATE() THEN 'Upcoming' " +
" ELSE 'Ongoing' " +
"END AS status, " +
"TIMESTAMPDIFF(HOUR, " +
" STR_TO_DATE(SUBSTRING_INDEX(st.name, ' to ', 1), '%h:%i %p'), " +
" STR_TO_DATE(SUBSTRING_INDEX(st.name, ' to ', -1), '%h:%i %p') " +
") AS duration_hours " +
"FROM booking bd " +
"JOIN slots st ON bd.slotids = st.slotid " +
"JOIN buildings bu ON bd.bid = bu.bid " +
"JOIN category c ON bd.cid = c.cid " +
"WHERE DATE(bd.cdate) BETWEEN STR_TO_DATE(?, '%Y-%m-%d') AND STR_TO_DATE(?, '%Y-%m-%d') "
) ;
/ / Conditionally add the status filter
if ( status ! = null & & ! status . isEmpty ( ) ) {
sql . append ( " AND CASE " +
"WHEN bd.to_date < CURDATE() THEN 'Completed' " +
"WHEN bd.from_date > CURDATE() THEN 'Upcoming' " +
"ELSE 'Ongoing' END = ?" ) ;
}
/ / Prepare the parameters for the query
List < Object > params = new ArrayList < > ( ) ;
params . add ( fromDate ) ;
params . add ( toDate ) ;
if ( status ! = null & & ! status . isEmpty ( ) ) {
params . add ( status ) ;
}
/ / Execute the query with the constructed SQL and parameters
return jdbcTemplate . queryForList ( sql . toString ( ) , params . toArray ( ) ) ;
} * /
/ *
* public List < Map < String , Object > > getbookingdetailDashBoard ( String fromDate ,
* String toDate , String status ) {
* StringBuilder sql = new StringBuilder (
* "SELECT " +
* "concat('#', bd.booking_id) AS booking_id, " +
* "bd.user_name, " +
* "bd.mobile, " +
* "c.display_name AS type_name, " +
* "st.name AS duration, " +
* "DATE_FORMAT(bd.cdate, '%d-%m-%Y') AS booked_date, " +
* "DATE_FORMAT(bd.from_date, '%d-%m-%Y') AS from_date, " +
* "DATE_FORMAT(bd.to_date, '%d-%m-%Y') AS to_date, " +
* "SUBSTRING_INDEX(st.name, ' to ', 1) AS checkin, " +
* "SUBSTRING_INDEX(st.name, ' to ', -1) AS checkout, " +
* "bd.no_of_person AS no_of_seats, " +
* "bd.amount, " +
* "CASE " +
* " WHEN bd.to_date < CURDATE() THEN 'Completed' " +
* " WHEN bd.from_date > CURDATE() THEN 'Upcoming' " +
* " ELSE 'Ongoing' " +
* "END AS status, " +
* "TIMESTAMPDIFF(HOUR, " +
* " STR_TO_DATE(SUBSTRING_INDEX(st.name, ' to ', 1), '%h:%i %p'), " +
* " STR_TO_DATE(SUBSTRING_INDEX(st.name, ' to ', -1), '%h:%i %p') " +
* ") AS duration_hours " +
* "FROM booking bd " +
* "JOIN slots st ON bd.slotids = st.slotid " +
* "JOIN buildings bu ON bd.bid = bu.bid " +
* "JOIN category c ON bd.cid = c.cid " +
* "WHERE DATE(bd.cdate) BETWEEN STR_TO_DATE(?, '%Y-%m-%d') AND STR_TO_DATE(?, '%Y-%m-%d') "
* ) ;
*
* / / Conditionally add the status filter
* if ( status ! = null & & ! status . isEmpty ( ) ) {
* sql . append ( " AND CASE " +
* "WHEN bd.to_date < CURDATE() THEN 'Completed' " +
* "WHEN bd.from_date > CURDATE() THEN 'Upcoming' " +
* "ELSE 'Ongoing' END = ?" ) ;
* }
*
* / / Prepare the parameters for the query
* List < Object > params = new ArrayList < > ( ) ;
* params . add ( fromDate ) ;
* params . add ( toDate ) ;
*
* if ( status ! = null & & ! status . isEmpty ( ) ) {
* params . add ( status ) ;
* }
*
* / / Execute the query with the constructed SQL and parameters
* return jdbcTemplate . queryForList ( sql . toString ( ) , params . toArray ( ) ) ;
* }
* /
public List < Map < String , Object > > getbookingdetailDashBoard (
String fromDate , String toDate , String status , int bid ) {
@ -966,26 +1139,35 @@ public class BookingService {
return jdbcTemplate . queryForList ( sql . toString ( ) , params . toArray ( ) ) ;
}
/ * public List < Map < String , Object > > getAmountCollectedByDate ( LocalDate fromDate , LocalDate toDate ) {
String sql = "SELECT COALESCE(SUM(b.amount), 0) AS overall_amount_collected, " +
"COALESCE(SUM(CASE WHEN b.sid = 1 THEN b.amount ELSE 0 END), 0) AS learning_zone_amount_collected, " +
"COALESCE(SUM(CASE WHEN b.sid IN (2, 3, 4) THEN b.amount ELSE 0 END), 0) AS desk_space_amount_collected, " +
"COALESCE(SUM(CASE WHEN b.sid IN (5, 6, 7) THEN b.amount ELSE 0 END), 0) AS meeting_room_amount_collected " +
"FROM booking b " +
"WHERE DATE(b.cdate) BETWEEN ? AND ? " +
"AND b.booking_status = 'success'" ;
System . err . println ( sql + " " + fromDate + " to " + toDate ) ;
return jdbcTemplate . queryForList ( sql , fromDate , toDate ) ;
} * /
/ *
* public List < Map < String , Object > > getAmountCollectedByDate ( LocalDate fromDate ,
* LocalDate toDate ) {
* String sql =
* "SELECT COALESCE(SUM(b.amount), 0) AS overall_amount_collected, " +
* "COALESCE(SUM(CASE WHEN b.sid = 1 THEN b.amount ELSE 0 END), 0) AS learning_zone_amount_collected, "
* +
* "COALESCE(SUM(CASE WHEN b.sid IN (2, 3, 4) THEN b.amount ELSE 0 END), 0) AS desk_space_amount_collected, "
* +
* "COALESCE(SUM(CASE WHEN b.sid IN (5, 6, 7) THEN b.amount ELSE 0 END), 0) AS meeting_room_amount_collected "
* +
* "FROM booking b " +
* "WHERE DATE(b.cdate) BETWEEN ? AND ? " +
* "AND b.booking_status = 'success'" ;
*
* System . err . println ( sql + " " + fromDate + " to " + toDate ) ;
* return jdbcTemplate . queryForList ( sql , fromDate , toDate ) ;
* }
* /
public List < Map < String , Object > > getAmountCollectedByDate ( LocalDate fromDate , LocalDate toDate , int bid ) {
String sql = "SELECT " +
"b.bid, " +
"COALESCE(SUM(b.amount), 0) AS overall_amount_collected, " +
"COALESCE(SUM(CASE WHEN b.sid = 1 THEN b.amount ELSE 0 END), 0) AS learning_zone_amount_collected, " +
"COALESCE(SUM(CASE WHEN b.sid IN (2, 3, 4) THEN b.amount ELSE 0 END), 0) AS desk_space_amount_collected, " +
"COALESCE(SUM(CASE WHEN b.sid IN (5, 6, 7) THEN b.amount ELSE 0 END), 0) AS meeting_room_amount_collected " +
"COALESCE(SUM(CASE WHEN b.sid IN (1,8) THEN b.amount ELSE 0 END), 0) AS learning_zone_amount_collected, "
+
"COALESCE(SUM(CASE WHEN b.sid IN (2, 3, 4) THEN b.amount ELSE 0 END), 0) AS desk_space_amount_collected, "
+
"COALESCE(SUM(CASE WHEN b.sid IN (5, 6, 7) THEN b.amount ELSE 0 END), 0) AS meeting_room_amount_collected "
+
"FROM booking b " +
"WHERE DATE(b.cdate) BETWEEN ? AND ? " +
"AND b.booking_status = 'success' " +
@ -996,66 +1178,109 @@ public class BookingService {
return jdbcTemplate . queryForList ( sql , fromDate , toDate , bid ) ;
}
/ *
public List < Map < String , Object > > getBookingCountsByCategory ( String fromDate , String toDate ) {
String sql = "SELECT " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 1 THEN no_of_person ELSE 0 END), 0) AS slotId_1_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 2 THEN no_of_person ELSE 0 END), 0) AS slotId_2_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 3 THEN no_of_person ELSE 0 END), 0) AS slotId_3_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 4 THEN no_of_person ELSE 0 END), 0) AS slotId_4_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 5 THEN no_of_person ELSE 0 END), 0) AS slotId_5_count, " +
"COALESCE(SUM(CASE WHEN sid IN (2, 3, 4) AND slotids IN (6, 7) THEN no_of_person ELSE 0 END), 0) AS half_day_count, " +
"COALESCE(SUM(CASE WHEN sid IN (2, 3, 4) AND slotids = 8 THEN no_of_person ELSE 0 END), 0) AS full_day_count, " +
"COALESCE(SUM(CASE WHEN sid IN (4) AND slotids = 9 THEN no_of_person ELSE 0 END), 0) AS monthly_count, " +
"COALESCE(SUM(CASE WHEN sid IN (5, 6, 7) AND slotids IN (10,11,12,13,14,15,16,17,18,19,20,21,22) THEN no_of_person ELSE 0 END), 0) AS RoomNo1_Count, " +
"COALESCE(SUM(CASE WHEN sid IN (5, 6, 7) AND slotids IN (23,24,25,26,27,28,29,30,31,32,33,34,35) THEN no_of_person ELSE 0 END), 0) AS RoomNo2_Count, " +
"COALESCE(SUM(CASE WHEN sid IN (5, 6, 7) AND slotids IN (36,37,38,39,40,41,42,43,44,45,46,47,48) THEN no_of_person ELSE 0 END), 0) AS RoomNo3_Count " +
"FROM booking " +
"WHERE booking_status = 'success' " +
"AND DATE(cdate) BETWEEN ? AND ?" ;
/ / Query and return result as a List of Maps
return jdbcTemplate . queryForList ( sql , fromDate , toDate ) ;
}
* public List < Map < String , Object > > getBookingCountsByCategory ( String fromDate ,
* String toDate ) {
* String sql = "SELECT " +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 1 THEN no_of_person ELSE 0 END), 0) AS slotId_1_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 2 THEN no_of_person ELSE 0 END), 0) AS slotId_2_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 3 THEN no_of_person ELSE 0 END), 0) AS slotId_3_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 4 THEN no_of_person ELSE 0 END), 0) AS slotId_4_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 5 THEN no_of_person ELSE 0 END), 0) AS slotId_5_count, "
* +
* "COALESCE(SUM(CASE WHEN sid IN (2, 3, 4) AND slotids IN (6, 7) THEN no_of_person ELSE 0 END), 0) AS half_day_count, "
* +
* "COALESCE(SUM(CASE WHEN sid IN (2, 3, 4) AND slotids = 8 THEN no_of_person ELSE 0 END), 0) AS full_day_count, "
* +
* "COALESCE(SUM(CASE WHEN sid IN (4) AND slotids = 9 THEN no_of_person ELSE 0 END), 0) AS monthly_count, "
* +
* "COALESCE(SUM(CASE WHEN sid IN (5, 6, 7) AND slotids IN (10,11,12,13,14,15,16,17,18,19,20,21,22) THEN no_of_person ELSE 0 END), 0) AS RoomNo1_Count, "
* +
* "COALESCE(SUM(CASE WHEN sid IN (5, 6, 7) AND slotids IN (23,24,25,26,27,28,29,30,31,32,33,34,35) THEN no_of_person ELSE 0 END), 0) AS RoomNo2_Count, "
* +
* "COALESCE(SUM(CASE WHEN sid IN (5, 6, 7) AND slotids IN (36,37,38,39,40,41,42,43,44,45,46,47,48) THEN no_of_person ELSE 0 END), 0) AS RoomNo3_Count "
* +
* "FROM booking " +
* "WHERE booking_status = 'success' " +
* "AND DATE(cdate) BETWEEN ? AND ?" ;
*
* / / Query and return result as a List of Maps
* return jdbcTemplate . queryForList ( sql , fromDate , toDate ) ;
* }
* /
/ / previous
/ * public List < Map < String , Object > > getBookingCountsByCategory ( String fromDate , String toDate ) {
String sql = "SELECT " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 1 THEN 1 ELSE 0 END), 0) AS slotId_1_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 2 THEN 1 ELSE 0 END), 0) AS slotId_2_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 3 THEN 1 ELSE 0 END), 0) AS slotId_3_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 4 THEN 1 ELSE 0 END), 0) AS slotId_4_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 5 THEN 1 ELSE 0 END), 0) AS slotId_5_count, " +
"COALESCE(SUM(CASE WHEN sid = 2 AND slotids IN (6, 7) THEN 1 ELSE 0 END), 0) AS half_day_count, " +
"COALESCE(SUM(CASE WHEN sid = 3 AND slotids = 8 THEN 1 ELSE 0 END), 0) AS full_day_count, " +
"COALESCE(SUM(CASE WHEN sid = 4 AND slotids = 9 THEN 1 ELSE 0 END), 0) AS monthly_count, " +
"COALESCE(SUM(CASE WHEN sid = 5 AND slotids IN (10,11,12,13,14,15,16,17,18,19,20,21,22) THEN 1 ELSE 0 END), 0) AS RoomNo1_Count, " +
"COALESCE(SUM(CASE WHEN sid = 6 AND slotids IN (23,24,25,26,27,28,29,30,31,32,33,34,35) THEN 1 ELSE 0 END), 0) AS RoomNo2_Count, " +
"COALESCE(SUM(CASE WHEN sid = 7 AND slotids IN (36,37,38,39,40,41,42,43,44,45,46,47,48) THEN 1 ELSE 0 END), 0) AS RoomNo3_Count " +
"FROM booking " +
"WHERE booking_status = 'success' " +
"AND DATE(cdate) BETWEEN ? AND ?" ;
/ *
* public List < Map < String , Object > > getBookingCountsByCategory ( String fromDate ,
* String toDate ) {
* String sql = "SELECT " +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 1 THEN 1 ELSE 0 END), 0) AS slotId_1_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 2 THEN 1 ELSE 0 END), 0) AS slotId_2_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 3 THEN 1 ELSE 0 END), 0) AS slotId_3_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 4 THEN 1 ELSE 0 END), 0) AS slotId_4_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 5 THEN 1 ELSE 0 END), 0) AS slotId_5_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 2 AND slotids IN (6, 7) THEN 1 ELSE 0 END), 0) AS half_day_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 3 AND slotids = 8 THEN 1 ELSE 0 END), 0) AS full_day_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 4 AND slotids = 9 THEN 1 ELSE 0 END), 0) AS monthly_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 5 AND slotids IN (10,11,12,13,14,15,16,17,18,19,20,21,22) THEN 1 ELSE 0 END), 0) AS RoomNo1_Count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 6 AND slotids IN (23,24,25,26,27,28,29,30,31,32,33,34,35) THEN 1 ELSE 0 END), 0) AS RoomNo2_Count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 7 AND slotids IN (36,37,38,39,40,41,42,43,44,45,46,47,48) THEN 1 ELSE 0 END), 0) AS RoomNo3_Count "
* +
* "FROM booking " +
* "WHERE booking_status = 'success' " +
* "AND DATE(cdate) BETWEEN ? AND ?" ;
*
* / / Query and return result as a List of Maps
* return jdbcTemplate . queryForList ( sql , fromDate , toDate ) ;
* }
* /
/ / Query and return result as a List of Maps
return jdbcTemplate . queryForList ( sql , fromDate , toDate ) ;
} * /
/ / working changed but build2 is not configured for charts
public List < Map < String , Object > > getBookingCountsByCategory ( String fromDate , String toDate , int bid ) {
String sql = "SELECT " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 1 THEN 1 ELSE 0 END), 0) AS slotId_1_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 2 THEN 1 ELSE 0 END), 0) AS slotId_2_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 3 THEN 1 ELSE 0 END), 0) AS slotId_3_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 4 THEN 1 ELSE 0 END), 0) AS slotId_4_count, " +
"COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 5 THEN 1 ELSE 0 END), 0) AS slotId_5_count, " +
/ *
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 1 THEN 1 ELSE 0 END), 0) AS slotId_1_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 2 THEN 1 ELSE 0 END), 0) AS slotId_2_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 3 THEN 1 ELSE 0 END), 0) AS slotId_3_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 4 THEN 1 ELSE 0 END), 0) AS slotId_4_count, "
* +
* "COALESCE(SUM(CASE WHEN sid = 1 AND slotids = 5 THEN 1 ELSE 0 END), 0) AS slotId_5_count, "
* +
* /
"COALESCE(SUM(CASE WHEN sid in (1,8) AND slotids in (1,49) THEN 1 ELSE 0 END), 0) AS slotId_1_count, "
+
"COALESCE(SUM(CASE WHEN sid in (1,8) AND slotids in (2,50) THEN 1 ELSE 0 END), 0) AS slotId_2_count, " +
"COALESCE(SUM(CASE WHEN sid in (1,8) AND slotids in (3,51) THEN 1 ELSE 0 END), 0) AS slotId_3_count, " +
"COALESCE(SUM(CASE WHEN sid in (1,8) AND slotids in (4,52) THEN 1 ELSE 0 END), 0) AS slotId_4_count, " +
"COALESCE(SUM(CASE WHEN sid in (1,8) AND slotids in (5,53) THEN 1 ELSE 0 END), 0) AS slotId_5_count, " +
"COALESCE(SUM(CASE WHEN sid = 2 AND slotids IN (6,7) THEN 1 ELSE 0 END), 0) AS half_day_count, " +
"COALESCE(SUM(CASE WHEN sid = 3 AND slotids = 8 THEN 1 ELSE 0 END), 0) AS full_day_count, " +
"COALESCE(SUM(CASE WHEN sid = 4 AND slotids = 9 THEN 1 ELSE 0 END), 0) AS monthly_count, " +
"COALESCE(SUM(CASE WHEN sid = 5 AND slotids IN (10,11,12,13,14,15,16,17,18,19,20,21,22) THEN 1 ELSE 0 END), 0) AS RoomNo1_Count, " +
"COALESCE(SUM(CASE WHEN sid = 6 AND slotids IN (23,24,25,26,27,28,29,30,31,32,33,34,35) THEN 1 ELSE 0 END), 0) AS RoomNo2_Count, " +
"COALESCE(SUM(CASE WHEN sid = 7 AND slotids IN (36,37,38,39,40,41,42,43,44,45,46,47,48) THEN 1 ELSE 0 END), 0) AS RoomNo3_Count " +
"COALESCE(SUM(CASE WHEN sid = 5 AND slotids IN (10,11,12,13,14,15,16,17,18,19,20,21,22) THEN 1 ELSE 0 END), 0) AS RoomNo1_Count, "
+
"COALESCE(SUM(CASE WHEN sid = 6 AND slotids IN (23,24,25,26,27,28,29,30,31,32,33,34,35) THEN 1 ELSE 0 END), 0) AS RoomNo2_Count, "
+
"COALESCE(SUM(CASE WHEN sid = 7 AND slotids IN (36,37,38,39,40,41,42,43,44,45,46,47,48) THEN 1 ELSE 0 END), 0) AS RoomNo3_Count "
+
"FROM booking " +
"WHERE booking_status = 'success' " +
@ -1066,24 +1291,27 @@ public class BookingService {
}
/ / previous
/ * public List < Map < String , Object > > getBookingCountsByDate ( String fromDate , String toDate ) {
/ / SQL query
String sql = "SELECT " +
"count(booking_id) AS Total_booking_count, " +
"SUM(CASE WHEN cid = 1 THEN 1 ELSE 0 END) AS Learning_zone_count, " +
"SUM(CASE WHEN cid = 2 THEN 1 ELSE 0 END) AS Desk_space_count, " +
"SUM(CASE WHEN cid = 3 THEN 1 ELSE 0 END) AS Meeting_room_count " +
"FROM booking " +
"WHERE booking_status = 'success' and DATE(cdate) BETWEEN ? AND ?" ;
/ / Query and return result as a Map
return jdbcTemplate . queryForList ( sql , fromDate , toDate ) ;
} * /
/ *
* public List < Map < String , Object > > getBookingCountsByDate ( String fromDate ,
* String toDate ) {
* / / SQL query
* String sql = "SELECT " +
* "count(booking_id) AS Total_booking_count, " +
* "SUM(CASE WHEN cid = 1 THEN 1 ELSE 0 END) AS Learning_zone_count, " +
* "SUM(CASE WHEN cid = 2 THEN 1 ELSE 0 END) AS Desk_space_count, " +
* "SUM(CASE WHEN cid = 3 THEN 1 ELSE 0 END) AS Meeting_room_count " +
* "FROM booking " +
* "WHERE booking_status = 'success' and DATE(cdate) BETWEEN ? AND ?" ;
*
* / / Query and return result as a Map
* return jdbcTemplate . queryForList ( sql , fromDate , toDate ) ;
* }
* /
public List < Map < String , Object > > getBookingCountsByDate ( String fromDate , String toDate , int bid ) {
String sql = "SELECT " +
"COUNT(booking_id) AS Total_booking_count, " +
"SUM(CASE WHEN cid = 1 THEN 1 ELSE 0 END) AS Learning_zone_count, " +
"SUM(CASE WHEN cid in (1,4) THEN 1 ELSE 0 END) AS Learning_zone_count, " +
"SUM(CASE WHEN cid = 2 THEN 1 ELSE 0 END) AS Desk_space_count, " +
"SUM(CASE WHEN cid = 3 THEN 1 ELSE 0 END) AS Meeting_room_count " +
"FROM booking " +
@ -1095,10 +1323,12 @@ public class BookingService {
}
/ / ak
/ * public List < Map < String , Object > > getBidByUserName ( String userName ) {
String sql = "SELECT bid FROM login WHERE user_name = ?" ;
return jdbcTemplate . queryForList ( sql , userName ) ;
} * /
/ *
* public List < Map < String , Object > > getBidByUserName ( String userName ) {
* String sql = "SELECT bid FROM login WHERE user_name = ?" ;
* return jdbcTemplate . queryForList ( sql , userName ) ;
* }
* /
public Integer getBidByUserName ( String userName ) {
try {
String sql = "SELECT bid FROM login WHERE user_name = ?" ;