liurunyu
2025-02-06 5872dc75850327c61d2b5b9f6bd1f3b46d325990
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?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.dy.pipIrrGlobal.daoAllRound.Ar4StatisticsMapper">
 
    <select id="openCloseRecords" resultType="com.dy.pipIrrGlobal.voAllRound.VoArIntakeOpenCloseValve">
        select
        tb.intake_id as intakeId,
        sec.id as clientId,
        sec.name as clientName,
        sec.address as clientAddr,
        tb.op_dt as openTime,
        tb.op_type as opType,
        tb.op_ic_card_no as openIcNum,
        tb.op_remain_money as openRemainMoney,
        tb.cl_dt as closeTime,
        tb.cl_type as clType,
        tb.cl_ic_card_no as closeIcNum,
        tb.cl_remain_money as closeRemainMoney,
        tb.cl_this_time as thisTime,
        tb.cl_this_amount as thisAmount,
        tb.cl_this_money as thisMoney
        from rm_open_close_valve_history tb
        left join se_client sec on tb.client_id = sec.id
        where tb.intake_id = #{intakeId, jdbcType=BIGINT}
        ORDER BY tb.id DESC
        <trim prefix="limit ">
            <if test="start != null and count != null">
                #{start, javaType=Integer, jdbcType=INTEGER}, #{count, javaType=Integer, jdbcType=INTEGER}
            </if>
        </trim>
    </select>
 
 
    <select id="lossDayRecords" resultType="com.dy.pipIrrGlobal.voAllRound.VoArIntakeLossDay">
        select
        tb.intake_id as intakeId,
        tb.dt AS dt,
        tb.loss_amount AS loss
        from rm_loss_day tb
        where intake_id = #{intakeId, jdbcType=BIGINT}
        ORDER BY tb.id DESC
        <trim prefix="limit ">
            <if test="start != null and count != null">
                #{start, javaType=Integer, jdbcType=INTEGER}, #{count, javaType=Integer, jdbcType=INTEGER}
            </if>
        </trim>
    </select>
 
 
    <select id="lossMonthRecords" resultType="com.dy.pipIrrGlobal.voAllRound.VoArIntakeLossMonth">
        select
        tb.intake_id as intakeId,
        CONCAT(tb.year, '-', tb.month) AS dt,
        tb.amount AS loss
        from st_loss_month tb
        where intake_id = #{intakeId, jdbcType=BIGINT}
        ORDER BY tb.id DESC
        <trim prefix="limit ">
            <if test="start != null and count != null">
                #{start, javaType=Integer, jdbcType=INTEGER}, #{count, javaType=Integer, jdbcType=INTEGER}
            </if>
        </trim>
    </select>
 
 
 
    <select id="amountDayRecords" resultType="com.dy.pipIrrGlobal.voAllRound.VoArIntakeAmountDay">
        select
        tb.intake_id as intakeId,
        tb.dt AS dt,
        tb.amount AS amount,
        tb.money AS money,
        tb.times AS times
        from rm_intake_amount_day tb
        where intake_id = #{intakeId, jdbcType=BIGINT}
        ORDER BY tb.id DESC
        <trim prefix="limit ">
            <if test="start != null and count != null">
                #{start, javaType=Integer, jdbcType=INTEGER}, #{count, javaType=Integer, jdbcType=INTEGER}
            </if>
        </trim>
    </select>
 
 
    <select id="amountMonthRecords" resultType="com.dy.pipIrrGlobal.voAllRound.VoArIntakeAmountMonth">
        select
        tb.intake_id as intakeId,
        CONCAT(tb.year, '-', tb.month) AS dt,
        tb.amount AS amount
        from st_intake_amount_month tb
        where intake_id = #{intakeId, jdbcType=BIGINT}
        ORDER BY tb.id DESC
        <trim prefix="limit ">
            <if test="start != null and count != null">
                #{start, javaType=Integer, jdbcType=INTEGER}, #{count, javaType=Integer, jdbcType=INTEGER}
            </if>
        </trim>
    </select>
 
 
</mapper>