From f50da3afc73bc458640677c198bb7c99de5b2fe5 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期一, 09 三月 2026 17:33:45 +0800
Subject: [PATCH] fix(mybatis): 修正createUser和updateUser填充值类型空值处理
---
src/main/resources/mapper/staff/PersonalShiftMapper.xml | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 106 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/staff/PersonalShiftMapper.xml b/src/main/resources/mapper/staff/PersonalShiftMapper.xml
new file mode 100644
index 0000000..d8ddb1d
--- /dev/null
+++ b/src/main/resources/mapper/staff/PersonalShiftMapper.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.staff.mapper.PersonalShiftMapper">
+
+ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+ <resultMap id="BaseResultMap" type="com.ruoyi.staff.pojo.PersonalShift">
+ <id column="id" property="id" />
+ <result column="personal_attendance_location_config_id" property="personalAttendanceLocationConfigId" />
+ <result column="staff_on_job_id" property="staffOnJobId" />
+ <result column="create_time" property="createTime" />
+ <result column="update_time" property="updateTime" />
+ <result column="work_time" property="workTime" />
+ </resultMap>
+ <select id="performanceShiftPage" resultType="com.ruoyi.staff.dto.PerformanceShiftMapDto">
+ SELECT
+ u.staff_name name,
+ GROUP_CONCAT(s.work_time, '锛�', IFNULL(palc.shift, ''), '锛�', s.id order by s.work_time SEPARATOR ';') AS shift_time,
+ u.id user_id
+ FROM personal_shift s
+ LEFT JOIN staff_on_job u ON u.id = s.staff_on_job_id
+ LEFT JOIN personal_attendance_location_config palc ON palc.id = s.personal_attendance_location_config_id
+ <where>
+ <if test="sysDeptId != null and sysDeptId != ''">
+ and u.sys_dept_id = #{sysDeptId}
+ </if>
+ <if test="time != null and time != ''">
+ and DATE_FORMAT(s.work_time, '%Y-%m') = DATE_FORMAT(#{time}, '%Y-%m' )
+ </if>
+ <if test="userName != null and userName != ''">
+ and u.staff_name like concat('%', #{userName}, '%')
+ </if>
+ </where>
+ GROUP BY u.id
+ order by s.create_time
+ </select>
+
+ <select id="performanceShiftYear" resultType="java.util.Map">
+ SELECT
+ u.staff_name name,
+ u.id user_id,
+ u.staff_no account,
+ DATE_FORMAT(s.work_time, '%c') work_time,
+ GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), '锛�', IFNULL(palc.shift, '') order by s.work_time SEPARATOR ';') month_str
+ FROM personal_shift s
+ LEFT JOIN staff_on_job u ON u.id = s.staff_on_job_id
+ LEFT JOIN personal_attendance_location_config palc ON palc.id = s.personal_attendance_location_config_id
+ <where>
+ <if test="time != null and time != ''">
+ and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' )
+ </if>
+ <if test="userName != null and userName != ''">
+ and u.staff_name like concat('%', #{userName}, '%')
+ </if>
+ <if test="sysDeptId != null and sysDeptId != ''">
+ and u.sys_dept_id = #{sysDeptId}
+ </if>
+ </where>
+ GROUP BY u.id
+ order by s.create_time
+ </select>
+ <select id="performanceShiftYearList" resultType="java.util.Map">
+ SELECT
+ u.staff_name name,
+ s.staff_on_job_id user_id, u.staff_no account,
+ DATE_FORMAT(s.work_time, '%c') work_time,
+ GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), '锛�', IFNULL(palc.shift, '') order by s.work_time SEPARATOR ';') month_str
+ FROM personal_shift s
+ LEFT JOIN staff_on_job u ON u.id = s.staff_on_job_id
+ LEFT JOIN personal_attendance_location_config palc ON palc.id = s.personal_attendance_location_config_id
+ <where>
+ <if test="time != null and time != ''">
+ and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' )
+ </if>
+ <if test="userName != null and userName != ''">
+ and u.staff_name like concat('%', #{userName}, '%')
+ </if>
+ <if test="sysDeptId != null and sysDeptId != ''">
+ and u.sys_dept_id = #{sysDeptId}
+ </if>
+ </where>
+ GROUP BY u.id
+ order by s.create_time
+ </select>
+ <select id="performanceShiftList" resultType="com.ruoyi.staff.dto.PerformanceShiftMapDto">
+ SELECT
+ u.staff_name name,
+ GROUP_CONCAT(s.work_time, '锛�', IFNULL(palc.shift, ''), '锛�', s.id order by s.work_time SEPARATOR ';') AS shift_time, u.id user_id
+ FROM personal_shift s
+ LEFT JOIN staff_on_job u ON u.id = s.staff_on_job_id
+ LEFT JOIN personal_attendance_location_config palc ON palc.id = s.personal_attendance_location_config_id
+ <where>
+ <if test="time != null and time != ''">
+ and DATE_FORMAT(s.work_time, '%Y-%m') = DATE_FORMAT(#{time}, '%Y-%m' )
+ </if>
+ <if test="userName != null and userName != ''">
+ and u.staff_name like concat('%', #{userName}, '%')
+ </if>
+ <if test="sysDeptId != null and sysDeptId != ''">
+ and u.sys_dept_id = #{sysDeptId}
+ </if>
+ </where>
+ GROUP BY u.id
+ order by s.create_time
+ </select>
+
+</mapper>
--
Gitblit v1.9.3