update BUG
This commit is contained in:
parent
ac7902edde
commit
dee8f67a09
51
.idea/workspace.xml
generated
51
.idea/workspace.xml
generated
@ -3,10 +3,18 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e4baaf01-a2c2-445d-98a1-9f4c50c148cf" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/common/utils/ExcelUtil$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/common/utils/ExcelUtil$1.class" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/common/utils/ExcelUtil.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/common/utils/ExcelUtil.class" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/lz/modules/app/Dto/StaffOccupationInfoDto.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/lz/modules/app/Dto/StaffOccupationInfoDto.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/lz/modules/job/task/SyncnizeFlybookDataJob.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/lz/modules/job/task/SynchronizeFlybookDataJob.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/resources/application-dev.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application-dev.yml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/resources/mapper/generator/StaffDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/mapper/generator/StaffDao.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/resources/mapper/generator/StaffOccupationDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/mapper/generator/StaffOccupationDao.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/target/classes/application-dev.yml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/application-dev.yml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/app/Dto/StaffOccupationInfoDto.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/modules/app/Dto/StaffOccupationInfoDto.class" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/app/controller/StaffController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/modules/app/controller/StaffController.class" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/job/task/SyncnizeFlybookDataJob.class" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/sys/oauth2/OAuth2Filter.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/modules/sys/oauth2/OAuth2Filter.class" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/target/classes/mapper/generator/StaffDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/mapper/generator/StaffDao.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/target/classes/mapper/generator/StaffOccupationDao.xml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/mapper/generator/StaffOccupationDao.xml" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
@ -158,7 +166,7 @@
|
||||
<workItem from="1588161274115" duration="1691000" />
|
||||
<workItem from="1588163384182" duration="74761000" />
|
||||
<workItem from="1588936950753" duration="95758000" />
|
||||
<workItem from="1590038091791" duration="10974000" />
|
||||
<workItem from="1590038091791" duration="22362000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
@ -206,21 +214,11 @@
|
||||
<line>42</line>
|
||||
<option name="timeStamp" value="66" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/job/business/FeishuBusiness.java</url>
|
||||
<line>80</line>
|
||||
<option name="timeStamp" value="67" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
|
||||
<line>106</line>
|
||||
<option name="timeStamp" value="69" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
|
||||
<line>133</line>
|
||||
<option name="timeStamp" value="70" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
|
||||
<line>212</line>
|
||||
@ -241,6 +239,31 @@
|
||||
<line>205</line>
|
||||
<option name="timeStamp" value="81" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
|
||||
<line>167</line>
|
||||
<option name="timeStamp" value="82" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/job/business/FeishuBusiness.java</url>
|
||||
<line>51</line>
|
||||
<option name="timeStamp" value="83" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/job/task/SynchronizeFlybookDataJob.java</url>
|
||||
<line>34</line>
|
||||
<option name="timeStamp" value="84" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
|
||||
<line>88</line>
|
||||
<option name="timeStamp" value="89" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/service/impl/StaffServiceImpl.java</url>
|
||||
<line>93</line>
|
||||
<option name="timeStamp" value="90" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
</component>
|
||||
|
||||
@ -56,6 +56,11 @@ public class StaffOccupationInfoDto implements Serializable {
|
||||
*/
|
||||
private String jobBeginTime;
|
||||
|
||||
/**
|
||||
* 司龄
|
||||
*/
|
||||
private String companySeniority;
|
||||
|
||||
/**
|
||||
* 工作经历
|
||||
*/
|
||||
|
||||
@ -22,18 +22,19 @@ import org.springframework.stereotype.Component;
|
||||
*
|
||||
* @author fumeiai 20200429
|
||||
*/
|
||||
@Component("syncnizeFlybookDataJob")
|
||||
public class SyncnizeFlybookDataJob {
|
||||
@Component("synchronizeFlybookDataJob")
|
||||
public class SynchronizeFlybookDataJob implements ITask {
|
||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Autowired
|
||||
FeishuBusiness feishuBusiness;
|
||||
|
||||
public void run() {
|
||||
@Override
|
||||
public void run(String params) {
|
||||
|
||||
logger.info("syncnizeFlybookDataJob start date == {}", DateUtils.getCurrentDate());
|
||||
logger.info("synchronizeFlybookDataJob start date == {}", DateUtils.getCurrentDate());
|
||||
feishuBusiness.getFeishuDepartmentsIntoData();
|
||||
logger.info("syncnizeFlybookDataJob end date == {}", DateUtils.getCurrentDate());
|
||||
logger.info("synchronizeFlybookDataJob end date == {}", DateUtils.getCurrentDate());
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://101.37.106.150:3306/lz_management?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
|
||||
url: jdbc:mysql://172.16.157.238:3306/lz_management?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
|
||||
username: ldd_biz
|
||||
password: Hello1234
|
||||
initial-size: 10
|
||||
|
||||
@ -100,30 +100,48 @@
|
||||
<select id="getStaffInfos" resultType="com.lz.modules.app.Dto.StaffDto">
|
||||
select ls.id staffId,lso.employee_no staff_no,ls.name,lso.position,
|
||||
case lso.staff_status when 0 then '在职' else '离职' end staff_status,
|
||||
if(ls.employee_id=ld.leader_employee_id,1,0) department_leader
|
||||
from lz_staff ls,lz_staff_occupation lso,lz_departments_staff_relate dsr,lz_departments ld
|
||||
where lso.staff_id=ls.id and ls.is_delete=0 and dsr.staff_id = ls.id and ld.department_id=dsr.department_id
|
||||
if(ls.employee_id in (select leader_employee_id from lz_departments where is_delete=0),1,0) department_leader
|
||||
from lz_staff ls,lz_staff_occupation lso
|
||||
where lso.staff_id=ls.id and ls.is_delete=0
|
||||
and lso.staff_status=#{staffStatus}
|
||||
<if test="name != null and name != ''">
|
||||
and ls.name like concat('%',#{name},'%')
|
||||
</if>
|
||||
and (ls.id in (
|
||||
select dsr.staff_id from lz_departments_staff_relate dsr where dsr.is_delete=0
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and dsr.department_id=#{departmentId}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and ls.name=#{name}
|
||||
)
|
||||
or ls.employee_id in (
|
||||
select sr.leader_employee_id from lz_departments sr where sr.is_delete=0
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and sr.department_id=#{departmentId}
|
||||
</if>
|
||||
))
|
||||
limit #{startIndex}, #{pageLimit}
|
||||
</select>
|
||||
|
||||
<select id="getStaffInfoCount" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from lz_staff ls,lz_staff_occupation lso,lz_departments_staff_relate dsr,lz_departments ld
|
||||
where lso.staff_id=ls.id and ls.is_delete=0 and dsr.staff_id = ls.id and ld.department_id=dsr.department_id
|
||||
select count(ls.id) count
|
||||
from lz_staff ls,lz_staff_occupation lso
|
||||
where lso.staff_id=ls.id and ls.is_delete=0
|
||||
and lso.staff_status=#{staffStatus}
|
||||
<if test="name != null and name != ''">
|
||||
and ls.name like concat('%',#{name},'%')
|
||||
</if>
|
||||
and (ls.id in (
|
||||
select dsr.staff_id from lz_departments_staff_relate dsr where dsr.is_delete=0
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and dsr.department_id=#{departmentId}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and ls.name=#{name}
|
||||
)
|
||||
or ls.employee_id in (
|
||||
select sr.leader_employee_id from lz_departments sr where sr.is_delete=0
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and sr.department_id=#{departmentId}
|
||||
</if>
|
||||
))
|
||||
</select>
|
||||
|
||||
<select id="getBaseInfo" resultType="com.lz.modules.app.Dto.StaffBaseInfoDto">
|
||||
@ -132,7 +150,7 @@
|
||||
|
||||
<select id="getStatisticalData" resultType="com.lz.modules.app.Dto.StaffStatisticalDto">
|
||||
select
|
||||
count(DISTINCT(ls.id)) totalStaffCount,
|
||||
count(DISTINCT(ls.nowin_staff)) totalStaffCount,
|
||||
count(DISTINCT(td.leader_employee_id)) managementCount,
|
||||
ifnull(round(count(DISTINCT(td.leader_employee_id))/count(DISTINCT(ls.id))*100,2),0) managementRate,
|
||||
count(DISTINCT(ls.new_staff)) newStaffCount,
|
||||
@ -148,16 +166,19 @@
|
||||
left join
|
||||
(select staff_id as leave_staff from lz_staff_occupation where date(resignation_time) between #{beginDate} and
|
||||
#{endDate}) so2
|
||||
on so2.leave_staff=ll.id) ls,
|
||||
lz_departments_staff_relate dsr,lz_staff_occupation so,
|
||||
on so2.leave_staff=ll.id
|
||||
left join
|
||||
(select staff_id as nowin_staff from lz_staff_occupation where date(resignation_time)>=#{endDate} or
|
||||
resignation_time is null) so3
|
||||
on so3.nowin_staff=ll.id) ls,
|
||||
lz_departments_staff_relate dsr,
|
||||
(select * from lz_departments
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
where find_in_set(department_id, getChildList(#{departmentId}))
|
||||
</if>
|
||||
) td
|
||||
where ls.is_delete=0 and ls.id=dsr.staff_id and so.staff_id=ls.id
|
||||
where ls.is_delete=0 and ls.id=dsr.staff_id
|
||||
and dsr.department_id=td.department_id
|
||||
and (date(so.resignation_time)>=#{endDate} or so.resignation_time is null )
|
||||
</select>
|
||||
|
||||
<select id="getGenderData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||
@ -168,7 +189,7 @@
|
||||
end category,
|
||||
count(gender) number
|
||||
from lz_staff
|
||||
where id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate} or
|
||||
where id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate} or
|
||||
so.resignation_time is null)
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and id in (select dsr.staff_id from lz_departments_staff_relate dsr,lz_departments ld where
|
||||
@ -181,19 +202,23 @@
|
||||
select
|
||||
if(birthday=0,'未知',concat(birthday,'后')) category,
|
||||
count(birthday) number
|
||||
from (select id,ifnull(CONCAT(left(date_format(birthday,'%y'),1),'0'),0) birthday from lz_staff) ls
|
||||
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate} or
|
||||
from (
|
||||
select
|
||||
id,ifnull(CONCAT(left(date_format(birthday,'%y'),1),'0'),0) birthday
|
||||
from lz_staff
|
||||
where id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate} or
|
||||
so.resignation_time is null)
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and ls.id in (select dsr.staff_id from lz_departments_staff_relate dsr,lz_departments ld where
|
||||
and id in (select dsr.staff_id from lz_departments_staff_relate dsr,lz_departments ld where
|
||||
dsr.department_id=ld.department_id and find_in_set(ld.department_id, getChildList(#{departmentId})))
|
||||
</if>
|
||||
group by ls.birthday
|
||||
) t
|
||||
group by t.birthday
|
||||
</select>
|
||||
|
||||
<select id="getJobSeniorityData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||
select
|
||||
ls.jobYear category,
|
||||
t.jobYear category,
|
||||
count(jobYear) number
|
||||
from (
|
||||
select staff_id,
|
||||
@ -208,31 +233,34 @@
|
||||
TIMESTAMPDIFF(YEAR,job_begin_time,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S'))<![CDATA[ <= ]]>10
|
||||
then '5-10年'
|
||||
when TIMESTAMPDIFF(YEAR,job_begin_time,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S')) <![CDATA[ > ]]> 10
|
||||
then '10年以上' else '未知' end jobYear from lz_staff_occupation
|
||||
) ls
|
||||
where ls.staff_id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate}
|
||||
then '10年以上' else '未知' end jobYear from lz_staff_occupation ls
|
||||
where ls.staff_id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate}
|
||||
or so.resignation_time is null)
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and ls.staff_id in (select dsr.staff_id from lz_departments_staff_relate dsr,lz_departments ld where
|
||||
dsr.department_id=ld.department_id and find_in_set(ld.department_id, getChildList(#{departmentId})))
|
||||
</if>
|
||||
group by ls.jobYear
|
||||
) t
|
||||
group by t.jobYear
|
||||
</select>
|
||||
|
||||
<select id="getEducationData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||
select
|
||||
ls.education category,
|
||||
y.education category,
|
||||
count(education) number
|
||||
from (
|
||||
select ss.id,ifnull(se.education,'未知') education from lz_staff ss left join lz_staff_education se on
|
||||
se.staff_id=ss.id
|
||||
) ls
|
||||
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate} or
|
||||
select t.id,ifnull(se.education,'未知') education from
|
||||
(select ls.id from lz_staff ls
|
||||
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate} or
|
||||
so.resignation_time is null)
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and ls.id in (select dsr.staff_id from lz_departments_staff_relate dsr,lz_departments ld where
|
||||
dsr.department_id=ld.department_id and find_in_set(ld.department_id, getChildList(#{departmentId})))
|
||||
</if>group by ls.education
|
||||
</if>) t
|
||||
left join lz_staff_education se on
|
||||
se.staff_id=t.id
|
||||
) y
|
||||
group by y.education
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
select * from lz_staff_occupation where is_delete=0 and staff_id = #{staffId}
|
||||
</select>
|
||||
<select id="getOccupationByStaffId" resultType="com.lz.modules.app.Dto.StaffOccupationInfoDto">
|
||||
select employee_no staff_no,position,entry_time,staff_status,resignation_time,resignation_reasons,signing_company,job_begin_time,work_experience,resume_url
|
||||
select employee_no staff_no,position,entry_time,staff_status,resignation_time,resignation_reasons,company_seniority,signing_company,job_begin_time,work_experience,resume_url
|
||||
from lz_staff_occupation where staff_id=#{staffId}
|
||||
</select>
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://101.37.106.150:3306/lz_management?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
|
||||
url: jdbc:mysql://172.16.157.238:3306/lz_management?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
|
||||
username: ldd_biz
|
||||
password: Hello1234
|
||||
initial-size: 10
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -100,30 +100,48 @@
|
||||
<select id="getStaffInfos" resultType="com.lz.modules.app.Dto.StaffDto">
|
||||
select ls.id staffId,lso.employee_no staff_no,ls.name,lso.position,
|
||||
case lso.staff_status when 0 then '在职' else '离职' end staff_status,
|
||||
if(ls.employee_id=ld.leader_employee_id,1,0) department_leader
|
||||
from lz_staff ls,lz_staff_occupation lso,lz_departments_staff_relate dsr,lz_departments ld
|
||||
where lso.staff_id=ls.id and ls.is_delete=0 and dsr.staff_id = ls.id and ld.department_id=dsr.department_id
|
||||
if(ls.employee_id in (select leader_employee_id from lz_departments where is_delete=0),1,0) department_leader
|
||||
from lz_staff ls,lz_staff_occupation lso
|
||||
where lso.staff_id=ls.id and ls.is_delete=0
|
||||
and lso.staff_status=#{staffStatus}
|
||||
<if test="name != null and name != ''">
|
||||
and ls.name like concat('%',#{name},'%')
|
||||
</if>
|
||||
and (ls.id in (
|
||||
select dsr.staff_id from lz_departments_staff_relate dsr where dsr.is_delete=0
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and dsr.department_id=#{departmentId}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and ls.name=#{name}
|
||||
)
|
||||
or ls.employee_id in (
|
||||
select sr.leader_employee_id from lz_departments sr where sr.is_delete=0
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and sr.department_id=#{departmentId}
|
||||
</if>
|
||||
))
|
||||
limit #{startIndex}, #{pageLimit}
|
||||
</select>
|
||||
|
||||
<select id="getStaffInfoCount" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from lz_staff ls,lz_staff_occupation lso,lz_departments_staff_relate dsr,lz_departments ld
|
||||
where lso.staff_id=ls.id and ls.is_delete=0 and dsr.staff_id = ls.id and ld.department_id=dsr.department_id
|
||||
select count(ls.id) count
|
||||
from lz_staff ls,lz_staff_occupation lso
|
||||
where lso.staff_id=ls.id and ls.is_delete=0
|
||||
and lso.staff_status=#{staffStatus}
|
||||
<if test="name != null and name != ''">
|
||||
and ls.name like concat('%',#{name},'%')
|
||||
</if>
|
||||
and (ls.id in (
|
||||
select dsr.staff_id from lz_departments_staff_relate dsr where dsr.is_delete=0
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and dsr.department_id=#{departmentId}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and ls.name=#{name}
|
||||
)
|
||||
or ls.employee_id in (
|
||||
select sr.leader_employee_id from lz_departments sr where sr.is_delete=0
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and sr.department_id=#{departmentId}
|
||||
</if>
|
||||
))
|
||||
</select>
|
||||
|
||||
<select id="getBaseInfo" resultType="com.lz.modules.app.Dto.StaffBaseInfoDto">
|
||||
@ -132,7 +150,7 @@
|
||||
|
||||
<select id="getStatisticalData" resultType="com.lz.modules.app.Dto.StaffStatisticalDto">
|
||||
select
|
||||
count(DISTINCT(ls.id)) totalStaffCount,
|
||||
count(DISTINCT(ls.nowin_staff)) totalStaffCount,
|
||||
count(DISTINCT(td.leader_employee_id)) managementCount,
|
||||
ifnull(round(count(DISTINCT(td.leader_employee_id))/count(DISTINCT(ls.id))*100,2),0) managementRate,
|
||||
count(DISTINCT(ls.new_staff)) newStaffCount,
|
||||
@ -148,16 +166,19 @@
|
||||
left join
|
||||
(select staff_id as leave_staff from lz_staff_occupation where date(resignation_time) between #{beginDate} and
|
||||
#{endDate}) so2
|
||||
on so2.leave_staff=ll.id) ls,
|
||||
lz_departments_staff_relate dsr,lz_staff_occupation so,
|
||||
on so2.leave_staff=ll.id
|
||||
left join
|
||||
(select staff_id as nowin_staff from lz_staff_occupation where date(resignation_time)>=#{endDate} or
|
||||
resignation_time is null) so3
|
||||
on so3.nowin_staff=ll.id) ls,
|
||||
lz_departments_staff_relate dsr,
|
||||
(select * from lz_departments
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
where find_in_set(department_id, getChildList(#{departmentId}))
|
||||
</if>
|
||||
) td
|
||||
where ls.is_delete=0 and ls.id=dsr.staff_id and so.staff_id=ls.id
|
||||
where ls.is_delete=0 and ls.id=dsr.staff_id
|
||||
and dsr.department_id=td.department_id
|
||||
and (date(so.resignation_time)>=#{endDate} or so.resignation_time is null )
|
||||
</select>
|
||||
|
||||
<select id="getGenderData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||
@ -168,7 +189,7 @@
|
||||
end category,
|
||||
count(gender) number
|
||||
from lz_staff
|
||||
where id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate} or
|
||||
where id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate} or
|
||||
so.resignation_time is null)
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and id in (select dsr.staff_id from lz_departments_staff_relate dsr,lz_departments ld where
|
||||
@ -181,19 +202,23 @@
|
||||
select
|
||||
if(birthday=0,'未知',concat(birthday,'后')) category,
|
||||
count(birthday) number
|
||||
from (select id,ifnull(CONCAT(left(date_format(birthday,'%y'),1),'0'),0) birthday from lz_staff) ls
|
||||
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate} or
|
||||
from (
|
||||
select
|
||||
id,ifnull(CONCAT(left(date_format(birthday,'%y'),1),'0'),0) birthday
|
||||
from lz_staff
|
||||
where id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate} or
|
||||
so.resignation_time is null)
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and ls.id in (select dsr.staff_id from lz_departments_staff_relate dsr,lz_departments ld where
|
||||
and id in (select dsr.staff_id from lz_departments_staff_relate dsr,lz_departments ld where
|
||||
dsr.department_id=ld.department_id and find_in_set(ld.department_id, getChildList(#{departmentId})))
|
||||
</if>
|
||||
group by ls.birthday
|
||||
) t
|
||||
group by t.birthday
|
||||
</select>
|
||||
|
||||
<select id="getJobSeniorityData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||
select
|
||||
ls.jobYear category,
|
||||
t.jobYear category,
|
||||
count(jobYear) number
|
||||
from (
|
||||
select staff_id,
|
||||
@ -208,31 +233,34 @@
|
||||
TIMESTAMPDIFF(YEAR,job_begin_time,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S'))<![CDATA[ <= ]]>10
|
||||
then '5-10年'
|
||||
when TIMESTAMPDIFF(YEAR,job_begin_time,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S')) <![CDATA[ > ]]> 10
|
||||
then '10年以上' else '未知' end jobYear from lz_staff_occupation
|
||||
) ls
|
||||
where ls.staff_id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate}
|
||||
then '10年以上' else '未知' end jobYear from lz_staff_occupation ls
|
||||
where ls.staff_id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate}
|
||||
or so.resignation_time is null)
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and ls.staff_id in (select dsr.staff_id from lz_departments_staff_relate dsr,lz_departments ld where
|
||||
dsr.department_id=ld.department_id and find_in_set(ld.department_id, getChildList(#{departmentId})))
|
||||
</if>
|
||||
group by ls.jobYear
|
||||
) t
|
||||
group by t.jobYear
|
||||
</select>
|
||||
|
||||
<select id="getEducationData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||
select
|
||||
ls.education category,
|
||||
y.education category,
|
||||
count(education) number
|
||||
from (
|
||||
select ss.id,ifnull(se.education,'未知') education from lz_staff ss left join lz_staff_education se on
|
||||
se.staff_id=ss.id
|
||||
) ls
|
||||
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate} or
|
||||
select t.id,ifnull(se.education,'未知') education from
|
||||
(select ls.id from lz_staff ls
|
||||
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate} or
|
||||
so.resignation_time is null)
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and ls.id in (select dsr.staff_id from lz_departments_staff_relate dsr,lz_departments ld where
|
||||
dsr.department_id=ld.department_id and find_in_set(ld.department_id, getChildList(#{departmentId})))
|
||||
</if>group by ls.education
|
||||
</if>) t
|
||||
left join lz_staff_education se on
|
||||
se.staff_id=t.id
|
||||
) y
|
||||
group by y.education
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
select * from lz_staff_occupation where is_delete=0 and staff_id = #{staffId}
|
||||
</select>
|
||||
<select id="getOccupationByStaffId" resultType="com.lz.modules.app.Dto.StaffOccupationInfoDto">
|
||||
select employee_no staff_no,position,entry_time,staff_status,resignation_time,resignation_reasons,signing_company,job_begin_time,work_experience,resume_url
|
||||
select employee_no staff_no,position,entry_time,staff_status,resignation_time,resignation_reasons,company_seniority,signing_company,job_begin_time,work_experience,resume_url
|
||||
from lz_staff_occupation where staff_id=#{staffId}
|
||||
</select>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user