| | |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <resultMap id="DepartVOMap" type="com.ycl.vo.depart.UmsDepartVO" extends="BaseResultMap"> |
| | | <result column="depart_type_name" property="departTypeName" jdbcType="VARCHAR"></result> |
| | | <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 |
| | | 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> |
| | | <select id="selectPageByName" resultMap="DepartVOMap"> |
| | | SELECT t_0.*, |
| | | ua.id user_id, |
| | | ua.username, |
| | | dd.`name` as depart_type_name |
| | | FROM ( |
| | | SELECT ud.* |
| | | FROM ums_depart ud |
| | | WHERE is_deleted = 0 |
| | | <if test="departName!=null and departName!=''"> |
| | | and ud.name like CONCAT('%',#{departName},'%') |
| | | </if> |
| | | ORDER BY create_time desc |
| | | LIMIT #{offset}, #{size} |
| | | ) t_0 |
| | | LEFT JOIN ums_depart_manager udm ON t_0.id = udm.depart_id |
| | | LEFT JOIN ums_admin ua ON udm.user_id = ua.id |
| | | left join ums_data_dictionary as dd on t_0.depart_type = dd.id |
| | | </select> |
| | | |
| | | |
| | | </mapper> |