统计报表,thymleaf表格统计(框架:若依RuoyiFast)

本文介绍了使用若依RuoyiFast框架在学员管理系统中进行缴费统计的方法,包括后端Java代码和前端HTML的实现细节,旨在展示如何在该框架下生成统计报表。

项目:学员管理系统的缴费统计

框架:若依RuoyiFast

效果图:

Java代码 

/**
 * author 阿卜QQ932696181
 * date 2023-08-03
 * 学员缴费信息统计
 */

@Controller
@RequestMapping("/lxmember/stupaymentstatistic")
public class StuPaymentStatistic extends BaseController {

    private String prefix = "lxmember/stupayment";

    @Autowired
    private IStuPaymentService stuPaymentService;

    @RequiresPermissions("lxmember:stupaymentstatistic:view")
    @GetMapping()
    public String stupayment(ModelMap mmp)
    {
        List<PaymentStatisticVo> paymentStatisticVoList = stuPaymentService.selectStuPaymentStatistic();
        mmp.put("paymentStatisticVoList",paymentStatisticVoList);
        return prefix + "/statistic1";
    }

}
 <select id="selectStuPaymentStatistic"
            resultType="com.ruoyi.project.lxmember.stupayment.domain.vo.PaymentStatisticVo">
        SELECT SUBSTRING(create_time,1,7) as paydate
             ,sum(case payment_type when '1' then payment_amount else 0 end) as paymoney
	    ,sum(case payment_type when '2' then payment_amount else 0 end) as payonmoney
	    ,sum(case payment_type when '3' then payment_amount else 0 end) as payexammoney
        FROM `lxl_stu_payment`
        group by SUBSTRING(create_time,1,7)
    </select>

HTML前端代码

<div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h2>缴费统计</h2>
                </div>
                <div class="ibox-content">
                    <table class="table" style="text-align: center">
                        <thead >
                            <th style="text-align: center">编号</th>
                            <th style="text-align: center">时间</th>
                            <th style="text-align: center">费用合计</th>
                            <th style="text-align: center">其中首次缴费</th>
                            <th style="text-align: center">其中续费</th>
                            <th style="text-align: center">其中考试费用</th>
                        </thead>
                        <tbody>
                            <tr th:each="item,paymentStatisticVoListStat:${paymentStatisticVoList}">
                                <td><span th:text="${paymentStatisticVoListStat.index+1}"></span></td>
                                <td><span th:text="${item.paydate}"></span></td>
                                <td><span th:text="${item.paymoney+item.payonmoney+item.payexammoney}"></span></td>
                                <td><span th:text="${item.paymoney}"></span></td>
                                <td><span th:text="${item.payonmoney}"></span></td>
                                <td><span th:text="${item.payexammoney}"></span></td>
                            </tr>
                        <tfoot>
                        <tr style="color: red">
                            <td colspan="2">总合计</td>
                            <td>
                                <span th:text="${#aggregates.sum(paymentStatisticVoList.![paymoney + payonmoney + payexammoney])}"></span>
                            </td>
                            <td>
                                <span th:text="${#aggregates.sum(paymentStatisticVoList.![paymoney])}"></span>
                            </td>
                            <td>
                                <span th:text="${#aggregates.sum(paymentStatisticVoList.![payonmoney])}"></span>
                            </td>
                            <td>
                                <span th:text="${#aggregates.sum(paymentStatisticVoList.![payexammoney])}"></span>
                            </td>
                        </tr>
                        </tfoot>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

若对你有帮助请点赞,有建议请留下,勿喷,谢谢!!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值