| | |
| | | soj.staff_no as staffNo, |
| | | soj.sex as sex, |
| | | soj.native_place as nativePlace, |
| | | soj.nation as nation, |
| | | soj.adress as adress, |
| | | soj.first_study as firstStudy, |
| | | soj.profession as profession, |
| | |
| | | where 1=1 |
| | | <if test="c.staffName != null and c.staffName != '' "> |
| | | AND soj.staff_name LIKE CONCAT('%',#{c.staffName},'%') |
| | | </if> |
| | | <if test="c.nation != null and c.nation != '' "> |
| | | AND soj.nation = #{c.nation} |
| | | </if> |
| | | </select> |
| | | <select id="staffLeaveList" resultType="com.ruoyi.staff.dto.StaffLeaveDto"> |
| | |
| | | AND soj.staff_name LIKE CONCAT('%',#{c.staffName},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="staffLeaveReasonAnalytics" resultType="com.ruoyi.staff.dto.StaffLeaveDto"> |
| | | SELECT |
| | | staff_leave.reason as reason, |
| | | COUNT(*) as count |
| | | FROM staff_leave |
| | | LEFT JOIN |
| | | staff_on_job soj ON soj.id = staff_leave.staff_on_job_id |
| | | where 1=1 |
| | | GROUP BY staff_leave.reason |
| | | </select> |
| | | |
| | | <!-- 统计指定月份的离职员工数 --> |
| | | <select id="countLeaveByMonth" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) |
| | | FROM staff_leave sl |
| | | LEFT JOIN staff_on_job soj ON sl.staff_on_job_id = soj.id |
| | | WHERE DATE_FORMAT(sl.create_time, '%Y-%m-%d') BETWEEN #{monthStart} AND #{monthEnd} |
| | | AND soj.staff_state = 0 |
| | | </select> |
| | | </mapper> |