瀏覽代碼

Merge branch 'master' of http://49.4.53.36:3000/hotel/hotel-saas-backend

覃浩 2 年之前
父節點
當前提交
b69103a5ab

+ 18 - 0
jeecg-boot-base-core/src/main/java/org/jeecg/config/ApiVersion.java

@@ -0,0 +1,18 @@
+package org.jeecg.config;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface ApiVersion {
+
+    /**
+     * 接口版本号(对应swagger中的group)
+     * @return String[]
+     */
+    String[] group();
+
+}

+ 5 - 0
jeecg-boot-base-core/src/main/java/org/jeecg/config/ApiVersionConstant.java

@@ -0,0 +1,5 @@
+package org.jeecg.config;
+
+public interface ApiVersionConstant {
+    String FAP_MALLAPI101 = "mall-api1.0.1";
+}

+ 23 - 0
jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger2Config.java

@@ -31,6 +31,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
 import java.lang.reflect.Field;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -79,6 +80,28 @@ public class Swagger2Config implements WebMvcConfigurer {
                 .globalOperationParameters(setHeaderToken());
     }
 
+    @Bean
+    public Docket vMallApi101(){
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .groupName(ApiVersionConstant.FAP_MALLAPI101)
+                .select()
+                .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
+                .apis(input -> {
+                    ApiVersion apiVersion = input.getHandlerMethod().getMethodAnnotation(ApiVersion.class);
+                    if(apiVersion!=null&& Arrays.asList(apiVersion.group()).contains(ApiVersionConstant.FAP_MALLAPI101)){
+                        return true;
+                    }
+                    return false;
+                })//controller路径
+                .paths(PathSelectors.any())
+                .build()
+                .securitySchemes(Collections.singletonList(securityScheme()))
+                .securityContexts(securityContexts())
+                .globalOperationParameters(setHeaderToken());
+    }
+
+
     /***
      * oauth2配置
      * 需要增加swagger授权回调地址

+ 9 - 6
jeecg-mall-api/src/main/java/interceptor/ThirdSessionInterceptor.java

@@ -48,12 +48,15 @@ public class ThirdSessionInterceptor implements HandlerInterceptor {
 //		if (!(handler instanceof HandlerMethod)) {
 //			return super.preHandle(request, response, handler);
 //		}
-		HandlerMethod method = (HandlerMethod) handler;
-		//判断访问的control是否添加ApiLogin注解
-		ApiLogin apiLogin = method.getMethodAnnotation(ApiLogin.class);
-		String appIdHeader = request.getHeader("app-id");
-		//小程序端的所有接口需要登录才能访问,校验thirdSession
-		return this.judeSession(request, response, apiLogin);
+		if ((handler instanceof HandlerMethod)) {
+			HandlerMethod method = (HandlerMethod) handler;
+			//判断访问的control是否添加ApiLogin注解
+			ApiLogin apiLogin = method.getMethodAnnotation(ApiLogin.class);
+			String appIdHeader = request.getHeader("app-id");
+			//小程序端的所有接口需要登录才能访问,校验thirdSession
+			return this.judeSession(request, response, apiLogin);
+		}
+		return Boolean.TRUE;
 	}
 
 	/**

+ 3 - 0
jeecg-mall-api/src/main/java/org/jeecg/modules/bus/controller/CouponsCashUsedController.java

@@ -26,6 +26,8 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.TenantContextHolder;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.config.ApiVersion;
+import org.jeecg.config.ApiVersionConstant;
 import org.jeecg.modules.business.dto.CouponsGenerateDto;
 import org.jeecg.modules.business.dto.PostDataDto;
 import org.jeecg.modules.business.dto.ProvideCouponsUsedDto;
@@ -85,6 +87,7 @@ public class CouponsCashUsedController extends WebConfig {
     @ApiOperation(value = "获取我的优惠券分页列表查询", notes = "获取我的优惠券分页列表查询")
     @GetMapping(value = "/list")
     @ApiLogin
+    @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
     public Result<IPage<BusMarketCouponsCashUsed>> queryPageList(BusMarketCouponsCashUsed busMarketCouponsCashUsed,
                                                                  @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                                  @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,

+ 3 - 0
jeecg-mall-api/src/main/java/org/jeecg/modules/bus/controller/CouponsUsedController.java

@@ -18,6 +18,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.TenantContextHolder;
+import org.jeecg.config.ApiVersion;
+import org.jeecg.config.ApiVersionConstant;
 import org.jeecg.modules.business.dto.CouponsGenerateDto;
 import org.jeecg.modules.business.dto.PostDataDto;
 import org.jeecg.modules.business.dto.ProvideCouponsUsedDto;
@@ -58,6 +60,7 @@ public class CouponsUsedController extends WebConfig {
    @ApiOperation(value="获取我的可用优惠券分页列表查询", notes="获取我的可用优惠券分页列表查询")
    @PostMapping(value = "/list")
    @ApiLogin
+   @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
    public Result<IPage<BusMarketCouponsUsed>> queryPageList(BusMarketCouponsUsed busMarketCouponsUsed,
                                   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,

+ 48 - 2
jeecg-mall-api/src/main/java/org/jeecg/modules/bus/controller/HotelController.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.bus.controller;
 import annotation.ApiLogin;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -8,6 +9,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
@@ -19,9 +21,14 @@ import org.jeecg.common.system.util.JwtUtil;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.TenantContextHolder;
 import org.jeecg.common.util.TokenUtils;
+import org.jeecg.config.ApiVersion;
+import org.jeecg.config.ApiVersionConstant;
 import org.jeecg.modules.business.entity.BusHotel;
 import org.jeecg.modules.business.service.IBusHotelService;
 import org.jeecg.modules.business.util.MapUtil;
+import org.jeecg.modules.rooms.entity.CesRoomLayout;
+import org.jeecg.modules.rooms.service.CesRoomLayoutPriceServiceImpl;
+import org.jeecg.modules.rooms.service.CesRoomLayoutServiceImpl;
 import org.jeecg.modules.system.entity.SysTenant;
 import org.jeecg.modules.system.service.ISysTenantService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,17 +54,20 @@ import java.util.Map;
 public class HotelController extends  WebConfig {
    @Resource
    private IBusHotelService busHotelService;
+   @Resource
+   private CesRoomLayoutServiceImpl cesRoomLayoutService;
 
     /**
-     * 列表查询
+     * 酒店列表查询
      *
      * @param busHotel
      * @param req
      * @return
      */
-    @ApiOperation(value="bus_hotel-列表查询", notes="bus_hotel-列表查询")
+    @ApiOperation(value="酒店列表查询", notes="酒店列表查询")
     @GetMapping(value = "/queryList")
     @ApiLogin
+    @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
     public Result<List<BusHotel>> queryList(BusHotel busHotel, HttpServletRequest req) {
         QueryWrapper<BusHotel> queryWrapper = QueryGenerator.initQueryWrapper(busHotel, req.getParameterMap());
         String tenantId = TenantContextHolder.getTenantId();
@@ -70,4 +80,40 @@ public class HotelController extends  WebConfig {
         List<BusHotel> list = busHotelService.list(queryWrapper);
         return Result.OK(list);
     }
+
+    @ApiOperation(value="可入住酒店列表", notes="可入住酒店列表")
+    @GetMapping(value = "/can-use-hotel-list")
+    @ApiLogin
+    @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
+    public Result<List<BusHotel>> getCanUseHotelList(BusHotel busHotel, HttpServletRequest req) {
+        LambdaQueryWrapper<BusHotel> queryWrapper = QueryGenerator.initQueryWrapper(busHotel, req.getParameterMap()).lambda();
+        if (StringUtils.isNotBlank(busHotel.getKeyWord())) {
+            queryWrapper.and(t -> {
+                t.like(BusHotel::getAddress, busHotel.getKeyWord());
+                t.or().like(BusHotel::getName, busHotel.getKeyWord());
+                t.or().like(BusHotel::getIntroduction, busHotel.getKeyWord());
+            });
+        }
+        String tenantId = TenantContextHolder.getTenantId();
+        if (StringUtils.isNotBlank(tenantId)) {
+            queryWrapper.eq(BusHotel::getTenantId, tenantId);
+        }
+        queryWrapper.eq(BusHotel::getStatus, 1);
+        queryWrapper.eq(BusHotel::getCheckStatus, 1);
+        queryWrapper.eq(BusHotel::getDelFlag, 0);
+        List<BusHotel> list = busHotelService.list(queryWrapper);
+        list.forEach(t -> {
+            LambdaQueryWrapper<CesRoomLayout> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+            lambdaQueryWrapper.eq(CesRoomLayout::getHotelId, t.getId());
+            lambdaQueryWrapper.orderByAsc(CesRoomLayout::getMarketPrice).last("limit 1");
+            CesRoomLayout cesRoomLayout = cesRoomLayoutService.getOne(lambdaQueryWrapper);
+            if (cesRoomLayout != null) {
+                t.setMinPrice(cesRoomLayout.getMarketPrice());
+            }
+            if (ObjectUtils.isNotEmpty(busHotel.getLat()) && ObjectUtils.isNotEmpty(busHotel.getLng())) {
+
+            }
+        });
+        return Result.OK(list);
+    }
 }

+ 4 - 0
jeecg-mall-api/src/main/java/org/jeecg/modules/bus/controller/MemberCardController.java

@@ -20,6 +20,8 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.TenantContextHolder;
 import org.jeecg.common.util.TokenUtils;
+import org.jeecg.config.ApiVersion;
+import org.jeecg.config.ApiVersionConstant;
 import org.jeecg.modules.business.dto.UserGroupDto;
 import org.jeecg.modules.business.dto.UserLabelDto;
 import org.jeecg.modules.business.entity.*;
@@ -67,6 +69,7 @@ public class MemberCardController extends WebConfig {
 	@ApiOperation(value="bus_member_card-分页列表查询", notes="bus_member_card-分页列表查询")
 	@GetMapping(value = "/list")
 	@ApiLogin
+	@ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
 	public Result<IPage<BusMemberCard>> queryPageList(BusMemberCard busMemberCard,
 								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
@@ -118,6 +121,7 @@ public class MemberCardController extends WebConfig {
 	@ApiOperation(value="添加会员卡", notes="添加会员卡")
 	@PostMapping(value = "/add")
 	@ApiLogin
+	@ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
 	public Result<String> add(@RequestBody BusMemberCard busMemberCard) {
 		String tenantId = TenantContextHolder.getTenantId();
 		String userId = ThirdSessionHolder.getUserId();

+ 5 - 1
jeecg-mall-api/src/main/java/org/jeecg/modules/bus/controller/ParamXcxRoomController.java

@@ -16,12 +16,15 @@ import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.TokenUtils;
+import org.jeecg.config.ApiVersion;
+import org.jeecg.config.ApiVersionConstant;
 import org.jeecg.modules.business.entity.BusParamXcxRoom;
 import org.jeecg.modules.business.service.IBusParamXcxRoomService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Arrays;
@@ -34,7 +37,7 @@ import java.util.Arrays;
 @RequestMapping("/mall-api/param-xcx-room")
 @Slf4j
 public class ParamXcxRoomController extends WebConfig {
-   @Autowired
+   @Resource
    private IBusParamXcxRoomService busParamXcxRoomService;
 
     /**
@@ -45,6 +48,7 @@ public class ParamXcxRoomController extends WebConfig {
      */
     @ApiOperation(value="小程序客房服务设置-通过hotelId查询", notes="小程序客房服务设置-通过hotelId查询")
     @GetMapping(value = "/queryByHotelId")
+    @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
     public Result<BusParamXcxRoom> queryByHotelId(@RequestParam(name="hotelId") String hotelId) {
         if (StringUtils.isBlank(hotelId)) {
             return Result.error("暂未入住酒店");

+ 6 - 0
jeecg-mall-api/src/main/java/org/jeecg/modules/wxuser/controller/WxUserController.java

@@ -24,6 +24,8 @@ import org.jeecg.common.system.query.MatchTypeEnum;
 import org.jeecg.common.system.query.QueryCondition;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.constant.VxeSocketConst;
+import org.jeecg.config.ApiVersion;
+import org.jeecg.config.ApiVersionConstant;
 import org.jeecg.modules.wxuser.dto.LoginDto;
 import org.jeecg.modules.wxuser.dto.WxOpenDataDto;
 import org.jeecg.modules.wxuser.entity.ThirdSession;
@@ -32,6 +34,7 @@ import org.jeecg.modules.wxuser.service.IUserInfoService;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -45,6 +48,7 @@ import java.util.*;
 @Slf4j
 @RestController
 @AllArgsConstructor
+@EnableSwagger2
 @RequestMapping("/mall-api/wxuser")
 public class WxUserController extends WebConfig {
 
@@ -58,6 +62,7 @@ public class WxUserController extends WebConfig {
      */
     @ApiOperation(value = "小程序用户登录")
     @PostMapping("/ma-login")
+    @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
     public Result<UserInfo> loginMa(HttpServletRequest request, @RequestBody LoginDto dto) {
         try {
             String appId = request.getHeader("app-id");
@@ -81,6 +86,7 @@ public class WxUserController extends WebConfig {
     @ApiOperation(value = "通过小程序授权手机号一键登录商城")
     @PostMapping("/ma-phone-login")
     @ApiLogin
+    @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
     public Result loginByPhoneMa(HttpServletRequest request, @RequestBody WxOpenDataDto dto) {
         try {
             String token = request.getHeader("third-session");

+ 22 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusHotel.java

@@ -3,10 +3,8 @@ package org.jeecg.modules.business.entity;
 import java.io.Serializable;
 import java.util.Date;
 import java.math.BigDecimal;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
+
+import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -264,4 +262,24 @@ public class BusHotel implements Serializable {
     @Excel(name = "酒店标签", width = 15)
     @ApiModelProperty(value = "酒店标签")
     private String tagList;
+
+    @ApiModelProperty(value = "搜索关键词")
+    @TableField(exist = false)
+    private String keyWord;
+
+    @ApiModelProperty(value = "最低价格")
+    @TableField(exist = false)
+    private BigDecimal minPrice;
+
+    @ApiModelProperty(value = "评分")
+    @TableField(exist = false)
+    private Integer score;
+
+    @ApiModelProperty(value = "评论数")
+    @TableField(exist = false)
+    private BigDecimal commentNum;
+
+    @ApiModelProperty(value = "距离")
+    @TableField(exist = false)
+    private BigDecimal distance;
 }

+ 43 - 41
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/finance/mapper/SummaryMapper.java

@@ -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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and ogp.create_time &lt;= #{endTime} </if>" +
+            "<if test='hotelId != null and hotelId !=\"\"'> and h.id = '${hotelId}' </if>" +
+            "<if test='startTime != null'> and ogp.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and ogp.create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and of.create_time &lt;= #{endTime} </if>" +
+            "<if test='hotelId != null and hotelId !=\"\"'> and h.id = '${hotelId}' </if>" +
+            "<if test='startTime != null'> and of.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and of.create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and ogp.create_time &lt;= #{endTime} </if>" +
+            "<if test='hotelId != null and hotelId !=\"\"'> and h.id = '${hotelId}' </if>" +
+            "<if test='startTime != null'> and ogp.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and ogp.create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and of.create_time &lt;= #{endTime} </if>" +
+            "<if test='hotelId != null and hotelId !=\"\"'> and h.id = '${hotelId}' </if>" +
+            "<if test='startTime != null'> and of.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and of.create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and ogp.create_time &lt;= #{endTime} </if>" +
+            "<if test='startTime != null'> and ogp.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and ogp.create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and of.create_time &lt;= #{endTime} </if>" +
+            "<if test='startTime != null'> and of.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and of.create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and ogp.create_time &lt;= #{endTime} </if>" +
+            "<if test='startTime != null'> and ogp.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and ogp.create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and of.create_time &lt;= #{endTime} </if>" +
+            "<if test='startTime != null'> and of.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and of.create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and room.create_time &lt;= #{endTime} </if>" +
+            "<if test='startTime != null'> and room.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and room.create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and create_time &lt;= #{endTime} </if>" +
+            "<if test='startTime != null'> and create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and room.create_time &lt;= #{endTime} </if>" +
+            "<if test='startTime != null'> and room.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and room.create_time &lt;= '${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 &gt;= #{startTime} </if>" +
-            "<if test='endTime != null'> and room.create_time &lt;= #{endTime} </if>" +
+            "<if test='startTime != null'> and room.create_time &gt;= '${startTime}' </if>" +
+            "<if test='endTime != null'> and room.create_time &lt;= '${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);