buhuazhen
2 天以前 93723438fd269d2f602439eabca127ed4054818a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?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.StaffSchedulingMapper">
 
    <resultMap id="BaseResultMap" type="com.ruoyi.staff.pojo.StaffScheduling">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="staffId" column="staff_id" jdbcType="INTEGER"/>
            <result property="department" column="department" jdbcType="INTEGER"/>
            <result property="shiftType" column="shift_type" jdbcType="INTEGER"/>
            <result property="workDate" column="work_date" jdbcType="DATE"/>
            <result property="workStartTime" column="work_start_time" jdbcType="TIMESTAMP"/>
            <result property="workEndTime" column="work_end_time" jdbcType="TIMESTAMP"/>
            <result property="workHours" column="work_hours" jdbcType="DECIMAL"/>
            <result property="status" column="status" jdbcType="INTEGER"/>
            <result property="remark" column="remark" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="createUser" column="create_user" jdbcType="BIGINT"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
            <result property="updateUser" column="update_user" jdbcType="BIGINT"/>
            <result property="tenantId" column="tenant_id" jdbcType="BIGINT"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        id,staff_id,department,
        shift_type,work_date,work_start_time,
        work_end_time,work_hours,status,
        remark,create_time,create_user,
        update_time,update_user,tenant_id
    </sql>
    <select id="listPage" resultType="com.ruoyi.staff.dto.StaffSchedulingDto">
        SELECT
        t1.*,t2.staff_name as 'staff_name' ,t2.staff_no as 'staff_no'
        FROM staff_scheduling t1
        left join staff_join_leave_record t2 on t1.staff_id = t2.id
        where 1=1
        <if test="vo.staffName != null and vo.staffName != '' ">
            AND t2.staff_name LIKE CONCAT('%', #{vo.staffName}, '%')
        </if>
        <if test="vo.shiftType != null and vo.shiftType != '' ">
            AND t1.shift_type = #{vo.shiftType}
        </if>
        <if test="vo.startDate != null ">
            AND t1.work_date >=  DATE_FORMAT(#{vo.startDate},'%Y-%m-%d')
        </if>
        <if test="vo.endDate != null ">
            AND t1.work_date  <![CDATA[ <= ]]> DATE_FORMAT(#{vo.endDate},'%Y-%m-%d')
        </if>
        ORDER BY t1.create_time DESC
    </select>
</mapper>