feat(wms): 添加排班管理的查询功能
- 在 WmsAttendanceScheduleMapper 中新增关联查询和批量插入方法 - 实现员工和班次信息的关联查询功能 - 添加分页查询排班列表的详细信息展示 - 扩展 WmsAttendanceScheduleVo 数据传输对象 - 完善排班详情查询和列表查询的服务层逻辑 - 集成员工姓名、部门、岗位及班次时间等详细信息 - 优化批量插入排班数据的功能实现
This commit is contained in:
@@ -19,5 +19,73 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.klp.domain.vo.WmsAttendanceScheduleVo" id="WmsAttendanceScheduleVoResult">
|
||||
<result property="scheduleId" column="schedule_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="workDate" column="work_date"/>
|
||||
<result property="shiftId" column="shift_id"/>
|
||||
<result property="shiftName" column="shift_name"/>
|
||||
<result property="shiftGroup" column="shift_group"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="employeeName" column="employee_name"/>
|
||||
<result property="employeeDept" column="employee_dept"/>
|
||||
<result property="employeeJobType" column="employee_job_type"/>
|
||||
<result property="shiftType" column="shift_type"/>
|
||||
<result property="shiftStartTime" column="shift_start_time"/>
|
||||
<result property="shiftEndTime" column="shift_end_time"/>
|
||||
<result property="workHours" column="work_hours"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectScheduleWithDetailsVo">
|
||||
SELECT s.schedule_id, s.user_id, s.work_date, s.shift_id, s.shift_name, s.shift_group, s.remark,
|
||||
e.name as employee_name, e.dept as employee_dept, e.job_type as employee_job_type,
|
||||
sh.shift_type, sh.start_time as shift_start_time, sh.end_time as shift_end_time, sh.work_hours
|
||||
FROM wms_attendance_schedule s
|
||||
LEFT JOIN wms_employee_info e ON s.user_id = e.info_id AND e.del_flag = 0
|
||||
LEFT JOIN wms_attendance_shift sh ON s.shift_id = sh.shift_id AND sh.del_flag = 0
|
||||
WHERE s.del_flag = 0
|
||||
</sql>
|
||||
|
||||
<select id="selectScheduleWithDetails" parameterType="java.util.Map" resultMap="WmsAttendanceScheduleVoResult">
|
||||
<include refid="selectScheduleWithDetailsVo"/>
|
||||
<if test="userId != null">
|
||||
AND s.user_id = #{userId}
|
||||
</if>
|
||||
<if test="workDate != null">
|
||||
AND s.work_date = #{workDate}
|
||||
</if>
|
||||
<if test="shiftId != null">
|
||||
AND s.shift_id = #{shiftId}
|
||||
</if>
|
||||
ORDER BY s.work_date DESC, s.user_id
|
||||
</select>
|
||||
|
||||
<select id="selectScheduleWithDetailsPage" parameterType="java.util.Map" resultMap="WmsAttendanceScheduleVoResult">
|
||||
<include refid="selectScheduleWithDetailsVo"/>
|
||||
<if test="userId != null">
|
||||
AND s.user_id = #{userId}
|
||||
</if>
|
||||
<if test="workDate != null">
|
||||
AND s.work_date = #{workDate}
|
||||
</if>
|
||||
<if test="shiftId != null">
|
||||
AND s.shift_id = #{shiftId}
|
||||
</if>
|
||||
<if test="shiftName != null and shiftName != ''">
|
||||
AND s.shift_name LIKE CONCAT('%', #{shiftName}, '%')
|
||||
</if>
|
||||
<if test="shiftGroup != null and shiftGroup != ''">
|
||||
AND s.shift_group = #{shiftGroup}
|
||||
</if>
|
||||
ORDER BY s.work_date DESC, s.user_id
|
||||
</select>
|
||||
|
||||
<insert id="insertBatch" parameterType="java.util.List">
|
||||
INSERT INTO wms_attendance_schedule (user_id, work_date, shift_id, shift_name, shift_group, remark)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.userId}, #{item.workDate}, #{item.shiftId}, #{item.shiftName}, #{item.shiftGroup}, #{item.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user