Pu Zhibing
2025-03-28 8b09fbc19a96b57bf1d0e4d7c79b51a76aeca554
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?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.stylefeng.guns.modular.system.dao.SettlementRecordMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.SettlementRecord">
        <id column="id" property="id"/>
        <result column="day" property="day"/>
        <result column="driverId" property="driverId"/>
        <result column="type" property="type"/>
        <result column="paymentStatus" property="paymentStatus"/>
        <result column="payMoney" property="payMoney"/>
        <result column="payType" property="payType"/>
        <result column="code" property="code"/>
        <result column="insertTime" property="insertTime"/>
    </resultMap>
 
 
    <select id="queryHistoricalSettlement" resultType="map">
        select
        DATE_FORMAT(`day`, '%Y-%m-%d') as createTime,
        payMoney as price,
        `type`,
        payType,
        balanceType
        from t_settlement_record where driverId = #{driverId} and paymentStatus = 2 order by insertTime desc limit #{pageNum}, #{size}
    </select>
    
    
    <select id="queryHistoricalSettlementTotal" resultType="double">
        select
        ifnull(sum(payMoney), 0) as price
        from t_settlement_record where driverId = #{driverId} and paymentStatus = 2 group by driverId
    </select>
</mapper>