zxl
2025-12-11 ad7cbfd8fd19fcce4345a4907c1f059a34c2869b
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
53
54
55
56
57
58
59
60
61
62
63
64
<?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.ycl.mapper.WorkStationScheduleMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.domain.vo.WorkStationScheduleVO">
        <result column="user_id" property="userId" />
        <result column="content" property="content" />
        <result column="status" property="status" />
        <result column="gmt_create" property="gmtCreate" />
        <result column="gmt_update" property="gmtUpdate" />
    </resultMap>
 
 
    <select id="getById" resultMap="BaseResultMap">
        SELECT
            TWSS.user_id,
            TWSS.content,
            TWSS.status,
            TWSS.gmtCreate,
            TWSS.gmtUpdate,
            TWSS.id
        FROM
            t_work_station_schedule TWSS
        WHERE
            TWSS.id = #{id} AND TWSS.deleted = 0
    </select>
 
 
    <select id="getPage" resultMap="BaseResultMap">
        SELECT
            TWSS.user_id,
            TWSS.content,
            TWSS.status,
            TWSS.gmtCreate,
            TWSS.gmtUpdate,
            TWSS.id
        FROM
            t_work_station_schedule TWSS
        WHERE
            TWSS.deleted = 0
    </select>
 
    <select id="groupByProjectAndDate" resultType="com.ycl.domain.vo.WorkStationScheduleVO">
        SELECT
        TWSS.id,
        TWSS.user_id,
        TWSS.content,
        TWSS.status,
        TWSS.project_id,
        TWSS.completed_time,
        TPI.project_name
        FROM t_work_station_schedule TWSS
        LEFT JOIN t_project_info TPI on TWSS.project_id = TPI.id
        WHERE TWSS.deleted = 0
        AND TWSS.user_id = #{userId}
        AND TWSS.completed_time BETWEEN #{startTime} AND #{endTime}
        <if test="projectId != null">
            AND TWSS.project_id = #{projectId}
        </if>;
    </select>
 
 
</mapper>