<?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.ycl.mapper.depart.UmsDepartMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ycl.entity.depart.UmsDepart">
|
<id column="id" property="id" />
|
<result column="depart_name" property="departName" />
|
<result column="depart_des" property="departDes" />
|
<result column="depart_type" property="departType" />
|
<result column="parent_id" property="parentId" />
|
<result column="status" property="status" />
|
<result column="create_time" property="createTime" />
|
<result column="update_time" property="updateTime" />
|
<result column="is_deleted" property="isDeleted" />
|
</resultMap>
|
<resultMap type="com.ycl.entity.depart.UmsDepart" id="UserDepartResultMap" extends="BaseResultMap">
|
<collection property="userInfoDTOS" javaType="ArrayList" ofType="com.ycl.dto.user.DepartUserDTO">
|
<id column="user_id" property="userId" />
|
<result column="username" property="username" />
|
</collection>
|
</resultMap>
|
|
<select id="selectDepartList" resultMap="UserDepartResultMap">
|
SELECT
|
ud.*,ua.id user_id,ua.username
|
FROM
|
ums_depart ud
|
LEFT JOIN ums_depart_manager udm ON ud.id = udm.depart_id
|
LEFT JOIN ums_admin ua ON udm.user_id = ua.id
|
</select>
|
|
|
</mapper>
|