|
@@ -732,4 +732,77 @@ public interface SummaryMapper extends BaseMapper<PosOrderGoodsPayment> {
|
|
|
"<if test='payType != null and payType !=\"\"'> and b.pay_type = '${payType}' </if>" +
|
|
"<if test='payType != null and payType !=\"\"'> and b.pay_type = '${payType}' </if>" +
|
|
|
"</script>")
|
|
"</script>")
|
|
|
public List<HashMap<String, Object>> dayPayTypeExpendDetailList(@Param("payType") String payType);
|
|
public List<HashMap<String, Object>> dayPayTypeExpendDetailList(@Param("payType") String payType);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 收支情况近N天统计
|
|
|
|
|
+ * @param hotelId
|
|
|
|
|
+ * @param day 天数
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @Select("<script>select sum(money) as money,abs(sum(zc_money)) as zc_money,sum(money)-abs(sum(zc_money)) as jy_money from(\n" +
|
|
|
|
|
+ "select ifnull(sum(pay_money),0) as money,0 as zc_money from pos_order_goods_payment\n" +
|
|
|
|
|
+ "where 1=1\n" +
|
|
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
|
|
+ "and datediff(create_time,now())>-${day}\n" +
|
|
|
|
|
+ "UNION ALL\n" +
|
|
|
|
|
+ "select ifnull(sum(money),0) as money,0 as zc_money from bus_order_fee\n" +
|
|
|
|
|
+ "where 1=1\n" +
|
|
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
|
|
+ "and fee_type=2 and preferential_status=2 and subject_type!=5\n" +
|
|
|
|
|
+ "and datediff(create_time,now())>-${day}"+
|
|
|
|
|
+ "UNION ALL\n" +
|
|
|
|
|
+ "select 0 as money,ifnull(sum(money),0) as zc_money from bus_order_fee\n" +
|
|
|
|
|
+ "where 1=1\n" +
|
|
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
|
|
+ "and fee_type=2 and preferential_status=2 and subject_type=5 and custorer_order_remark='结账退款'\n" +
|
|
|
|
|
+ "and datediff(create_time,now())>-${day})t</script>")
|
|
|
|
|
+ public List<HashMap<String, Object>> _7DayFinanceSummary(@Param("hotelId") String hotelId,Integer day);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 收支情况本月统计
|
|
|
|
|
+ * @param hotelId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @Select("<script>select sum(money) as money,abs(sum(zc_money)) as zc_money,sum(money)-abs(sum(zc_money)) as jy_money from(\n" +
|
|
|
|
|
+ "select ifnull(sum(pay_money),0) as money,0 as zc_money from pos_order_goods_payment\n" +
|
|
|
|
|
+ "where 1=1\n" +
|
|
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
|
|
+ "and DATE_FORMAT(create_time,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m')\n" +
|
|
|
|
|
+ "UNION ALL\n" +
|
|
|
|
|
+ "select ifnull(sum(money),0) as money,0 as zc_money from bus_order_fee\n" +
|
|
|
|
|
+ "where 1=1\n" +
|
|
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
|
|
+ "and fee_type=2 and preferential_status=2 and subject_type!=5\n" +
|
|
|
|
|
+ "and DATE_FORMAT(create_time,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m')"+
|
|
|
|
|
+ "UNION ALL\n" +
|
|
|
|
|
+ "select 0 as money,ifnull(sum(money),0) as zc_money from bus_order_fee\n" +
|
|
|
|
|
+ "where 1=1\n" +
|
|
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
|
|
+ "and fee_type=2 and preferential_status=2 and subject_type=5 and custorer_order_remark='结账退款'\n" +
|
|
|
|
|
+ "and DATE_FORMAT(create_time,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m'))t</script>")
|
|
|
|
|
+ public List<HashMap<String, Object>> monthFinanceSummary(@Param("hotelId") String hotelId);
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 收支情况本年统计
|
|
|
|
|
+ * @param hotelId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @Select("<script>select sum(money) as money,abs(sum(zc_money)) as zc_money,sum(money)-abs(sum(zc_money)) as jy_money from(\n" +
|
|
|
|
|
+ "select ifnull(sum(pay_money),0) as money,0 as zc_money from pos_order_goods_payment\n" +
|
|
|
|
|
+ "where 1=1\n" +
|
|
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
|
|
+ "and DATE_FORMAT(create_time,'%Y')=DATE_FORMAT(CURDATE(),'%Y')\n" +
|
|
|
|
|
+ "UNION ALL\n" +
|
|
|
|
|
+ "select ifnull(sum(money),0) as money,0 as zc_money from bus_order_fee\n" +
|
|
|
|
|
+ "where 1=1\n" +
|
|
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
|
|
+ "and fee_type=2 and preferential_status=2 and subject_type!=5\n" +
|
|
|
|
|
+ "and DATE_FORMAT(create_time,'%Y')=DATE_FORMAT(CURDATE(),'%Y')"+
|
|
|
|
|
+ "UNION ALL\n" +
|
|
|
|
|
+ "select 0 as money,ifnull(sum(money),0) as zc_money from bus_order_fee\n" +
|
|
|
|
|
+ "where 1=1\n" +
|
|
|
|
|
+ "<if test='hotelId != null and hotelId !=\"\"'> and hotel_id = '${hotelId}' </if>" +
|
|
|
|
|
+ "and fee_type=2 and preferential_status=2 and subject_type=5 and custorer_order_remark='结账退款'\n" +
|
|
|
|
|
+ "and DATE_FORMAT(create_time,'%Y')=DATE_FORMAT(CURDATE(),'%Y'))t</script>")
|
|
|
|
|
+ public List<HashMap<String, Object>> yearFinanceSummary(@Param("hotelId") String hotelId);
|
|
|
}
|
|
}
|