|
|
|
<?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.supervision.knowsub.mapper.SystemDeptMapper">
|
|
|
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.supervision.knowsub.model.SystemDept">
|
|
|
|
<id property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
|
<result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
|
|
|
|
<result property="deptCode" column="dept_code" jdbcType="VARCHAR"/>
|
|
|
|
<result property="parentDeptId" column="parent_dept_id" jdbcType="VARCHAR"/>
|
|
|
|
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
|
|
|
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
|
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
|
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
|
|
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
id,dept_name,dept_code,parent_dept_id,
|
|
|
|
remark,create_user_id,create_time,
|
|
|
|
update_user_id,update_time
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="pageListDept" resultType="com.supervision.knowsub.vo.dept.DeptInfoResVo">
|
|
|
|
select t1.id as id,
|
|
|
|
t1.dept_code as deptCode,
|
|
|
|
t1.dept_name as deptName,
|
|
|
|
t1.parent_dept_id as parentDeptId,
|
|
|
|
t2.dept_name as parentDeptName
|
|
|
|
from ks_system_dept t1
|
|
|
|
left join ks_system_dept t2 on t1.parent_dept_id = t2.id
|
|
|
|
where 1=1
|
|
|
|
<if test="deptName != null and deptName != ''">
|
|
|
|
and t1.dept_name like concat('%',#{deptName},'%')
|
|
|
|
</if>
|
|
|
|
<if test="deptCode != null and deptCode != ''">
|
|
|
|
and t1.dept_code = #{deptCode}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</mapper>
|