37 lines
1.6 KiB
XML
37 lines
1.6 KiB
XML
|
|
<?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.rzyc.mapper.ent.EntPostMapper">
|
||
|
|
|
||
|
|
<!-- 通用查询映射结果 -->
|
||
|
|
<resultMap id="BaseResultMap" type="com.rzyc.model.ent.EntPost">
|
||
|
|
<id column="post_id" property="postId" />
|
||
|
|
<result column="enterprise_id" property="enterpriseId" />
|
||
|
|
<result column="name" property="name" />
|
||
|
|
<result column="parent_id" property="parentId" />
|
||
|
|
<result column="post_path" property="postPath" />
|
||
|
|
<result column="parent_name" property="parentName" />
|
||
|
|
<result column="post_level" property="postLevel" />
|
||
|
|
<result column="completion_rate" property="completionRate" />
|
||
|
|
<result column="create_time" property="createTime" />
|
||
|
|
<result column="create_by" property="createBy" />
|
||
|
|
<result column="modify_time" property="modifyTime" />
|
||
|
|
<result column="modify_by" property="modifyBy" />
|
||
|
|
<result column="subordinates" property="subordinates"/>
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<!-- 通用查询结果列 -->
|
||
|
|
<sql id="Base_Column_List">
|
||
|
|
post_id, enterprise_id, name, parent_id, post_path, parent_name, post_level, completion_rate, create_time, create_by, modify_time, modify_by
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectEntUserTree" resultMap="BaseResultMap">
|
||
|
|
select * from ent_post
|
||
|
|
where enterprise_id = #{enterpriseId}
|
||
|
|
<if test="null != postId and '' != postId">
|
||
|
|
and post_path like concat('%',#{postId},'%')
|
||
|
|
</if>
|
||
|
|
order by post_level asc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|