<includerefid="Base_Column_List"/>,GROUP_CONCAT(distinct c.DEPT_NAME) as DEPT_NAME,GROUP_CONCAT(distinct c.UNIT_NAME) as UNIT_NAME,GROUP_CONCAT(distinct c.DEPT_NO) as DEPT_NO,GROUP_CONCAT(distinct c.EMP_NO) as EMP_NO
FROM t_elec_employee_info a
left join t_employee_info b on a.EMP_IDCARD = b.EMP_IDCARD
left join t_employee_project c on a.EMP_IDCARD = c.EMP_IDCARD AND c.DELETE_FLAG = '0' AND c.PROJECT_STATUS = '0'
<where>
1=1 AND a.DELETE_FLAG = '0'
<includerefid="tElecEmployeeInfo_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.CREATE_TIME,a.DATA_TYPE
ORDER BY a.CREATE_TIME desc
SELECT * from (
SELECT
<includerefid="Base_Column_List"/>,GROUP_CONCAT(distinct c.DEPT_NAME) as DEPT_NAME,GROUP_CONCAT(distinct c.UNIT_NAME) as UNIT_NAME,GROUP_CONCAT(distinct c.DEPT_NO) as DEPT_NO,GROUP_CONCAT(distinct c.EMP_NO) as EMP_NO
FROM t_elec_employee_info a
left join t_employee_info b on a.EMP_IDCARD = b.EMP_IDCARD
left join t_employee_project c on a.EMP_IDCARD = c.EMP_IDCARD AND c.DELETE_FLAG = '0' AND c.PROJECT_STATUS = '0'
WHERE a.DELETE_FLAG = '0'
<includerefid="tElecEmployeeInfo_where"/>
GROUP BY a.EMP_IDCARD,a.CREATE_TIME,a.DATA_TYPE
ORDER BY a.CREATE_TIME desc
) b
where 1=1
<iftest="tElecEmployeeInfo.unitName != null and tElecEmployeeInfo.unitName.trim() != ''">
AND b.UNIT_NAME like concat('%',#{tElecEmployeeInfo.unitName},'%')
</if>
<iftest="tElecEmployeeInfo.deptName != null and tElecEmployeeInfo.deptName.trim() != ''">
AND b.DEPT_NAME like concat('%',#{tElecEmployeeInfo.deptName},'%')
</if>
<iftest="tElecEmployeeInfo.deptNo != null and tElecEmployeeInfo.deptNo.trim() != ''">
AND b.DEPT_NO like concat('%',#{tElecEmployeeInfo.deptNo},'%')
</if>
<iftest="tElecEmployeeInfo.empNo != null and tElecEmployeeInfo.empNo.trim() != ''">
AND b.EMP_NO like concat('%',#{tElecEmployeeInfo.empNo},'%')