<?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.jeeplus.test.user.mapper.SysUserInfoMapper">

	<select id="findPageList" resultType="com.jeeplus.test.user.domain.SysUserInfo">
		SELECT
			a.id,
			a.jobNo,
			a.`name`,
			a.id_card,
			a.mobile_phone,
			(SELECT NAME FROM sys_office b WHERE b.id = a.department) AS department,
			(SELECT GROUP_CONCAT(name SEPARATOR ',' ) FROM sys_post WHERE INSTR(a.position, id)) AS position,
			highest_education,
			(SELECT e.label FROM sys_dict_type d LEFT JOIN sys_dict_value e ON d.id = e.dict_type_id WHERE d.type = #{userStatus} AND e.`value` = a.user_type) AS user_status,
			entry_date
		FROM
			sys_user_info a
		${ew.customSqlSegment}
		ORDER BY update_date DESC
	</select>

</mapper>
