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
<?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.parsing.mapper.centen.CostTypeTemplateMapper">
 
    <resultMap id="getCostTypeTemplateMap" type="com.changhong.epc.bean.admin.extend.CostTypeTemplateExtend">
        <id column="tId" property="id"/>
        <result column="node_name" property="name"/>
        <collection property="costFromTemplates" ofType="com.changhong.epc.bean.admin.CostFromTemplate">
            <id column="fId" property="id"/>
            <result column="ct_id" property="ctId"/>
            <result column="f_id" property="fId"/>
            <result column="f_name" property="fName"/>
            <result column="type" property="type"/>
        </collection>
    </resultMap>
 
    <select id="getCostTypeTemplate" resultMap="getCostTypeTemplateMap">
        select
            tt.id tId
            , tt.node_name
            , ft.id fId
            , ft.ct_id
            , ft.f_id
            , ft.f_name
            , ft.type
        from EPC_COST_TYPE_TEMPLATE_GROUP g
        left join epc_cost_type_template tt on g.id = tt.g_id and tt.data_start = 0
        left join epc_cost_from_template ft on tt.id = ft.ct_id and ft.data_start = 0
        where g.id = #{ctId}
        and ft.id is not null
    </select>
 
</mapper>