zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
commit | author | age
a18bfa 1 <?xml version="1.0" encoding="UTF-8" ?>
Z 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.changhong.epc.tenant.mapper.tenant.system.budget.BudgetConfigMapper">
4     <resultMap type="com.changhong.epc.bean.tenant.system.budget.extend.BudgetOrgExtend" id="budgetOrgExtend">
5         <id property="id" column="t1"/>
6         <result property="cId" column="t2"/>
7         <result property="orgCode" column="t3"/>
8         <result property="parentOrgCode" column="t4"/>
9         <result property="groupId" column="t5"/>
10         <association property="costType" javaType="com.changhong.epc.bean.tenant.cost.CostType">
11             <result property="nodeName" column="t6"/>
12         </association>
13     </resultMap>
14
15     <select id="selectLinkPage" resultMap="budgetOrgExtend">
16         SELECT
17             e1.id t1,
18             e1.c_id t2,
19             GROUP_CONCAT(DISTINCT e1.org_code) t3,
20             GROUP_CONCAT(DISTINCT e1.parent_org_code) t4,
21             e1.group_id t5,
22             GROUP_CONCAT(DISTINCT e2.node_name) t6
23         FROM
24             epc_parent_budget_org_{rule}  e1
25         LEFT JOIN epc_cost_type_{rule} e2 ON e1.c_id = e2.id
26         WHERE
27             e1.data_start = 0 
28         GROUP BY
29             e1.group_id
30         ORDER BY
31             e1.id DESC
32     </select>
33     
34     
35     <select id="getCidList" resultType="java.lang.Integer">
36         SELECT
37             c_id
38         FROM
39             epc_parent_budget_org_{rule}
40         WHERE
41             data_start = 0
42         AND
43             group_id = #{bud.groupId}
44         GROUP BY
45             c_id
46     </select>
47     
48     <select id="getOrgCodeList" resultType="java.lang.String">
49         SELECT
50             org_code
51         FROM
52             epc_parent_budget_org_{rule}
53         WHERE
54             data_start = 0
55         AND
56             group_id = #{bud.groupId}
57         GROUP BY
58             org_code
59     </select>
60     
61     <select id="getParentOrgCodeList" resultType="java.lang.String">
62         SELECT
63             parent_org_code
64         FROM
65             epc_parent_budget_org_{rule}
66         WHERE
67             data_start = 0
68         AND
69             group_id = #{bud.groupId}
70         GROUP BY
71             parent_org_code
72     </select>
73
74
75 </mapper>