| | |
| | | <?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"> |
| | | <select id="selectDir" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <mapper namespace="com.terra.system.mapper.data.DirMapper"> |
| | | <select id="selectDir" resultType="com.terra.system.entity.data.DirEntity"> |
| | | select a.*, fn_get_fullname(a.code, 2) fullName from lf.sys_dir a where id = #{id} |
| | | </select> |
| | | <select id="selectByCode" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <select id="selectByCode" resultType="com.terra.system.entity.data.DirEntity"> |
| | | select a.*, fn_get_fullname(a.code, 2) fullName from lf.sys_dir a where code = #{code} |
| | | </select> |
| | | |
| | | <select id="selectDirAll" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <select id="selectDirAll" resultType="com.terra.system.entity.data.DirEntity"> |
| | | select a.*, fn_get_fullname(a.code, 2) fullName from lf.sys_dir a order by order_num; |
| | | </select> |
| | | |
| | | <select id="selectDirRoot" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <select id="selectDirRoot" resultType="com.terra.system.entity.data.DirEntity"> |
| | | select a.*, fn_get_fullname(a.code, 2) fullName |
| | | from lf.sys_dir a |
| | | where pid = 0 |
| | | order by order_num, code; |
| | | </select> |
| | | |
| | | <select id="selectProject" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <select id="selectProject" resultType="com.terra.system.entity.data.DirEntity"> |
| | | select a.*, fn_get_fullname(a.code, 2) fullName |
| | | from lf.sys_dir a |
| | | <where> |
| | |
| | | order by order_num, code; |
| | | </select> |
| | | |
| | | <select id="selectDirRecursive" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <select id="selectDirRecursive" resultType="com.terra.system.entity.data.DirEntity"> |
| | | with recursive rs as( |
| | | select a.*, fn_get_fullname(a.code, 2) fullName from lf.sys_dir a where name = #{name} |
| | | union |
| | |
| | | order by order_num, code; |
| | | </select> |
| | | |
| | | <select id="selectRecursiveById" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <select id="selectRecursiveById" resultType="com.terra.system.entity.data.DirEntity"> |
| | | with recursive rs as( |
| | | select a.*, fn_get_fullname(a.code, 2) fullName from lf.sys_dir a where id = #{id} |
| | | union |
| | |
| | | order by code; |
| | | </select> |
| | | |
| | | <select id="selectByPid" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <select id="selectByPid" resultType="com.terra.system.entity.data.DirEntity"> |
| | | with recursive rs as( |
| | | select a.* from lf.sys_dir a where id = #{pid} |
| | | union |
| | |
| | | order by code; |
| | | </select> |
| | | |
| | | <select id="selectDirsForPrj" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <select id="selectDirsForPrj" resultType="com.terra.system.entity.data.DirEntity"> |
| | | select a.* from lf.sys_dir a where code not like '00%' order by code; |
| | | </select> |
| | | |
| | |
| | | select coalesce(max(order_num), 0) + 1 from lf.sys_dir; |
| | | </select> |
| | | |
| | | <select id="selectDirByName" resultType="com.lf.server.entity.data.DirEntity"> |
| | | <select id="selectDirByName" resultType="com.terra.system.entity.data.DirEntity"> |
| | | select * from lf.sys_dir |
| | | <where> |
| | | upper(name) = #{name} |
| | |
| | | </select> |
| | | |
| | | <!-- 插入一条 --> |
| | | <insert id="insert" parameterType="com.lf.server.entity.data.DirEntity"> |
| | | <insert id="insert" parameterType="com.terra.system.entity.data.DirEntity"> |
| | | <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id"> |
| | | select currval('lf.sys_dir_id_seq'::regclass) as id |
| | | </selectKey> |