|
|
@@ -4,6 +4,7 @@ import com.happy.Model.Booking;
|
|
|
import com.happy.Model.Booking;
|
|
|
import com.happy.Model.House;
|
|
|
import com.happy.Until.Func;
|
|
|
+import com.happy.Until.SqlUtil;
|
|
|
import com.happy.Until.UUIDUtil;
|
|
|
import com.happy.dao.BookDao;
|
|
|
import com.happy.dto.BookTypeEto;
|
|
|
@@ -217,6 +218,8 @@ public class BookImplDao implements BookDao {
|
|
|
|
|
|
@Override
|
|
|
public List<Booking> queryPage(String sqlx, int page, int rows) {
|
|
|
+ SqlUtil.filterKeyword(sqlx);
|
|
|
+
|
|
|
int start = (page - 1) * rows;// 每页的起始下标
|
|
|
String sql = "SELECT a.*,b.name hotel_township_name FROM (select "+selectCol+" from booking) a left join hotel_dict b on a.hotel_township = b.id WHERE 1=1 "+sqlx+" ORDER BY create_time DESC limit :start,:rows ";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
@@ -230,6 +233,7 @@ public class BookImplDao implements BookDao {
|
|
|
|
|
|
@Override
|
|
|
public int queryTotal(String sqlx) {
|
|
|
+ SqlUtil.filterKeyword(sqlx);
|
|
|
String sql = "SELECT count(*) FROM`booking` where 1=1 "+sqlx;
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
return namedParameterJdbcTemplate.queryForInt(sql, sps);
|
|
|
@@ -237,7 +241,8 @@ public class BookImplDao implements BookDao {
|
|
|
|
|
|
@Override
|
|
|
public List<Booking> queryList(String sqlx) {
|
|
|
- String sql = "SELECT "+selectCol+",case when order_status=1 then '待支付' when order_status=2 then '已支付' when order_status=3 then '待入住' when order_status=4 then '已入住' when order_status=5 then '已消费' when order_status=6 then '支付超时' when order_status=7 then '已取消' when order_status=8 then '已退单' when order_status=9 then '已退款' else '无状态' end order_name FROM `booking` WHERE 1=1 "+sqlx;
|
|
|
+ SqlUtil.filterKeyword(sqlx);
|
|
|
+ String sql = "SELECT "+selectCol+",case when order_status=1 then '待支付' when order_status=2 then '已支付' when order_status=3 then '待入住' when order_status=4 then '已入住' when order_status=5 then '已消费' when order_status=6 then '支付超时' when order_status=7 then '已取消' when order_status=8 then '已退单' when order_status=9 then '已退款' else '无状态' end order_name FROM `booking` WHERE 1=1 "+sqlx;
|
|
|
List<Booking> list = null;
|
|
|
try{
|
|
|
list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(Booking.class));
|
|
|
@@ -250,6 +255,7 @@ public class BookImplDao implements BookDao {
|
|
|
|
|
|
@Override
|
|
|
public Double sumAccount(String sqlx){
|
|
|
+ SqlUtil.filterKeyword(sqlx);
|
|
|
String sql = "select sum(pay_account) pay_account from booking where is_delete=1"+sqlx;
|
|
|
List<Booking> list = null;
|
|
|
try{
|
|
|
@@ -263,6 +269,7 @@ public class BookImplDao implements BookDao {
|
|
|
|
|
|
@Override
|
|
|
public BookTypeEto getBookStatusSum(String sqlx){
|
|
|
+ SqlUtil.filterKeyword(sqlx);
|
|
|
String sql = "select ifnull(sum(case when order_status = 2 then 1 else 0 end),0) pendingOrderSum,count(1) orderSum,ifnull(sum(case when order_status = 5 then 1 else 0 end),0) consumerOrderSum,ifnull(sum(case when order_status = 5 then pay_account else 0 end),0) sumAccount from booking where 1=1"+sqlx;
|
|
|
List<BookTypeEto> list = null;
|
|
|
try{
|