DynamicFieldDataMapper.xml
1.39 KB
<?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="cn.runsa.portal.query.dao.DynamicFieldDataDao">
<cache eviction="LRU" flushInterval="60000" size="512" readOnly="true"/>
<resultMap type="cn.runsa.portal.query.entity.DynamicFieldData" id="dynamicFieldData">
<id column="dfd_id" property="id"/>
<result column="df_id" property="fieldId"/>
<result column="dfd_code" property="code"/>
<result column="dfd_name" property="name"/>
<result column="dfd_group" property="group"/>
<result column="dfd_parent" property="parent"/>
<result column="node" property="node"/>
</resultMap>
<sql id="nodeSql">
,
(
SELECT COUNT(1) FROM pl_dynamic_field_data WHERE df_id=t1.df_id and dfd_parent=t1.dfd_code
) node
</sql>
<select id="findByFieldId" parameterType="String" resultMap="dynamicFieldData">
SELECT dfd_id,dfd_code,dfd_name,dfd_ext,dfd_group,dfd_parent
<include refid="nodeSql"></include>
FROM pl_dynamic_field_data t1
WHERE t1.df_id=#{id}
order by t1.dfd_code asc
</select>
<select id="findByParent" resultMap="dynamicFieldData">
SELECT dfd_id,dfd_code,dfd_name,dfd_ext,dfd_group,dfd_parent
<include refid="nodeSql"></include>
FROM pl_dynamic_field_data t1
WHERE t1.df_id=#{id} and t1.dfd_parent=#{parent}
order by t1.dfd_code asc
</select>
</mapper>