zouyu
2026-03-06 79841a6a5ecd713a9f02d23552619cbba1c991ad
performance-server/src/main/resources/mapper/PerformanceShiftMapper.xml
@@ -2,37 +2,45 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.performance.mapper.PerformanceShiftMapper">
    <resultMap id="performanceShiftPageMap" type="com.ruoyi.performance.dto.PerformanceShiftMapDto">
        <result column="name" property="name"/>
    <resultMap id="performanceShiftMap" type="com.ruoyi.performance.dto.PerformanceShiftMapDto">
        <id column="id" property="id"/>
        <result column="shift" property="shift"/>
        <result column="work_time" property="workTime"/>
        <result column="annotation_text" property="annotationText"/>
        <result column="user_name" property="userName"/>
        <result column="shift_time" property="shiftTime"/>
        <result column="user_id" property="userId" />
        <result column="department" property="department" />
    </resultMap>
    <select id="performanceShiftPage" resultMap="performanceShiftPageMap">
    <select id="performanceShift" resultMap="performanceShiftMap">
        SELECT
        if(u2.department is not null and u2.department != '', CONCAT(u2.name, '(', u2.department, ')'), u2.name) name,
        GROUP_CONCAT(s.work_time, ':', s.shift, ':', s.id order by s.work_time SEPARATOR ';') AS shift_time, u2.id user_id
        s.id,
        s.shift,
        s.work_time,
        s.annotation_text,
        u2.name AS user_name,
        u2.id user_id
        FROM performance_shift s
        LEFT JOIN (SELECT distinct u.* from
        user u
        left join department_lims dl on FIND_IN_SET(dl.id,u.depart_lims_id)
        where state=1
        where status = '0'
        and del_flag = '0'
        <if test="laboratory != null and laboratory != ''">
          and   dl.name=#{laboratory}
        </if>
         ) u2    on u2.id = s.user_id
        <where>
            name is not null
            <if test="time != null and time != ''">
                and DATE_FORMAT(s.work_time, '%Y-%m') = DATE_FORMAT(#{time}, '%Y-%m' )
            u2.name is not null
            <if test="firstDayOfMonth != null and lastDayOfMonth != null">
                AND s.work_time BETWEEN #{firstDayOfMonth} AND #{lastDayOfMonth}
            </if>
            <if test="userName != null and userName != ''">
                and u2.name like concat('%', #{userName}, '%')
            </if>
        </where>
        order by s.create_time
        GROUP BY u2.id
    </select>
    <select id="performanceShiftYearPage" resultType="map">
@@ -42,7 +50,8 @@
        LEFT JOIN (SELECT u.* from
        user u
        left join department_lims dl on FIND_IN_SET(dl.id,u.depart_lims_id)
        where state=1
        where status = '0'
        and del_flag = '0'
        <if test="laboratory != null and laboratory != ''">
            and   dl.name=#{laboratory}
        </if>
@@ -59,16 +68,20 @@
        order by s.create_time
    </select>
    <select id="performanceShiftYear" resultType="java.util.Map">
        SELECT if(u2.department is not null and u2.department != '', CONCAT(u2.name, '(', u2.department, ')'), u2.name) name,
        s.user_id, u2.account,
        DATE_FORMAT(s.work_time, '%c') work_time,
        GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), ':', s.shift order by s.work_time SEPARATOR ';') month_str
    <select id="performanceShiftYear" resultMap="performanceShiftMap">
        SELECT distinct
        u2.name AS user_name,
        s.user_id,
        u2.account,
        DATE_FORMAT(s.work_time, '%c') month_num,
        s.shift,
        s.id
        FROM performance_shift s
        LEFT JOIN (SELECT u.* from
        user u
        left join department_lims dl on FIND_IN_SET(dl.id,u.depart_lims_id)
        where state=1
        where status = '0'
        and del_flag = '0'
        <if test="laboratory != null and laboratory != ''">
            and   dl.name=#{laboratory}
        </if>
@@ -80,14 +93,14 @@
            and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' )
        </if>
        <if test="userName != null and userName != ''">
            and u.name like concat('%', #{userName}, '%')
            and u2.name like concat('%', #{userName}, '%')
        </if>
        GROUP BY u2.id
        order by s.create_time
    </select>
    <select id="performanceShiftYearList" resultType="map">
        SELECT if(u.department is not null and u.department != '', CONCAT(u.name, '(', u.department, ')'), u.name) name,
        SELECT
        u.name name,
        s.user_id, u.account,
        DATE_FORMAT(s.work_time, '%c') work_time,
        GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), ':', s.shift order by s.work_time SEPARATOR ';') month_str
@@ -107,10 +120,10 @@
        order by s.create_time
    </select>
    <select id="performanceShiftList" resultMap="performanceShiftPageMap">
    <select id="performanceShiftList" resultMap="performanceShiftMap">
        SELECT
        if(u.department is not null and u.department != '', CONCAT(u.name, '(', u.department, ')'), u.name) name,
        GROUP_CONCAT(s.work_time, ':', s.shift, ':', s.id order by s.work_time SEPARATOR ';') AS shift_time, u.id user_id, u.department
        u.name name,
        GROUP_CONCAT(s.work_time, ':', s.shift, ':', s.id order by s.work_time SEPARATOR ';') AS shift_time, u.id user_id
        FROM performance_shift s
        LEFT JOIN user u on u.id = s.user_id
        <where>
@@ -123,8 +136,8 @@
            <if test="laboratory != null and laboratory != ''">
            </if>
        </where>
        order by s.create_time
        GROUP BY u.id
        order by s.create_time
    </select>
    <select id="seldepLimsId" resultType="java.lang.String">