<?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.workClientInfo.mapper.WorkClientInfoMapper">

	<select id="findPageList" resultType="com.jeeplus.test.workClientInfo.domain.WorkClientInfo">
		SELECT
			a.id,
			su.name create_by,
			a.create_date,
			a.update_by,
			a.update_date,
			a.del_flag,
			a.name,
			a.lawer_presint,
			a.or_unicode,
			a.company_type,
			a.company_industry,
			a.client_type,
			a.credit_rank,
			b.`name` AS area_id,
			a.zip_code,
			a.fax,
			a.tax_id,
			a.email,
			a.address,
			a.register_address,
			a.company_url,
			a.remarks,
			a.company_id,
			a.office_id,
			a.area_parent_ids,
			a.telephone,
			a.has_uscc,
			a.usc_code,
			a.number,
			(SELECT GROUP_CONCAT(d.label SEPARATOR ',' )
				FROM
					work_client_job_type_info c,
					sys_dict_value d,
					sys_dict_type e
				WHERE
					c.job_type_id = d.VALUE
					AND e.id = d.dict_type_id
					AND e.type = 'representative'
					AND c.work_client_id = a.id) AS deputy
		FROM
			work_client_info a
		LEFT JOIN sys_area b ON a.area_id = b.`code`
		LEFT JOIN sys_user su ON su.id = a.create_by
		${ew.customSqlSegment}
		ORDER BY
			a.update_date DESC
	</select>

</mapper>
