发展基金相关实现-查询发展基金

This commit is contained in:
2025-02-17 14:18:25 +08:00
committed by axindata
parent 0b2d5f65f6
commit 2a009e9037
5 changed files with 111 additions and 3 deletions

View File

@@ -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();
}

View File

@@ -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 +
'}';
}
}

View File

@@ -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>