yijiusmile
2021-05-17 00c11e16ac27b31c8d29b3c64afa88082010c33e
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/mapper/EmpAccessoryMapper.xml
@@ -3,14 +3,28 @@
<mapper namespace="cc.mrbird.febs.server.hr.mapper.EmpAccessoryMapper">
    <select id="getQuerySql" resultType="java.lang.String">
        select CONCAT('select a.delFlag,a.empName,a.empId,a.empNumb,a.age,a.archivesStatus,a.sex,a.insuranceType,a.politics,a.education,a.entryDate,a.certificateNumb,
       (select dept_Name from t_dept as dept where dept.dept_Id= a.deptId) as deptName,a.jobName,',(SELECT
        select CONCAT(',',(SELECT
  GROUP_CONCAT(DISTINCT
    CONCAT(
      '(SELECT  COUNT(1) FROM  t_emp_accessory accessory inner join t_label label where label.labelId=accessory.labelId and accessory.delFlag = 0 and label.delFlag = 0) AS ''',
      '(SELECT  COUNT(1) FROM  t_emp_accessory accessory inner join t_label label where label.labelId=accessory.labelId and accessory.delFlag = 0 and label.delFlag = 0 and a.empId = accessory.empId  and label.labelCode = ''',label.labelCode,''') AS ''',
      label.labelCode, ''''
    )
  )
FROM t_label label order by label.sort),' from t_emp_baseinfo a') as querySql
FROM t_label label where label.delFlag = 0 order by label.sort)) as querySql
    </select>
    <select id="selectPageVo" resultType="java.util.Map">
        select a.delFlag,a.empName,a.empStatus,a.empId,a.certificateNumb,a.empNumb,
               (select allDeptName from t_dept as dept where dept.dept_Id= a.deptId) as deptName,a.jobName from t_emp_baseinfo a
              inner join t_dept c on a.deptId = c.DEPT_ID
              left join t_emp_accessory acc on acc.empId = a.empId
                ${ew.customSqlSegment}
    </select>
    <select id="getDictType" resultType="cc.mrbird.febs.common.core.entity.system.DicItem">
        select * from t_dicitem where dicCode=#{type}
    </select>
    <select id="getEmpAccessoryNumber" resultType="java.util.Map">
        select a.labelCode,(select count(1) from t_emp_accessory b
        where b.empId = ${empId} and b.delFlag = 0 and b.labelId = a.labelId) as number from t_label a where delFlag = 0
    </select>
</mapper>