zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
<?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.changhong.epc.form.mapper.tenant.contract.FormContractMassageMapper">
    <select id="selectOneContract" resultType="java.util.Map">
        select 
            DATAROWNUM 
        from 
            formdata_{tenantId}_${fromId}
        where
            DATAROWNUM = #{dataRowNum}
        and
            DELETEFLG = 0
    </select>
 
    <select id="selectContractMoney" resultType="java.util.Map">
        SELECT
            SUM(${paymentAmount}) AS paymentAmount,
            ${paymentStage} AS paymentStage
        FROM
            formdata_{tenantId}_${fromId}_subform
        WHERE
            PARENTDATAROWNUM IN (
                SELECT
                    DATAROWNUM
                FROM
                    formdata_{tenantId}_${fromId}
                WHERE
                    selectContracts = #{dataRowNum}
                AND processState = 30
                AND DELETEFLG = 0
            )
        AND DELETEFLG = 0 
        GROUP BY
            payment_stage
    </select>
    
    
    <select id="selectAllContractMoney" resultType="java.util.Map">
        SELECT
            SUM(${paymentAmount}) AS paymentAmount,
            ${paymentStage} AS paymentStage
        FROM
            formdata_{tenantId}_${fromId}_subform
        WHERE
            PARENTDATAROWNUM IN (
                SELECT
                    DATAROWNUM
                FROM
                    formdata_{tenantId}_${fromId}
                WHERE
                    DATAROWNUM = #{dataRowNum}
                AND processState = 30
                AND DELETEFLG = 0
            )
        AND DELETEFLG = 0 
        GROUP BY
            payment_stage
    </select>
</mapper>