yangys
2024-12-30 7cd413d0f1e3235223848d47e428aad97f9f13fc
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
65
66
67
68
69
70
71
72
73
<?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.qianwen.smartman.modules.workinghour.mapper.PartWorkingHourMapper">
 
 
    <select id="listPage" resultType="com.qianwen.smartman.modules.workinghour.vo.PartWorkingHourVO">
        SELECT
        h.id,
        h.part_no,
        process_no,
    version,
    workstation_id,
    ws.name as workstation_name,
    start_time,
    end_time,
    occupancy_secs,     
    clamping_secs,     
    first_working_secs,
    last_remove_secs,
    first_measure_secs,
     processing_secs,
    prepare_secs,
    single_process_secs,
        h.amount
        FROM part_workinghour h
        LEFT JOIN blade_workstation ws on h.workstation_id=ws.id
       
        <where>
            h.is_deleted = 0
            <if test="partNo != null">
                and h.part_no like concat('%',#{partNo,jdbcType=VARCHAR},'%')
            </if>
            <if test="startDate != null">
                and h.start_time &gt;= #{startDate}
            </if>
            <if test="endDate != null">
                and h.start_time &lt; date_add(#{endDate}, INTERVAL 1 day)
            </if>
        </where>
        ORDER BY h.start_time DESC 
    </select>
   
   <select id="listVOByIds" resultType="com.qianwen.smartman.modules.workinghour.vo.PartWorkingHourVO">
        SELECT
        h.id,
        h.part_no,
        process_no,
    version,
    workstation_id,
    ws.name as workstation_name,
    start_time,
    end_time,
    occupancy_secs,     
    clamping_secs,     
    first_working_secs,
    last_remove_secs,
    first_measure_secs,
     processing_secs,
    prepare_secs,
    single_process_secs,
        h.amount
        FROM part_workinghour h
        LEFT JOIN blade_workstation ws on h.workstation_id=ws.id
       
         where   h.id in 
        <foreach collection="ids" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
        
        ORDER BY h.start_time DESC 
    </select>
 
</mapper>