| | |
| | | <mapper namespace="com.zt.modules.sys.dao.SysDeptDao"> |
| | | |
| | | <select id="getAll" resultType="com.zt.core.sys.model.SysDept"> |
| | | select a.id as id |
| | | ,a.name as name |
| | | ,a.pid as pid |
| | | ,a.code as code |
| | | ,a.pids as pids |
| | | ,a.IS_COMPANY |
| | | ,a.nature as nature |
| | | ,a.sort as sort |
| | | ,(select t2.name from SYS_DEPT t2 where t2.id=a.pid) parentName |
| | | ,(select t2.name from SYS_DEPT t2 where t2.id = a.pid) companyName |
| | | select a.id as id |
| | | , a.name as name |
| | | , a.pid as pid |
| | | , a.code as code |
| | | , a.pids as pids |
| | | , a.IS_COMPANY |
| | | , a.nature as nature |
| | | , a.sort as sort |
| | | , (select t2.name from SYS_DEPT t2 where t2.id = a.pid) parentName |
| | | , (select t2.name from SYS_DEPT t2 where t2.id = a.pid) companyName |
| | | from SYS_DEPT a |
| | | where a.is_delete = 0 |
| | | order by a.nature, a.sort asc |
| | |
| | | |
| | | <select id="getById" resultType="com.zt.core.sys.model.SysDept"> |
| | | select a.id |
| | | ,a.name |
| | | ,a.code |
| | | ,a.pid |
| | | ,a.pids |
| | | ,a.nature |
| | | ,a.sort |
| | | ,(select t2.name from SYS_DEPT t2 where t2.id=a.pid) parentName |
| | | , a.name |
| | | , a.code |
| | | , a.pid |
| | | , a.pids |
| | | , a.nature |
| | | , a.sort |
| | | , (select t2.name from SYS_DEPT t2 where t2.id = a.pid) parentName |
| | | from SYS_DEPT a |
| | | where a.is_delete=0 |
| | | and a.id = #{value} |
| | | where a.is_delete = 0 |
| | | and a.id = #{value} |
| | | </select> |
| | | |
| | | <select id="getListByParent" resultType="com.zt.core.sys.model.SysDept"> |
| | |
| | | from SYS_DEPT a |
| | | where a.is_delete=0 |
| | | <if test="pCode != null"> |
| | | and pid in (select id from SYS_DEPT where code= #{pCode}) |
| | | and pid in (select id from SYS_DEPT where code= #{pCode}) |
| | | </if> |
| | | <if test="code != null"> |
| | | and code= #{code} |
| | | and code= #{code} |
| | | </if> |
| | | <if test="pId != null"> |
| | | and pid = #{pId} |
| | | </if> |
| | | </select> |
| | | <select id="getDeptList3" resultType="com.zt.core.sys.model.SysDept"> |
| | | select id, name |
| | | from sys_dept |
| | | where IS_COMPANY = 0 |
| | | order by sort |
| | | </select> |
| | | </mapper> |