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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?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.tenant.mapper.tenant.system.budget.BudgetConfigMapper">
    <resultMap type="com.changhong.epc.bean.tenant.system.budget.extend.BudgetOrgExtend" id="budgetOrgExtend">
        <id property="id" column="t1"/>
        <result property="cId" column="t2"/>
        <result property="orgCode" column="t3"/>
        <result property="parentOrgCode" column="t4"/>
        <result property="groupId" column="t5"/>
        <association property="costType" javaType="com.changhong.epc.bean.tenant.cost.CostType">
            <result property="nodeName" column="t6"/>
        </association>
    </resultMap>
 
    <select id="selectLinkPage" resultMap="budgetOrgExtend">
        SELECT
            e1.id t1,
            e1.c_id t2,
            GROUP_CONCAT(DISTINCT e1.org_code) t3,
            GROUP_CONCAT(DISTINCT e1.parent_org_code) t4,
            e1.group_id t5,
            GROUP_CONCAT(DISTINCT e2.node_name) t6
        FROM
            epc_parent_budget_org_{rule}  e1
        LEFT JOIN epc_cost_type_{rule} e2 ON e1.c_id = e2.id
        WHERE
            e1.data_start = 0 
        GROUP BY
            e1.group_id
        ORDER BY
            e1.id DESC
    </select>
    
    
    <select id="getCidList" resultType="java.lang.Integer">
        SELECT
            c_id
        FROM
            epc_parent_budget_org_{rule}
        WHERE
            data_start = 0
        AND
            group_id = #{bud.groupId}
        GROUP BY
            c_id
    </select>
    
    <select id="getOrgCodeList" resultType="java.lang.String">
        SELECT
            org_code
        FROM
            epc_parent_budget_org_{rule}
        WHERE
            data_start = 0
        AND
            group_id = #{bud.groupId}
        GROUP BY
            org_code
    </select>
    
    <select id="getParentOrgCodeList" resultType="java.lang.String">
        SELECT
            parent_org_code
        FROM
            epc_parent_budget_org_{rule}
        WHERE
            data_start = 0
        AND
            group_id = #{bud.groupId}
        GROUP BY
            parent_org_code
    </select>
 
 
</mapper>