|
|
@@ -41,9 +41,9 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
"inner join bus_room_pay_type_info pty on h.id=pty.hotel_id\n" +
|
|
|
"left join pos_order_goods_payment ogp on pty.id=ogp.payment_method\n" +
|
|
|
"where 1=1" +
|
|
|
- "<if test='hotelId != null and hotelId !=\"\"'> and h.id = #{hotelId} </if>" +
|
|
|
- "<if test='startTime != null'> and ogp.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and ogp.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and h.id = '${hotelId}' </if>" +
|
|
|
+ "<if test='startTime != null'> and ogp.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and ogp.create_time <= '${endTime}' </if>" +
|
|
|
"group by h.id\n" +
|
|
|
"UNION ALL\n" +
|
|
|
"select max(h.name) as hotel_name,'客房' as department\n" +
|
|
|
@@ -54,9 +54,9 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
"inner join bus_room_pay_type_info pty on h.id=pty.hotel_id\n" +
|
|
|
"left join bus_order_fee of on pty.id=of.pay_type\n" +
|
|
|
"where of.fee_type=2 and of.preferential_status=2" +
|
|
|
- "<if test='hotelId != null and hotelId !=\"\"'> and h.id = #{hotelId} </if>" +
|
|
|
- "<if test='startTime != null'> and of.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and of.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and h.id = '${hotelId}' </if>" +
|
|
|
+ "<if test='startTime != null'> and of.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and of.create_time <= '${endTime}' </if>" +
|
|
|
"group by h.id</script>")
|
|
|
public List<HashMap<String, Object>> pageList(Page<HashMap<String, Object>> page, @Param("busRoomPayTypes") List<BusRoomPayType> busRoomPayTypes, @Param("hotelId") String hotelId, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
|
|
|
|
|
@@ -79,9 +79,9 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
"inner join bus_room_pay_type_info pty on h.id=pty.hotel_id\n" +
|
|
|
"left join pos_order_goods_payment ogp on pty.id=ogp.payment_method\n" +
|
|
|
"where 1=1" +
|
|
|
- "<if test='hotelId != null and hotelId !=\"\"'> and h.id = #{hotelId} </if>" +
|
|
|
- "<if test='startTime != null'> and ogp.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and ogp.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and h.id = '${hotelId}' </if>" +
|
|
|
+ "<if test='startTime != null'> and ogp.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and ogp.create_time <= '${endTime}' </if>" +
|
|
|
"group by h.id</script>")
|
|
|
public List<HashMap<String, Object>> posPageList(Page<HashMap<String, Object>> page, @Param("busRoomPayTypes") List<BusRoomPayType> busRoomPayTypes, @Param("hotelId") String hotelId, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
|
|
|
|
|
@@ -103,9 +103,9 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
"inner join bus_room_pay_type_info pty on h.id=pty.hotel_id\n" +
|
|
|
"left join bus_order_fee of on pty.id=of.pay_type\n" +
|
|
|
"where of.fee_type=2 and of.preferential_status=2" +
|
|
|
- "<if test='hotelId != null and hotelId !=\"\"'> and h.id = #{hotelId} </if>" +
|
|
|
- "<if test='startTime != null'> and of.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and of.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and h.id = '${hotelId}' </if>" +
|
|
|
+ "<if test='startTime != null'> and of.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and of.create_time <= '${endTime}' </if>" +
|
|
|
"group by h.id</script>")
|
|
|
public List<HashMap<String, Object>> roomPageList(Page<HashMap<String, Object>> page, @Param("busRoomPayTypes") List<BusRoomPayType> busRoomPayTypes, @Param("hotelId") String hotelId, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
|
|
|
|
|
@@ -125,8 +125,8 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
"left join bus_room_pay_type_info pty on pty.id=ogp.payment_method\n" +
|
|
|
"where 1=1" +
|
|
|
"<if test='hotelId != null and hotelId !=\"\"'> and ogp.hotel_id = #{hotelId} </if>" +
|
|
|
- "<if test='startTime != null'> and ogp.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and ogp.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='startTime != null'> and ogp.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and ogp.create_time <= '${endTime}' </if>" +
|
|
|
"UNION ALL\n" +
|
|
|
"select '住客' as department,pty.name as payment_method_name,\n" +
|
|
|
"case when of.money>=0 then '收款' else '退款' end as fee_type,\n" +
|
|
|
@@ -138,8 +138,8 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
"left join bus_customer c on c.id=rlo.contact_id\n" +
|
|
|
"where of.fee_type=2 and of.preferential_status=2" +
|
|
|
"<if test='hotelId != null and hotelId !=\"\"'> and pty.hotel_id = #{hotelId} </if>" +
|
|
|
- "<if test='startTime != null'> and of.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and of.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='startTime != null'> and of.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and of.create_time <= '${endTime}' </if>" +
|
|
|
"</script>")
|
|
|
public List<HashMap<String, Object>> financePage(Page<HashMap<String, Object>> page, @Param("hotelId") String hotelId, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
|
|
|
|
|
@@ -480,13 +480,15 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
"</foreach>" +
|
|
|
" from bus_room_pay_type_info pty\n" +
|
|
|
" left join pos_order_goods_payment ogp on pty.id=ogp.payment_method\n" +
|
|
|
- "<if test='startTime != null'> and ogp.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and ogp.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='startTime != null'> and ogp.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and ogp.create_time <= '${endTime}' </if>" +
|
|
|
" where 1=1\n" +
|
|
|
"<if test='hotelId != null and hotelId !=\"\"'> and pty.hotel_id = '${hotelId}' </if>" +
|
|
|
" UNION ALL\n" +
|
|
|
- " select max(t.name) as name,SUM(case of.pay_type when '1633765326418755585' then of.money else 0 end) as '微信'\n" +
|
|
|
- " ,SUM(case of.pay_type when '1645358935063744514' then of.money else 0 end) as '现金'\n" +
|
|
|
+ " select max(t.name) as name" +
|
|
|
+ "<foreach item='item' index='index' collection='busRoomPayTypes' open=',' separator=',' close=' '>" +
|
|
|
+ "SUM(case of.pay_type when '${item.id}' then of.money else 0 end) as '${item.name}'\n"+
|
|
|
+ "</foreach>" +
|
|
|
"\t\t\t\t\t\tfrom(select id,name from (select 1 as id,'押金' as name \n" +
|
|
|
"\t\t\t\t\t\tunion select 2 as id,'预收房费' as name \n" +
|
|
|
"\t\t\t\t\t\tunion select 3 as id,'每日房费' as name\n" +
|
|
|
@@ -496,8 +498,8 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
" left join bus_order_fee of on of.subject_type=t.id\n" +
|
|
|
" and of.fee_type=2 and of.preferential_status=2\n" +
|
|
|
"<if test='hotelId != null and hotelId !=\"\"'> and of.hotel_id = '${hotelId}' </if>" +
|
|
|
- "<if test='startTime != null'> and of.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and of.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='startTime != null'> and of.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and of.create_time <= '${endTime}' </if>" +
|
|
|
" group by t.id</script>")
|
|
|
public List<HashMap<String, Object>> subjectTypeStatList(@Param("hotelId") String hotelId, @Param("busRoomPayTypes") List<BusRoomPayType> busRoomPayTypes, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
|
|
|
|
|
@@ -513,24 +515,24 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
" ,sum(ifnull((case t.subject_type when 1 then t.money when 2 then t.money when 3 then t.money when 5 then t.money else 0 end),0)) AS room_money\n" +
|
|
|
" ,sum(ifnull((case t.subject_type when 6 then t.money when 7 then t.money else 0 end),0)) AS other_money\n" +
|
|
|
" ,sum(ifnull((case t.subject_type when 1 then t.money when 2 then t.money when 3 then t.money when 5 then t.money when 6 then t.money when 7 then t.money else 0 end),0)) AS sum_money\n" +
|
|
|
- " ,round( sum(ifnull((case t.subject_type when 1 then t.money when 2 then t.money when 3 then t.money when 5 then t.money else 0 end),0))/ifnull(max(t2.rz_count),0),2) AS room_average_price\n" +
|
|
|
+ " ,ifnull(round(sum(ifnull((case t.subject_type when 1 then t.money when 2 then t.money when 3 then t.money when 5 then t.money else 0 end),0))/ifnull(max(t2.rz_count),0),2),0) AS room_average_price\n" +
|
|
|
"\t\t\t\t\t\tfrom bus_dict_item_info a\n" +
|
|
|
" LEFT JOIN (select room.customer_source,b.money,b.subject_type,b.room_id from bus_rooms_living_order room\n" +
|
|
|
" LEFT JOIN bus_order_fee b ON room.id=b.living_order_id and b.fee_type=2 and b.preferential_status=2 where 1=1 \n" +
|
|
|
"<if test='hotelId != null and hotelId !=\"\"'> and room.hotel_id = '${hotelId}' </if>" +
|
|
|
- "<if test='startTime != null'> and room.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and room.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='startTime != null'> and room.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and room.create_time <= '${endTime}' </if>" +
|
|
|
" ) t\n" +
|
|
|
" ON t.customer_source=a.id\n" +
|
|
|
" LEFT JOIN (\n" +
|
|
|
" select customer_source,count(0) as rz_count from bus_rooms_living_order where 1=1\n" +
|
|
|
"<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
- "<if test='startTime != null'> and create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='startTime != null'> and create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and create_time <= '${endTime}' </if>" +
|
|
|
" group by customer_source) t2\n" +
|
|
|
" ON t2.customer_source=a.id\n" +
|
|
|
" where 1=1 and a.dict_id='1639538915239743490'\n" +
|
|
|
- "<if test='hotelId != null and hotelId !=\"\"'> and of.hotel_id = '${hotelId}' </if>" +
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and a.hotel_id = '${hotelId}' </if>" +
|
|
|
" GROUP BY a.id</script>")
|
|
|
public List<HashMap<String, Object>> livingSourceStatList(@Param("hotelId") String hotelId, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
|
|
|
|
|
@@ -555,16 +557,16 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
"\t\t\t\t\t\t) a\n" +
|
|
|
" LEFT JOIN (select room.customer_type,b.money,b.subject_type,b.room_id from bus_rooms_living_order room\n" +
|
|
|
" INNER JOIN bus_order_fee b ON room.id=b.living_order_id and b.fee_type=2 and b.preferential_status=2 \n" +
|
|
|
- "\t\t\t\t\t\twhere 1=1'\n" +
|
|
|
+ "\t\t\t\t\t\twhere 1=1\n" +
|
|
|
"<if test='hotelId != null and hotelId !=\"\"'> and room.hotel_id = '${hotelId}' </if>" +
|
|
|
- "<if test='startTime != null'> and room.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and room.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='startTime != null'> and room.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and room.create_time <= '${endTime}' </if>" +
|
|
|
" ) t\n" +
|
|
|
" ON t.customer_type=a.id\n" +
|
|
|
" LEFT JOIN (\n" +
|
|
|
" select customer_type,count(0) as rz_count from bus_rooms_living_order\n" +
|
|
|
- "\t\t\t\t\t\twhere 1=1'\n" +
|
|
|
- "<if test='hotelId != null and hotelId !=\"\"'> and of.hotel_id = '${hotelId}' </if>" +
|
|
|
+ "\t\t\t\t\t\twhere 1=1\n" +
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
" group by customer_type) t2\n" +
|
|
|
" ON t2.customer_type=a.id\n" +
|
|
|
" GROUP BY a.id</script>")
|
|
|
@@ -582,23 +584,23 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
" ,sum(ifnull((case t.subject_type when 1 then t.money when 2 then t.money when 3 then t.money when 5 then t.money else 0 end),0)) AS room_money\n" +
|
|
|
" ,sum(ifnull((case t.subject_type when 6 then t.money when 7 then t.money else 0 end),0)) AS other_money\n" +
|
|
|
" ,sum(ifnull((case t.subject_type when 1 then t.money when 2 then t.money when 3 then t.money when 5 then t.money when 6 then t.money when 7 then t.money else 0 end),0)) AS sum_money\n" +
|
|
|
- " ,round(sum(ifnull((case t.subject_type when 1 then t.money when 2 then t.money when 3 then t.money when 5 then t.money else 0 end),0))/ifnull(max(t2.rz_count),0),2) AS room_average_price\n" +
|
|
|
+ " ,ifnull(round(sum(ifnull((case t.subject_type when 1 then t.money when 2 then t.money when 3 then t.money when 5 then t.money else 0 end),0))/ifnull(max(t2.rz_count),0),2),0) AS room_average_price\n" +
|
|
|
"\t\t\t\t\t\tfrom (\n" +
|
|
|
"\t\t\t\t\t\tselect 1 as id,'全天' as name\n" +
|
|
|
"\t\t\t\t\t\tunion select 2 as id,'钟点房' as name"+
|
|
|
"\t\t\t\t\t\t) a\n" +
|
|
|
- " LEFT JOIN (select room.customer_type,b.money,b.subject_type,b.room_id from bus_rooms_living_order room\n" +
|
|
|
+ " LEFT JOIN (select room.customer_type,room.living_type,b.money,b.subject_type,b.room_id from bus_rooms_living_order room\n" +
|
|
|
" INNER JOIN bus_order_fee b ON room.id=b.living_order_id and b.fee_type=2 and b.preferential_status=2 \n" +
|
|
|
- "\t\t\t\t\t\twhere 1=1'\n" +
|
|
|
+ "\t\t\t\t\t\twhere 1=1\n" +
|
|
|
"<if test='hotelId != null and hotelId !=\"\"'> and room.hotel_id = '${hotelId}' </if>" +
|
|
|
- "<if test='startTime != null'> and room.create_time >= #{startTime} </if>" +
|
|
|
- "<if test='endTime != null'> and room.create_time <= #{endTime} </if>" +
|
|
|
+ "<if test='startTime != null'> and room.create_time >= '${startTime}' </if>" +
|
|
|
+ "<if test='endTime != null'> and room.create_time <= '${endTime}' </if>" +
|
|
|
" ) t\n" +
|
|
|
" ON t.living_type=a.id\n" +
|
|
|
" LEFT JOIN (\n" +
|
|
|
" select living_type,count(0) as rz_count from bus_rooms_living_order\n" +
|
|
|
- "\t\t\t\t\t\twhere 1=1'\n" +
|
|
|
- "<if test='hotelId != null and hotelId !=\"\"'> and of.hotel_id = '${hotelId}' </if>" +
|
|
|
+ "\t\t\t\t\t\twhere 1=1\n" +
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
" group by living_type) t2\n" +
|
|
|
" ON t2.living_type=a.id\n" +
|
|
|
" GROUP BY a.id</script>")
|
|
|
@@ -633,7 +635,7 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
"where 1=1\n" +
|
|
|
"and b.fee_type=2 and b.preferential_status=2 and subject_type!=4\n" +
|
|
|
"and datediff(b.create_time,now())=0\n" +
|
|
|
- "<if test='roomId != null and roomId !=\"\"'> and b.roomId = '${roomId}' </if>" +
|
|
|
+ "<if test='roomId != null and roomId !=\"\"'> and b.room_id = '${roomId}' </if>" +
|
|
|
"</script>")
|
|
|
public List<HashMap<String, Object>> roomStatDeatilList(@Param("roomId") String roomId);
|
|
|
|