<?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>
|