吴羡
4 天以前 cde451468d868fc7d3044d915c5b71e7cb9cb203
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
<?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.production.mapper.ProductionSchedulingMapper">
 
    <select id="pageProductionScheduling" resultType="com.ruoyi.production.dto.ProductionSchedulingDto">
        select t.*, w.name as workshop_name, pt.team_name
        from production_scheduling t
        left join workshop w on t.workshop_id = w.id
        left join production_team pt on t.team_id = pt.id
        <where>
            <if test="c.startDate != null">
                and t.work_date &gt;= #{c.startDate}
            </if>
            <if test="c.endDate != null">
                and t.work_date &lt;= #{c.endDate}
            </if>
            <if test="c.workshopId != null">
                and t.workshop_id = #{c.workshopId}
            </if>
            <if test="c.teamId != null">
                and t.team_id = #{c.teamId}
            </if>
            <if test="c.status != null">
                and t.status = #{c.status}
            </if>
        </where>
        order by t.work_date desc, t.id desc
    </select>
 
    <select id="todayByTeam" resultType="com.ruoyi.production.dto.ProductionSchedulingDto">
        select t.*, w.name as workshop_name, pt.team_name
        from production_scheduling t
        left join workshop w on t.workshop_id = w.id
        left join production_team pt on t.team_id = pt.id
        where t.team_id = #{teamId} and t.work_date = #{workDate}
        order by t.id desc
        limit 1
    </select>
</mapper>