发展基金相关实现-查询发展基金
This commit is contained in:
@@ -43,6 +43,12 @@
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.15</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.30</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.buy507.mall.mapper;
|
||||
|
||||
import com.buy507.mall.model.UmsDevelopmentFund;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author curry
|
||||
* @description 针对表【ums_development_fund(发展基金流水)】的数据库操作Mapper
|
||||
* @createDate 2025-02-17 13:41:58
|
||||
* @Entity com.buy507.mall.model.UmsDevelopmentFund
|
||||
*/
|
||||
public interface UmsDevelopmentFundMapper {
|
||||
|
||||
/**
|
||||
* 查询现金总和
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT SUM(cash_total) FROM ums_development_fund")
|
||||
BigDecimal getTotalCash();
|
||||
|
||||
/**
|
||||
* 查询积分总和
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT SUM(points_total) FROM ums_development_fund")
|
||||
Integer getTotalPoints();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.buy507.mall.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 发展基金流水
|
||||
* @TableName ums_development_fund
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UmsDevelopmentFund implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 现金
|
||||
*/
|
||||
private BigDecimal cashTotal;
|
||||
|
||||
/**
|
||||
* 积分
|
||||
*/
|
||||
private Integer pointsTotal;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UmsDevelopmentFund{" +
|
||||
"id=" + id +
|
||||
", cashTotal=" + cashTotal +
|
||||
", pointsTotal=" + pointsTotal +
|
||||
", updatedAt=" + updatedAt +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.buy507.mall.mapper.UmsDevelopmentFundMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.buy507.mall.model.UmsDevelopmentFund">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="cashTotal" column="cash_total" jdbcType="DECIMAL"/>
|
||||
<result property="pointsTotal" column="points_total" jdbcType="INTEGER"/>
|
||||
<result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
@@ -129,6 +129,9 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
@Autowired
|
||||
private RedisLock redisLock;
|
||||
|
||||
@Resource
|
||||
private UmsDevelopmentFundMapper umsDevelopmentFundMapper;
|
||||
|
||||
@Value("${jwt.tokenHead}")
|
||||
private String tokenHead;
|
||||
|
||||
@@ -619,6 +622,10 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
||||
result.setInviter(memberMapper.selectByPrimaryKey(teamLevel.getParentId()).getNickname());
|
||||
}
|
||||
|
||||
/*查询发展基金*/
|
||||
BigDecimal totalCash = umsDevelopmentFundMapper.getTotalCash();
|
||||
Integer totalPoints = umsDevelopmentFundMapper.getTotalPoints();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user