CreditSysDeptMapper.xml 1.86 KB
<?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.ruoyi.business.mapper.CreditSysDeptMapper">

	<resultMap type="SysDept" id="SysDeptResult">
		<id     property="deptId"     column="dept_id"     />
		<result property="parentId"   column="parent_id"   />
		<result property="ancestors"  column="ancestors"   />
		<result property="deptName"   column="dept_name"   />
		<result property="deptCode"   column="dept_code"   />
		<result property="fullName"   column="full_name"   />
		<result property="deptTitle"   column="dept_title" />
		<result property="orderNum"   column="order_num"   />
		<result property="status"     column="status"      />
		<result property="delFlag"    column="del_flag"    />
		<result property="parentName" column="parent_name" />
		<result property="createBy"   column="create_by"   />
		<result property="createTime" column="create_time" />
		<result property="updateBy"   column="update_by"   />
		<result property="updateTime" column="update_time" />
	</resultMap>

	<sql id="selectDeptVo">
		select d.dept_id, d.parent_id, d.dept_name, d.order_num, d.dept_code, d.full_name, d.shxym, d.dept_title from sys_dept d
	</sql>
	
	<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
        <include refid="selectDeptVo"/>
        where
		<if test="deptId != null and deptId != 0">
			 dept_id = #{deptId} AND
		</if>
        <if test="parentId != null and parentId != 0">
			 parent_id = #{parentId} AND
		</if>
		<if test="deptName != null and deptName != ''">
			 dept_name like concat('%', #{deptName}, '%') AND
		</if>
		<if test="status != null and status != ''">
			 status = #{status} AND
		</if>
		d.del_flag = '0'
		<!-- 数据范围过滤 -->
		${params.dataScope}
		order by d.dept_id, d.order_num
    </select>
</mapper>