Browse Source

map

release_toaliyun_real
xhxu 4 years ago
parent
commit
d9b149a8a4
31 changed files with 348 additions and 9 deletions
  1. +134
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMapController.java
  2. +4
    -0
      mallinkService/src/main/java/com/iformall/mapper/AliBusinessCircleOrderMapper.java
  3. +4
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxBusinessCircleOrderMapper.java
  4. +3
    -2
      mallinkService/src/main/java/com/iformall/mapper/WxCardSpendMapper.java
  5. +4
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java
  6. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxMerchantMapper.java
  7. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java
  8. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java
  9. +3
    -0
      mallinkService/src/main/java/com/iformall/service/AliBusinessCircleOrderService.java
  10. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxBusinessCircleOrderService.java
  11. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxCardSpendService.java
  12. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java
  13. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java
  14. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxMerchantService.java
  15. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxRentContractService.java
  16. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxShopService.java
  17. +6
    -0
      mallinkService/src/main/java/com/iformall/service/impl/AliBusinessCircleOrderServiceImpl.java
  18. +6
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxBusinessCircleOrderServiceImpl.java
  19. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java
  20. +13
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  21. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java
  22. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  23. +9
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  24. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  25. +14
    -0
      mallinkService/src/main/resources/mapper/AliBusinessCircleOrderMapper.xml
  26. +15
    -0
      mallinkService/src/main/resources/mapper/WxBusinessCircleOrderMapper.xml
  27. +14
    -6
      mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml
  28. +23
    -0
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml
  29. +16
    -0
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml
  30. +27
    -1
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml
  31. +12
    -0
      mallinkService/src/main/resources/mapper/WxShopMapper.xml

+ 134
- 0
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMapController.java View File

@@ -0,0 +1,134 @@
package com.iformall.controller.basic;

import com.iformall.annotation.SystemControllerLog;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxCouponOrder;
import com.iformall.domain.po.WxCreditHistory;
import com.iformall.domain.vo.WxCardSpendVo;
import com.iformall.enums.EnumCouponType;
import com.iformall.service.*;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
* @author gongbiao
*/
@RestController
@RequestMapping("map")
public class WxMapController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxShopService wxShopService;

@Autowired
private WxMerchantService wxMerchantService;

@Autowired
private WxRentContractService wxRentContractService;

@Autowired
private WxCouponOrderService wxCouponOrderService;

@Autowired
private WxCardSpendService wxCardSpendService;

@Autowired
private WxBusinessCircleOrderService wxBusinessCircleOrderService;

@Autowired
private AliBusinessCircleOrderService aliBusinessCircleOrderService;

@Autowired
private WxCreditHistoryService wxCreditHistoryService;


@ApiOperation("根据id查询接口")
@GetMapping("/findShopById")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "店铺管理-id查询")
public ResultData findShopById(Long id) {
logger.debug("[" + getIpAddr() + "] WxMapController::findShopById");
return new ResultData(Result.SUCCESS, "查询成功", wxShopService.detailById(id));
}

@ApiOperation("根据id查询接口")
@GetMapping("/findMerchantByShop")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "店铺管理-id查询")
public ResultData findMerchantByShop(Long shopId) {
logger.debug("[" + getIpAddr() + "] WxMapController::findMerchantByShop");
return new ResultData(Result.SUCCESS, "查询成功", wxMerchantService.findMerchantByShop(shopId));
}

@ApiOperation("根据id查询接口")
@GetMapping("/findRentByShop")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "店铺管理-id查询")
public ResultData findRentByShop(Long shopId) {
logger.debug("[" + getIpAddr() + "] WxMapController::findRentByShop");
return new ResultData(Result.SUCCESS, "查询成功", wxRentContractService.findRentByShop(shopId));
}

@ApiOperation("根据id查询接口")
@GetMapping("/findStatisticsByShop")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "店铺管理-id查询")
public ResultData findStatisticsByShop(Long shopId, Date startDate, Date endDate) {
logger.debug("[" + getIpAddr() + "] WxMapController::findStatisticsByShop");
Map<String, Object> resultMap = new HashMap<>();
Map<String, Object> merchantByShop = wxMerchantService.findMerchantByShop(shopId);
if(merchantByShop != null && merchantByShop.get("id") != null){
String tenantId = merchantByShop.get("tenantId").toString();
String parentTenantId = "";
if(merchantByShop.get("parentTenantId") != null){
parentTenantId = merchantByShop.get("parentTenantId").toString();
}

Long mercherId = Long.parseLong(merchantByShop.get("id").toString());
wxCouponOrderService.statisticsWriteOff(tenantId,mercherId,startDate,endDate,resultMap);

WxCardSpendVo wxCardSpend = new WxCardSpendVo();
wxCardSpend.setTenantId(tenantId);
wxCardSpend.setMerchantId(mercherId);
wxCardSpend.setStartdate(startDate);
wxCardSpend.setEnddate(endDate);
resultMap.put("sumRealPayment",wxCardSpendService.sumRealPayment(wxCardSpend));

Integer wxCircleSumPayment = wxBusinessCircleOrderService.sumCirclePayment(tenantId,mercherId,startDate,endDate);
Integer aliCircleSumPayment = aliBusinessCircleOrderService.sumCirclePayment(tenantId,mercherId,startDate,endDate);
resultMap.put("sumCirclePayment",wxCircleSumPayment + aliCircleSumPayment);

WxCouponOrder wxCouponOrder = new WxCouponOrder();
wxCouponOrder.setTenantId(tenantId);
wxCouponOrder.setSendMerchantId(mercherId);
wxCouponOrder.setStartTime(startDate);
wxCouponOrder.setEndTime(endDate);
wxCouponOrder.setCouponType(EnumCouponType.COUPON_TINGCHE.getCode());
resultMap.put("countTingche",wxCouponOrderService.findCount(wxCouponOrder));

WxCreditHistory wxCreditHistory = new WxCreditHistory();
wxCreditHistory.setTenantId(tenantId);
if(StringUtils.isNotBlank(parentTenantId)){
wxCreditHistory.setTenantId(parentTenantId);
}
wxCreditHistory.setMerchantId(mercherId);
wxCreditHistory.setStartTime(startDate);
wxCreditHistory.setEndTime(endDate);
resultMap.put("sumCreditAmount",wxCreditHistoryService.getIncrementCreditAmount(wxCreditHistory));
}
return new ResultData(Result.SUCCESS, "查询成功", resultMap);
}

}

+ 4
- 0
mallinkService/src/main/java/com/iformall/mapper/AliBusinessCircleOrderMapper.java View File

@@ -3,7 +3,9 @@ package com.iformall.mapper;

import com.iformall.common.CommonMapper;
import com.iformall.domain.po.AliBusinessCircleOrder;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;


@@ -41,4 +43,6 @@ public interface AliBusinessCircleOrderMapper extends CommonMapper<AliBusinessCi
*/
void updateOrderStatus(AliBusinessCircleOrder record);

Integer sumCirclePayment(@Param("tenantId")String tenantId, @Param("mercherId")Long mercherId,
@Param("startDate")Date startDate, @Param("endDate")Date endDate);
}

+ 4
- 0
mallinkService/src/main/java/com/iformall/mapper/WxBusinessCircleOrderMapper.java View File

@@ -2,7 +2,9 @@ package com.iformall.mapper;

import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxBusinessCircleOrder;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface WxBusinessCircleOrderMapper extends CommonMapper<WxBusinessCircleOrder, Long> {
@@ -44,4 +46,6 @@ public interface WxBusinessCircleOrderMapper extends CommonMapper<WxBusinessCirc
*/
void updateOrderStatus(WxBusinessCircleOrder record);

Integer sumCirclePayment(@Param("tenantId")String tenantId, @Param("mercherId")Long mercherId,
@Param("startDate")Date startDate, @Param("endDate")Date endDate);
}

+ 3
- 2
mallinkService/src/main/java/com/iformall/mapper/WxCardSpendMapper.java View File

@@ -26,6 +26,7 @@ public interface WxCardSpendMapper extends CommonMapper<WxCardSpend, Long> {
* POS
*/
int deleteForPrevCancel(WxCardSpend record);


Integer sumRealPayment(WxCardSpendVo wxCardSpend);
}

+ 4
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java View File

@@ -92,4 +92,8 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
void cardDefer(@Param("couponId")Long couponId,@Param("tenantId")String tenantId,@Param("expireTime")Date expireTime);
//查询待延期的idList
List<Long> cardDeferCouponOrderId(@Param("couponId")Long couponId,@Param("tenantId")String tenantId);

Integer findWriteOffCount(@Param("tenantId")String tenantId, @Param("mercherId")Long mercherId,
@Param("startDate")Date startDate, @Param("endDate")Date endDate,
@Param("couponType")Integer couponType);
}

+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxMerchantMapper.java View File

@@ -57,4 +57,6 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> {
List<WxMerchant> findFollowList(WxMerchant record);

int recordedAmount(WxMerchant record);

Map<String, Object> findMerchantByShop(@Param("shopId")Long shopId);
}

+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java View File

@@ -84,4 +84,6 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>
Integer getCanApplyCount(@Param("id") Long id);
List<Long> getMerchantIdsByStatuss(WxRentContract wxRentContract);

List<Map<String, Object>> findRentByShop(@Param("shopId")Long shopId);
}

+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java View File

@@ -41,5 +41,7 @@ public interface WxShopMapper extends CommonMapper<WxShop, String> {
void updateUnRentByIds(@Param("ids")List<Long> shopIds);

Map<String,Object> detailById(@Param("id") Long id);

// List<WxShop> selectBatchByIds(@Param("ids")List<Long> ids);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/AliBusinessCircleOrderService.java View File

@@ -8,6 +8,7 @@ import com.iformall.domain.po.base.TenantEntity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;

public interface AliBusinessCircleOrderService {
@@ -52,4 +53,6 @@ public interface AliBusinessCircleOrderService {
void updatePoints(AliBusinessCircleOrder record);

void exportData(AliBusinessCircleOrder circleOrder, HttpServletRequest request, HttpServletResponse response);

Integer sumCirclePayment(String tenantId, Long mercherId, Date startDate, Date endDate);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxBusinessCircleOrderService.java View File

@@ -7,6 +7,7 @@ import com.iformall.domain.po.base.TenantEntity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;

public interface WxBusinessCircleOrderService {
@@ -55,4 +56,6 @@ public interface WxBusinessCircleOrderService {
void updateIsPointsNotify(WxBusinessCircleOrder record);

void exportData(WxBusinessCircleOrder circleOrder, HttpServletRequest request, HttpServletResponse response);

Integer sumCirclePayment(String tenantId, Long mercherId, Date startDate, Date endDate);
}

+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxCardSpendService.java View File

@@ -111,4 +111,6 @@ public interface WxCardSpendService {
WxCardSpend cardSpendForPosPrePay(WxCardSpend record) throws MallinkException;
WxCardInfo cardSpendForPosPrePayCancel(WxCardInfo cardInfo, WxCardSpend record) throws MallinkException;
WxCardSpend cardSpendForPosPay(PromotionCalc scoreCreditCalc, WxCardSpend record, WxMerchant merchant, WxMerchantBUser buUser,Integer payWay) throws MallinkException;

Integer sumRealPayment(WxCardSpendVo wxCardSpend);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java View File

@@ -217,4 +217,7 @@ public interface WxCouponOrderService {

int findCount(WxCouponOrder wxCouponOrder,List<TenantEntity> tenantEntitys);

void statisticsWriteOff(String tenantId, Long mercherId, Date startDate, Date endDate, Map<String, Object> resultMap);

Integer findCount(WxCouponOrder wxCouponOrder);
}

+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java View File

@@ -86,4 +86,5 @@ public interface WxCreditHistoryService {

PageInfo<MerchantCreditRankingVo> listAsPageMcrv(WxCreditHistory record, Integer pageIndex, Integer pageSize);

long getIncrementCreditAmount(WxCreditHistory wxCreditHistory);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxMerchantService.java View File

@@ -18,6 +18,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
@@ -176,4 +177,6 @@ public interface WxMerchantService {
ResultData ttdisable(Long id);

ResultData ttstartusing(Long id);

Map<String,Object> findMerchantByShop(Long shopId);
}

+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxRentContractService.java View File

@@ -125,4 +125,5 @@ public interface WxRentContractService {
*/
boolean hasOtherValidContractShop(WxRentContract wxRentContract);

Map<String, Object> findRentByShop(Long shopId);
}

+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxShopService.java View File

@@ -79,4 +79,6 @@ public interface WxShopService {
* @param response
*/
void exportNotRentShop(WxShop wxShop, HttpServletRequest request, HttpServletResponse response);

Map<String,Object> detailById(Long id);
}

+ 6
- 0
mallinkService/src/main/java/com/iformall/service/impl/AliBusinessCircleOrderServiceImpl.java View File

@@ -359,4 +359,10 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder

}

@Override
public Integer sumCirclePayment(String tenantId, Long mercherId, Date startDate, Date endDate) {
Integer sumCirclePayment = aliBusinessCircleOrderMapper.sumCirclePayment(tenantId,mercherId,startDate,endDate);
return sumCirclePayment==null?0:sumCirclePayment;
}

}

+ 6
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxBusinessCircleOrderServiceImpl.java View File

@@ -372,5 +372,11 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe
excelService.exportExcel(list, null, "微信商圈交易", WxBusinessCircleOrder.class, "微信商圈交易.xlsx", response, false);
}

@Override
public Integer sumCirclePayment(String tenantId, Long mercherId, Date startDate, Date endDate) {
Integer sumCirclePayment = wxBusinessCircleOrderMapper.sumCirclePayment(tenantId,mercherId,startDate,endDate);
return sumCirclePayment==null?0:sumCirclePayment;
}


}

+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java View File

@@ -954,4 +954,9 @@ public class WxCardSpendServiceImpl implements WxCardSpendService {
}
return record;
}

@Override
public Integer sumRealPayment(WxCardSpendVo wxCardSpend) {
return wxCardSpendMapper.sumRealPayment(wxCardSpend);
}
}

+ 13
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java View File

@@ -1545,4 +1545,17 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
return count;
}

@Override
public void statisticsWriteOff(String tenantId, Long mercherId, Date startDate, Date endDate, Map<String, Object> resultMap) {

resultMap.put("couponWriteOff",wxCouponOrderMapper.findWriteOffCount(tenantId, mercherId, startDate, endDate, null));
resultMap.put("groupWriteOff",wxCouponOrderMapper.findWriteOffCount(tenantId, mercherId, startDate, endDate, EnumCouponType.COUPON_GROUP.getCode()));
resultMap.put("pressWriteOff",wxCouponOrderMapper.findWriteOffCount(tenantId, mercherId, startDate, endDate, EnumCouponType.COUPON_PRESS.getCode()));
}

@Override
public Integer findCount(WxCouponOrder wxCouponOrder) {
return wxCouponOrderMapper.findCount(wxCouponOrder);
}

}

+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java View File

@@ -156,6 +156,11 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCreditHistoryMapper.merchantCreditRanking(record));
}

@Override
public long getIncrementCreditAmount(WxCreditHistory wxCreditHistory) {
return wxCreditHistoryMapper.getIncrementCreditAmount(wxCreditHistory);
}

@Override
public PageInfo<WxCreditHistory> listAsPage(WxCreditHistory record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCreditHistoryMapper.findList(record));


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java View File

@@ -1140,4 +1140,9 @@ public class WxMerchantServiceImpl implements WxMerchantService {
return new ResultData();
}

@Override
public Map<String, Object> findMerchantByShop(Long shopId) {
return wxMerchantMapper.findMerchantByShop(shopId);
}

}

+ 9
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java View File

@@ -3183,6 +3183,15 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return exists;
}

@Override
public Map<String, Object> findRentByShop(Long shopId) {
List<Map<String, Object>> rentByShop = wxRentContractMapper.findRentByShop(shopId);
if(rentByShop != null && rentByShop.size() > 0){
return rentByShop.get(0);
}
return null;
}


public static void main(String[] args) {
String s = "{\"siteMoney\":\"2\",\"facilityMoney\":\"3\",\"administratorMoney\":\"4\"}";


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java View File

@@ -238,4 +238,9 @@ public class WxShopServiceImpl implements WxShopService {
String name = "未出租商铺列表";
excelService.exportExcel(notRentShopVoList, null, name, WxNotRentShopVo.class, name + ".xlsx", response, false);
}

@Override
public Map<String,Object> detailById(Long id) {
return wxShopMapper.detailById(id);
}
}

+ 14
- 0
mallinkService/src/main/resources/mapper/AliBusinessCircleOrderMapper.xml View File

@@ -212,4 +212,18 @@
where `id` = #{id} and `tenant_id` = #{tenantId}
</update>

<select id="sumCirclePayment" parameterType="java.util.HashMap" resultType="Integer">
select
IFNULL(SUM(`pay_amount`),0) as sum_pay_amount
from ali_business_circle_order
where `tenant_id` = #{tenantId}
and `merchant_id` = #{merchantId}
<if test=" null != startDate ">
AND `time_end` &gt;= #{startDate}
</if>
<if test=" null != endDate ">
AND `time_end` &lt;= #{endDate}
</if>
</select>

</mapper>

+ 15
- 0
mallinkService/src/main/resources/mapper/WxBusinessCircleOrderMapper.xml View File

@@ -244,4 +244,19 @@
where `id` = #{id} and `tenant_id` = #{tenantId}
</update>


<select id="sumCirclePayment" parameterType="java.util.HashMap" resultType="Integer">
select
IFNULL(SUM(`pay_amount`),0) as sum_pay_amount
from wx_business_circle_order
where `tenant_id` = #{tenantId}
and `merchant_id` = #{merchantId}
<if test=" null != startDate ">
AND `time_end` &gt;= #{startDate}
</if>
<if test=" null != endDate ">
AND `time_end` &lt;= #{endDate}
</if>
</select>

</mapper>

+ 14
- 6
mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml View File

@@ -372,12 +372,6 @@
<if test=" null != cardBeforeRealAmount ">
and cs.`card_before_real_amount` = #{cardBeforeRealAmount}
</if>
<if test=" null != createDate ">
and cs.`create_date` = #{createDate}
</if>
<if test=" null != updateDate ">
and cs.`update_date` = #{updateDate}
</if>
<if test=" null != payStatus ">
and cs.`pay_status` = #{payStatus}
</if>
@@ -464,5 +458,19 @@
group by cs.owner_id
</select>

<select id="sumRealPayment" parameterType="com.iformall.domain.vo.WxCardSpendVo" resultType="Integer">
select
IFNULL(SUM(cs.`real_payment`),0) as sum_real_payment
from wx_card_spend cs
where cs.`tenant_id` = #{tenantId}
and cs.`merchant_id` = #{merchantId}
<if test=" null != startdate ">
AND cs.`create_date` &gt;= #{startdate}
</if>
<if test=" null != enddate ">
AND cs.`create_date` &lt;= #{enddate}
</if>
</select>


</mapper>

+ 23
- 0
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml View File

@@ -403,6 +403,10 @@
and co.coupon_type = #{couponType}
</if>

<if test=" null != sendMerchantId ">
and co.send_merchant_id = #{sendMerchantId}
</if>

<if test=" 1 == couponOrderStatus">
<if test=" null != startTime">
and co.update_date &gt;= #{startTime}
@@ -1462,4 +1466,23 @@
select id from wx_coupon_order where coupon_id = #{couponId} and tenant_id = #{tenantId} and coupon_order_status in (4, 5)
</select>


<select id="findWriteOffCount" parameterType="java.util.HashMap" resultType="java.lang.Integer">
select count(co.id)
from wx_coupon_order co
left join wx_merchant_b_user mbu on co.b_user_id = mbu.id
where co.tenant_id = #{tenantId} and co.coupon_order_status = 1
and mbu.merchant_id = #{mercherId}
<if test=" null != startDate ">
AND co.update_date &gt;= #{startDate}
</if>
<if test=" null != endDate ">
AND co.update_date &lt;= #{endDate}
</if>

<if test=" null != couponType ">
and co.`coupon_type` = #{couponType}
</if>
</select>

</mapper>

+ 16
- 0
mallinkService/src/main/resources/mapper/WxMerchantMapper.xml View File

@@ -707,4 +707,20 @@
where id = #{id}
</update>


<select id="findMerchantByShop" parameterType="Long" resultType="hashmap">
select
m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`,
m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`type`,m.`is_public`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,
m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked,
b.name brandName,bu.title businessTitle,mc.corp_papers_register_number corpPapersRegisterNumber,mc.corp_papers_address corpPapersAddress
from wx_shop s
left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
left join wx_merchant m on ms.merchant_id=m.id
left join wx_brand b on m.brand = b.id
left join wx_business bu on m.business_id = bu.id
left join wx_merchant_corp mc on mc.merchant_id = m.id
where s.`id` = #{shopId}
</select>

</mapper>

+ 27
- 1
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml View File

@@ -766,7 +766,33 @@
<foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")">
#{statusItem}
</foreach>
</select>
</select>


<select id="findRentByShop" parameterType="Long" resultType="hashmap">
select
rc.`id`,rc.`merchant_id`,
rc.`shop_type_sub`,rc.`lease_purpose`,rc.`contractual_rules`,rc.`delivery_date`,rc.`delivery_grace_period`,rc.`opening_date`,rc.`business_hours`,rc.`scope_metre`,
rc.`price`,rc.`rental_start_date`,rc.`rental_end_date`,rc.`sign_date`,rc.`receive_period`,
rc.`tenant_id`,rc.`parent_tenant_id`,rc.`filepath`,rc.`status`,rc.`contract_number`,
rc.`first_party_bank_info`,rc.`second_party_bank_info`,rc.`second_party_tax_info`,
rc.`property_name`,rc.`property_fee`,rc.`fee_cycle`,rc.`water_fee`,rc.`electricity_fees`,
rc.`deposit`,rc.cashtype_content_lsit,rc.cashtype_lsit,rc.`pay_date`,rc.`is_del`,rc.`merchant_name`,
rc.`brand`,rc.`business_id`,rc.`shop_type`,rc.`shop_type_str`,rc.`updatetime`,rc.`createtime`,rc.`link_person`,rc.`link_phone`,rc.`link_address`,
rc.`pay_account`,rc.`filename`,rc.`lease`,rc.`type`,rc.`revenue`,rc.`adjust_ratio`,rc.`adjust_period`,rc.`pay_ratio`,
rc.`start_date`,rc.`end_date`,rc.`shop_name`,rc.`from_id`,
rc.`apply_status`,rc.`bank_name`,rc.`rent_shop_type`,rc.`fix_start_date`,rc.`fix_end_date`,
rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type,
rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,rc.bus_discount_ratio,rc.bus_discount_time
from wx_shop s
left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
left join wx_merchant m on ms.merchant_id=m.id
left join wx_rent_contract rc on rc.merchant_id = m.id and rc.is_del=0
where s.`id` = #{shopId}
and rc.`status` in (2,3)
and rc.`start_date` &lt;= now() and end_date >= now()
order by rc.`updatetime` desc;
</select>
</mapper>


+ 12
- 0
mallinkService/src/main/resources/mapper/WxShopMapper.xml View File

@@ -659,4 +659,16 @@
#{idItem}
</foreach>
</update>

<select id="detailById" parameterType="Long" resultType="hashmap">
select s.id id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,CONVERT(s.build_area,DECIMAL(10,2)) buildArea,
s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea,
s.status,b.building_name building,f.floor_name floor,s.manager,s.manager_phone managerPhone,
s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,rent,rent_unit,s.business_id as
businessId,s.create_date create_date
from wx_shop s
left join wx_mall_building b on s.building=b.id
left join wx_mall_floor f on s.floor=f.id
where s.`id` = #{id}
</select>
</mapper>

Loading…
Cancel
Save