| | |
| | | <?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.lf.server.mapper.data.DirMapper"> |
| | | <resultMap id="resultMap" type="com.lf.server.entity.data.DirEntity"> |
| | | <id property="id" column="id"></id> |
| | | <result property="orderNum" column="order_num"></result> |
| | | <result property="createUser" column="create_user"></result> |
| | | <result property="createTime" column="create_time"></result> |
| | | <result property="updateUser" column="update_user"></result> |
| | | <result property="updateTime" column="update_time"></result> |
| | | </resultMap> |
| | | |
| | | <select id="selectDir" resultMap="resultMap" resultType="com.lf.server.entity.data.DirEntity"> |
| | | select * from lf.sys_dir where id = #{id} |
| | | <select id="selectDir" resultType="com.lf.server.entity.data.DirEntity"> |
| | | select a.*, fn_rec_query(a.id, 'dir') fullName from lf.sys_dir a where id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectDirAll" resultMap="resultMap" resultType="com.lf.server.entity.data.DirEntity"> |
| | | select * from lf.sys_dir order by order_num; |
| | | <select id="selectDirAll" resultType="com.lf.server.entity.data.DirEntity"> |
| | | select a.*, fn_rec_query(a.id, 'dir') fullName from lf.sys_dir a order by order_num; |
| | | </select> |
| | | |
| | | <select id="selectDirRoot" resultType="com.lf.server.entity.data.DirEntity"> |
| | | select * from lf.sys_dir where pid=0 order by order_num; |
| | | select a.*, fn_rec_query(a.id, 'dir') fullName from lf.sys_dir a where pid=0 order by order_num; |
| | | </select> |
| | | |
| | | <select id="selectDirRecursive" resultMap="resultMap" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <select id="selectDirRecursive" resultType="com.lf.server.entity.data.DirEntity"> |
| | | with recursive rs as( |
| | | select * from lf.sys_dir where name=#{name} |
| | | select a.*, fn_rec_query(a.id, 'dir') fullName from lf.sys_dir a where name = #{name} |
| | | union |
| | | select a.* from lf.sys_dir a, rs b where a.pid=b.id |
| | | select b.*, fn_rec_query(b.id, 'dir') fullName from lf.sys_dir b, rs c where b.pid = c.id |
| | | ) |
| | | select * FROM rs order by order_num; |
| | | select * from rs order by order_num; |
| | | </select> |
| | | |
| | | <insert id="insertDir" parameterType="com.lf.server.entity.data.DirEntity"> |