From 57701ac966cb4a363ebd7dc22e346ebbe578a615 Mon Sep 17 00:00:00 2001
From: phpcjl <phpcjl@gmail.com>
Date: 星期三, 18 十二月 2024 11:38:59 +0800
Subject: [PATCH] 1
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopBalanceStatementMapper.java | 5 ++++-
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopBalanceStatementMapper.xml | 27 +++++++++++++++++++++++++++
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShopBalanceStatement.java | 14 ++++++++++++++
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopBalanceStatementServiceImpl.java | 12 +-----------
4 files changed, 46 insertions(+), 12 deletions(-)
diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShopBalanceStatement.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShopBalanceStatement.java
index 526c5c4..377b1c6 100644
--- a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShopBalanceStatement.java
+++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShopBalanceStatement.java
@@ -3,11 +3,13 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
@@ -82,4 +84,16 @@
@TableField(exist = false)
@Excel(name = "联系电话")
private String phone;
+
+ @ApiModelProperty(value = "开始时间")
+ @TableField(exist = false)
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private String startTime;
+
+ @ApiModelProperty(value = "结束时间")
+ @TableField(exist = false)
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private String endTime;
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopBalanceStatementMapper.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopBalanceStatementMapper.java
index 4b0e3c4..5bd4e28 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopBalanceStatementMapper.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopBalanceStatementMapper.java
@@ -9,7 +9,7 @@
/**
* <p>
- * Mapper 接口
+ * Mapper 接口
* </p>
*
* @author luodangjia
@@ -17,4 +17,7 @@
*/
public interface ShopBalanceStatementMapper extends BaseMapper<ShopBalanceStatement> {
List<ShopBalanceStatement> findLatestChangeByType(ShopBalanceStatement shopBalanceStatement);
+
+ IPage<ShopBalanceStatement> queryShopBalanceStatementPage(@Param("page") IPage<ShopBalanceStatement> page,
+ @Param("bs") ShopBalanceStatement shopBalanceStatement);
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopBalanceStatementServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopBalanceStatementServiceImpl.java
index 5e53178..4365edb 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopBalanceStatementServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopBalanceStatementServiceImpl.java
@@ -52,17 +52,7 @@
.add(shopCommissionStatisticsVO.getTotalSubordinateCommission())
.add(shopCommissionStatisticsVO.getTotalServiceCharge()));
- IPage<ShopBalanceStatement> statementIPage = page(page, new LambdaQueryWrapper<ShopBalanceStatement>());
- List<ShopBalanceStatement> records = statementIPage.getRecords();
- List<Integer> shopIds = records.stream().map(ShopBalanceStatement::getShopId).collect(Collectors.toList());
- List<Shop> shopList = shopService.listByIds(shopIds);
- records.forEach(st -> {
- shopList.stream().filter(shop -> shop.getId().equals(st.getShopId())).findFirst().ifPresent(shop -> {
- st.setShopName(shop.getName());
- st.setShopManagerName(shop.getShopManager());
- st.setPhone(shop.getPhone());
- });
- });
+ IPage<ShopBalanceStatement> statementIPage = this.baseMapper.queryShopBalanceStatementPage(page, shopBalanceStatement);
shopCommissionStatisticsVO.setStatementIPage(statementIPage);
return shopCommissionStatisticsVO;
}
diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopBalanceStatementMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopBalanceStatementMapper.xml
index 3def01d..5702848 100644
--- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopBalanceStatementMapper.xml
+++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopBalanceStatementMapper.xml
@@ -30,4 +30,31 @@
t_shop_balance_statement
) AS subquery
</select>
+ <select id="queryShopBalanceStatementPage" resultType="com.ruoyi.other.api.domain.ShopBalanceStatement">
+ SELECT
+ tsbs.*,
+ ts.`name` shopName,
+ ts.shop_manager shopManagerName,
+ ts.phone
+ FROM
+ t_shop_balance_statement tsbs
+ INNER JOIN t_shop ts ON ts.id = tsbs.shop_id AND ts.del_flag = 0
+ <where>
+ <if test="bs.shopName != null and bs.shopName != ''">
+ AND ts.`name` like concat('%', #{bs.shopName}, '%')
+ </if>
+ <if test="bs.shopManagerName != null and bs.shopManagerName != ''">
+ AND ts.shop_manager like concat('%', #{bs.shopManagerName}, '%')
+ </if>
+ <if test="bs.phone != null and bs.phone != ''">
+ AND ts.phone like concat('%', #{bs.phone}, '%')
+ </if>
+ <if test="bs.type != null">
+ AND tsbs.type = #{bs.type}
+ </if>
+ <if test="bs.startTime != null and bs.endTime != null">
+ AND tsbs.create_time BETWEEN #{bs.startTime} AND #{bs.endTime}
+ </if>
+ </where>
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.7.1