yanghb
2023-04-24 a7b4edc7bcefc976de1c8bf8d371f1f9428ec4ca
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
36
37
38
39
<?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.OfflineTravelPaymentMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.OfflineTravelPayment">
        <id column="id" property="id"/>
        <result column="orderId" property="orderId"/>
        <result column="payType" property="payType"/>
        <result column="payMoney" property="payMoney"/>
        <result column="payTime" property="payTime"/>
        <result column="driverId" property="driverId"/>
        <result column="status" property="status"/>
        <result column="insertTime" property="insertTime"/>
    </resultMap>
 
 
    <select id="queryOfflineTravelPaymentList" resultType="com.stylefeng.guns.modular.system.warpper.BaseWarpper">
        select
        id,
        payMoney as amount,
        if(status = 1, '未到账', '已到账') as content,
        DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as `day`,
        DATE_FORMAT(payTime, '%H:%i:%s') as `data`
        from t_offline_travel_payment where driverId = #{driverId}
        <if test="null != start and '' != start and null != end and '' != end">
            and DATE_FORMAT(payTime, '%Y-%m-%d') between #{start} and #{end}
        </if>
        order by insertTime desc limit #{pageNum}, #{size}
    </select>
 
 
    <select id="getTotalMoney" resultType="double">
        select ifnull(sum(payMoney), 0) from t_offline_travel_payment where driverId = #{driverId} and status = 2
        <if test="null != start and '' != start and null != end and '' != end">
            and DATE_FORMAT(payTime, '%Y-%m-%d') between #{start} and #{end}
        </if>
    </select>
</mapper>