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">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e4baaf01-a2c2-445d-98a1-9f4c50c148cf" name="Default Changelist" comment="">
|
<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$/.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$/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$/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$/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$/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/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/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>
|
</list>
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
@ -158,7 +166,7 @@
|
|||||||
<workItem from="1588161274115" duration="1691000" />
|
<workItem from="1588161274115" duration="1691000" />
|
||||||
<workItem from="1588163384182" duration="74761000" />
|
<workItem from="1588163384182" duration="74761000" />
|
||||||
<workItem from="1588936950753" duration="95758000" />
|
<workItem from="1588936950753" duration="95758000" />
|
||||||
<workItem from="1590038091791" duration="10974000" />
|
<workItem from="1590038091791" duration="22362000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
@ -206,21 +214,11 @@
|
|||||||
<line>42</line>
|
<line>42</line>
|
||||||
<option name="timeStamp" value="66" />
|
<option name="timeStamp" value="66" />
|
||||||
</line-breakpoint>
|
</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">
|
<line-breakpoint enabled="true" type="java-line">
|
||||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
|
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
|
||||||
<line>106</line>
|
<line>106</line>
|
||||||
<option name="timeStamp" value="69" />
|
<option name="timeStamp" value="69" />
|
||||||
</line-breakpoint>
|
</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">
|
<line-breakpoint enabled="true" type="java-line">
|
||||||
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
|
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
|
||||||
<line>212</line>
|
<line>212</line>
|
||||||
@ -241,6 +239,31 @@
|
|||||||
<line>205</line>
|
<line>205</line>
|
||||||
<option name="timeStamp" value="81" />
|
<option name="timeStamp" value="81" />
|
||||||
</line-breakpoint>
|
</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>
|
</breakpoints>
|
||||||
</breakpoint-manager>
|
</breakpoint-manager>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@ -56,6 +56,11 @@ public class StaffOccupationInfoDto implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String jobBeginTime;
|
private String jobBeginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司龄
|
||||||
|
*/
|
||||||
|
private String companySeniority;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作经历
|
* 工作经历
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -22,18 +22,19 @@ import org.springframework.stereotype.Component;
|
|||||||
*
|
*
|
||||||
* @author fumeiai 20200429
|
* @author fumeiai 20200429
|
||||||
*/
|
*/
|
||||||
@Component("syncnizeFlybookDataJob")
|
@Component("synchronizeFlybookDataJob")
|
||||||
public class SyncnizeFlybookDataJob {
|
public class SynchronizeFlybookDataJob implements ITask {
|
||||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
FeishuBusiness feishuBusiness;
|
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();
|
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
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
druid:
|
druid:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
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
|
username: ldd_biz
|
||||||
password: Hello1234
|
password: Hello1234
|
||||||
initial-size: 10
|
initial-size: 10
|
||||||
|
|||||||
@ -100,30 +100,48 @@
|
|||||||
<select id="getStaffInfos" resultType="com.lz.modules.app.Dto.StaffDto">
|
<select id="getStaffInfos" resultType="com.lz.modules.app.Dto.StaffDto">
|
||||||
select ls.id staffId,lso.employee_no staff_no,ls.name,lso.position,
|
select ls.id staffId,lso.employee_no staff_no,ls.name,lso.position,
|
||||||
case lso.staff_status when 0 then '在职' else '离职' end staff_status,
|
case lso.staff_status when 0 then '在职' else '离职' end staff_status,
|
||||||
if(ls.employee_id=ld.leader_employee_id,1,0) department_leader
|
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,lz_departments_staff_relate dsr,lz_departments ld
|
from lz_staff ls,lz_staff_occupation lso
|
||||||
where lso.staff_id=ls.id and ls.is_delete=0 and dsr.staff_id = ls.id and ld.department_id=dsr.department_id
|
where lso.staff_id=ls.id and ls.is_delete=0
|
||||||
and lso.staff_status=#{staffStatus}
|
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 != ''">
|
<if test="departmentId != null and departmentId != ''">
|
||||||
and dsr.department_id=#{departmentId}
|
and dsr.department_id=#{departmentId}
|
||||||
</if>
|
</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>
|
</if>
|
||||||
|
))
|
||||||
limit #{startIndex}, #{pageLimit}
|
limit #{startIndex}, #{pageLimit}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getStaffInfoCount" resultType="java.lang.Integer">
|
<select id="getStaffInfoCount" resultType="java.lang.Integer">
|
||||||
select count(1)
|
select count(ls.id) count
|
||||||
from lz_staff ls,lz_staff_occupation lso,lz_departments_staff_relate dsr,lz_departments ld
|
from lz_staff ls,lz_staff_occupation lso
|
||||||
where lso.staff_id=ls.id and ls.is_delete=0 and dsr.staff_id = ls.id and ld.department_id=dsr.department_id
|
where lso.staff_id=ls.id and ls.is_delete=0
|
||||||
and lso.staff_status=#{staffStatus}
|
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 != ''">
|
<if test="departmentId != null and departmentId != ''">
|
||||||
and dsr.department_id=#{departmentId}
|
and dsr.department_id=#{departmentId}
|
||||||
</if>
|
</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>
|
</if>
|
||||||
|
))
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBaseInfo" resultType="com.lz.modules.app.Dto.StaffBaseInfoDto">
|
<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 id="getStatisticalData" resultType="com.lz.modules.app.Dto.StaffStatisticalDto">
|
||||||
select
|
select
|
||||||
count(DISTINCT(ls.id)) totalStaffCount,
|
count(DISTINCT(ls.nowin_staff)) totalStaffCount,
|
||||||
count(DISTINCT(td.leader_employee_id)) managementCount,
|
count(DISTINCT(td.leader_employee_id)) managementCount,
|
||||||
ifnull(round(count(DISTINCT(td.leader_employee_id))/count(DISTINCT(ls.id))*100,2),0) managementRate,
|
ifnull(round(count(DISTINCT(td.leader_employee_id))/count(DISTINCT(ls.id))*100,2),0) managementRate,
|
||||||
count(DISTINCT(ls.new_staff)) newStaffCount,
|
count(DISTINCT(ls.new_staff)) newStaffCount,
|
||||||
@ -148,16 +166,19 @@
|
|||||||
left join
|
left join
|
||||||
(select staff_id as leave_staff from lz_staff_occupation where date(resignation_time) between #{beginDate} and
|
(select staff_id as leave_staff from lz_staff_occupation where date(resignation_time) between #{beginDate} and
|
||||||
#{endDate}) so2
|
#{endDate}) so2
|
||||||
on so2.leave_staff=ll.id) ls,
|
on so2.leave_staff=ll.id
|
||||||
lz_departments_staff_relate dsr,lz_staff_occupation so,
|
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
|
(select * from lz_departments
|
||||||
<if test="departmentId != null and departmentId != ''">
|
<if test="departmentId != null and departmentId != ''">
|
||||||
where find_in_set(department_id, getChildList(#{departmentId}))
|
where find_in_set(department_id, getChildList(#{departmentId}))
|
||||||
</if>
|
</if>
|
||||||
) td
|
) 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 dsr.department_id=td.department_id
|
||||||
and (date(so.resignation_time)>=#{endDate} or so.resignation_time is null )
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getGenderData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
<select id="getGenderData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||||
@ -168,7 +189,7 @@
|
|||||||
end category,
|
end category,
|
||||||
count(gender) number
|
count(gender) number
|
||||||
from lz_staff
|
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)
|
so.resignation_time is null)
|
||||||
<if test="departmentId != null and departmentId != ''">
|
<if test="departmentId != null and departmentId != ''">
|
||||||
and 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
|
||||||
@ -181,19 +202,23 @@
|
|||||||
select
|
select
|
||||||
if(birthday=0,'未知',concat(birthday,'后')) category,
|
if(birthday=0,'未知',concat(birthday,'后')) category,
|
||||||
count(birthday) number
|
count(birthday) number
|
||||||
from (select id,ifnull(CONCAT(left(date_format(birthday,'%y'),1),'0'),0) birthday from lz_staff) ls
|
from (
|
||||||
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate} or
|
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)
|
so.resignation_time is null)
|
||||||
<if test="departmentId != null and departmentId != ''">
|
<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})))
|
dsr.department_id=ld.department_id and find_in_set(ld.department_id, getChildList(#{departmentId})))
|
||||||
</if>
|
</if>
|
||||||
group by ls.birthday
|
) t
|
||||||
|
group by t.birthday
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getJobSeniorityData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
<select id="getJobSeniorityData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||||
select
|
select
|
||||||
ls.jobYear category,
|
t.jobYear category,
|
||||||
count(jobYear) number
|
count(jobYear) number
|
||||||
from (
|
from (
|
||||||
select staff_id,
|
select staff_id,
|
||||||
@ -208,31 +233,34 @@
|
|||||||
TIMESTAMPDIFF(YEAR,job_begin_time,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S'))<![CDATA[ <= ]]>10
|
TIMESTAMPDIFF(YEAR,job_begin_time,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S'))<![CDATA[ <= ]]>10
|
||||||
then '5-10年'
|
then '5-10年'
|
||||||
when TIMESTAMPDIFF(YEAR,job_begin_time,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S')) <![CDATA[ > ]]> 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
|
then '10年以上' else '未知' end jobYear from lz_staff_occupation ls
|
||||||
) ls
|
where ls.staff_id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate}
|
||||||
where ls.staff_id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate}
|
|
||||||
or so.resignation_time is null)
|
or so.resignation_time is null)
|
||||||
<if test="departmentId != null and departmentId != ''">
|
<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
|
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})))
|
dsr.department_id=ld.department_id and find_in_set(ld.department_id, getChildList(#{departmentId})))
|
||||||
</if>
|
</if>
|
||||||
group by ls.jobYear
|
) t
|
||||||
|
group by t.jobYear
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getEducationData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
<select id="getEducationData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||||
select
|
select
|
||||||
ls.education category,
|
y.education category,
|
||||||
count(education) number
|
count(education) number
|
||||||
from (
|
from (
|
||||||
select ss.id,ifnull(se.education,'未知') education from lz_staff ss left join lz_staff_education se on
|
select t.id,ifnull(se.education,'未知') education from
|
||||||
se.staff_id=ss.id
|
(select ls.id from lz_staff ls
|
||||||
) ls
|
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate} or
|
||||||
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate} or
|
|
||||||
so.resignation_time is null)
|
so.resignation_time is null)
|
||||||
<if test="departmentId != null and departmentId != ''">
|
<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 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})))
|
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>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
select * from lz_staff_occupation where is_delete=0 and staff_id = #{staffId}
|
select * from lz_staff_occupation where is_delete=0 and staff_id = #{staffId}
|
||||||
</select>
|
</select>
|
||||||
<select id="getOccupationByStaffId" resultType="com.lz.modules.app.Dto.StaffOccupationInfoDto">
|
<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}
|
from lz_staff_occupation where staff_id=#{staffId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ spring:
|
|||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
druid:
|
druid:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
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
|
username: ldd_biz
|
||||||
password: Hello1234
|
password: Hello1234
|
||||||
initial-size: 10
|
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 id="getStaffInfos" resultType="com.lz.modules.app.Dto.StaffDto">
|
||||||
select ls.id staffId,lso.employee_no staff_no,ls.name,lso.position,
|
select ls.id staffId,lso.employee_no staff_no,ls.name,lso.position,
|
||||||
case lso.staff_status when 0 then '在职' else '离职' end staff_status,
|
case lso.staff_status when 0 then '在职' else '离职' end staff_status,
|
||||||
if(ls.employee_id=ld.leader_employee_id,1,0) department_leader
|
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,lz_departments_staff_relate dsr,lz_departments ld
|
from lz_staff ls,lz_staff_occupation lso
|
||||||
where lso.staff_id=ls.id and ls.is_delete=0 and dsr.staff_id = ls.id and ld.department_id=dsr.department_id
|
where lso.staff_id=ls.id and ls.is_delete=0
|
||||||
and lso.staff_status=#{staffStatus}
|
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 != ''">
|
<if test="departmentId != null and departmentId != ''">
|
||||||
and dsr.department_id=#{departmentId}
|
and dsr.department_id=#{departmentId}
|
||||||
</if>
|
</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>
|
</if>
|
||||||
|
))
|
||||||
limit #{startIndex}, #{pageLimit}
|
limit #{startIndex}, #{pageLimit}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getStaffInfoCount" resultType="java.lang.Integer">
|
<select id="getStaffInfoCount" resultType="java.lang.Integer">
|
||||||
select count(1)
|
select count(ls.id) count
|
||||||
from lz_staff ls,lz_staff_occupation lso,lz_departments_staff_relate dsr,lz_departments ld
|
from lz_staff ls,lz_staff_occupation lso
|
||||||
where lso.staff_id=ls.id and ls.is_delete=0 and dsr.staff_id = ls.id and ld.department_id=dsr.department_id
|
where lso.staff_id=ls.id and ls.is_delete=0
|
||||||
and lso.staff_status=#{staffStatus}
|
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 != ''">
|
<if test="departmentId != null and departmentId != ''">
|
||||||
and dsr.department_id=#{departmentId}
|
and dsr.department_id=#{departmentId}
|
||||||
</if>
|
</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>
|
</if>
|
||||||
|
))
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBaseInfo" resultType="com.lz.modules.app.Dto.StaffBaseInfoDto">
|
<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 id="getStatisticalData" resultType="com.lz.modules.app.Dto.StaffStatisticalDto">
|
||||||
select
|
select
|
||||||
count(DISTINCT(ls.id)) totalStaffCount,
|
count(DISTINCT(ls.nowin_staff)) totalStaffCount,
|
||||||
count(DISTINCT(td.leader_employee_id)) managementCount,
|
count(DISTINCT(td.leader_employee_id)) managementCount,
|
||||||
ifnull(round(count(DISTINCT(td.leader_employee_id))/count(DISTINCT(ls.id))*100,2),0) managementRate,
|
ifnull(round(count(DISTINCT(td.leader_employee_id))/count(DISTINCT(ls.id))*100,2),0) managementRate,
|
||||||
count(DISTINCT(ls.new_staff)) newStaffCount,
|
count(DISTINCT(ls.new_staff)) newStaffCount,
|
||||||
@ -148,16 +166,19 @@
|
|||||||
left join
|
left join
|
||||||
(select staff_id as leave_staff from lz_staff_occupation where date(resignation_time) between #{beginDate} and
|
(select staff_id as leave_staff from lz_staff_occupation where date(resignation_time) between #{beginDate} and
|
||||||
#{endDate}) so2
|
#{endDate}) so2
|
||||||
on so2.leave_staff=ll.id) ls,
|
on so2.leave_staff=ll.id
|
||||||
lz_departments_staff_relate dsr,lz_staff_occupation so,
|
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
|
(select * from lz_departments
|
||||||
<if test="departmentId != null and departmentId != ''">
|
<if test="departmentId != null and departmentId != ''">
|
||||||
where find_in_set(department_id, getChildList(#{departmentId}))
|
where find_in_set(department_id, getChildList(#{departmentId}))
|
||||||
</if>
|
</if>
|
||||||
) td
|
) 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 dsr.department_id=td.department_id
|
||||||
and (date(so.resignation_time)>=#{endDate} or so.resignation_time is null )
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getGenderData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
<select id="getGenderData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||||
@ -168,7 +189,7 @@
|
|||||||
end category,
|
end category,
|
||||||
count(gender) number
|
count(gender) number
|
||||||
from lz_staff
|
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)
|
so.resignation_time is null)
|
||||||
<if test="departmentId != null and departmentId != ''">
|
<if test="departmentId != null and departmentId != ''">
|
||||||
and 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
|
||||||
@ -181,19 +202,23 @@
|
|||||||
select
|
select
|
||||||
if(birthday=0,'未知',concat(birthday,'后')) category,
|
if(birthday=0,'未知',concat(birthday,'后')) category,
|
||||||
count(birthday) number
|
count(birthday) number
|
||||||
from (select id,ifnull(CONCAT(left(date_format(birthday,'%y'),1),'0'),0) birthday from lz_staff) ls
|
from (
|
||||||
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate} or
|
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)
|
so.resignation_time is null)
|
||||||
<if test="departmentId != null and departmentId != ''">
|
<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})))
|
dsr.department_id=ld.department_id and find_in_set(ld.department_id, getChildList(#{departmentId})))
|
||||||
</if>
|
</if>
|
||||||
group by ls.birthday
|
) t
|
||||||
|
group by t.birthday
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getJobSeniorityData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
<select id="getJobSeniorityData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||||
select
|
select
|
||||||
ls.jobYear category,
|
t.jobYear category,
|
||||||
count(jobYear) number
|
count(jobYear) number
|
||||||
from (
|
from (
|
||||||
select staff_id,
|
select staff_id,
|
||||||
@ -208,31 +233,34 @@
|
|||||||
TIMESTAMPDIFF(YEAR,job_begin_time,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S'))<![CDATA[ <= ]]>10
|
TIMESTAMPDIFF(YEAR,job_begin_time,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S'))<![CDATA[ <= ]]>10
|
||||||
then '5-10年'
|
then '5-10年'
|
||||||
when TIMESTAMPDIFF(YEAR,job_begin_time,DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%S')) <![CDATA[ > ]]> 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
|
then '10年以上' else '未知' end jobYear from lz_staff_occupation ls
|
||||||
) ls
|
where ls.staff_id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate}
|
||||||
where ls.staff_id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate}
|
|
||||||
or so.resignation_time is null)
|
or so.resignation_time is null)
|
||||||
<if test="departmentId != null and departmentId != ''">
|
<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
|
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})))
|
dsr.department_id=ld.department_id and find_in_set(ld.department_id, getChildList(#{departmentId})))
|
||||||
</if>
|
</if>
|
||||||
group by ls.jobYear
|
) t
|
||||||
|
group by t.jobYear
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getEducationData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
<select id="getEducationData" resultType="com.lz.modules.app.Dto.GraphicsStatisticalDto">
|
||||||
select
|
select
|
||||||
ls.education category,
|
y.education category,
|
||||||
count(education) number
|
count(education) number
|
||||||
from (
|
from (
|
||||||
select ss.id,ifnull(se.education,'未知') education from lz_staff ss left join lz_staff_education se on
|
select t.id,ifnull(se.education,'未知') education from
|
||||||
se.staff_id=ss.id
|
(select ls.id from lz_staff ls
|
||||||
) ls
|
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)<![CDATA[ >= ]]>#{endDate} or
|
||||||
where ls.id in (select so.staff_id from lz_staff_occupation so where date(so.resignation_time)>=#{endDate} or
|
|
||||||
so.resignation_time is null)
|
so.resignation_time is null)
|
||||||
<if test="departmentId != null and departmentId != ''">
|
<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 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})))
|
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>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
select * from lz_staff_occupation where is_delete=0 and staff_id = #{staffId}
|
select * from lz_staff_occupation where is_delete=0 and staff_id = #{staffId}
|
||||||
</select>
|
</select>
|
||||||
<select id="getOccupationByStaffId" resultType="com.lz.modules.app.Dto.StaffOccupationInfoDto">
|
<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}
|
from lz_staff_occupation where staff_id=#{staffId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user