zss
4 小时以前 3bdaa5708b94e64f813f70ede8ba0bbd1a3179ec
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
<?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.ProductionProductRouteItemMapper">
 
    <resultMap id="BaseResultMap" type="com.ruoyi.production.pojo.ProductionProductRouteItem">
        <id column="id" property="id"/>
        <result column="product_main_id" property="productMainId"/>
        <result column="post_name" property="postName"/>
        <result column="equipment_malfunction" property="equipmentMalfunction"/>
        <result column="equipment_disposal" property="equipmentDisposal"/>
        <result column="process_explained" property="processExplained"/>
        <result column="process_id" property="processId"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="tenant_id" property="tenantId"/>
    </resultMap>
    <select id="processPage" resultType="com.ruoyi.quality.dto.ProcessPageDto">
        select ppri.id productionProductRouteItemId,
               ppri.create_time,
               ppm.product_no,
               po.nps_no,
               pp.name process,
               ppri.post_name,
               ppm.schedule,
               pms.material_code,
               pm.product_name,
               pms.model,
               po.strength,
               ppo.quantity qualifiedQuantity,
               ppo.scrap_qty unqualifiedQuantity,
               ppo.quantity + ppo.scrap_qty quantity
        from production_product_route_item ppri
                 left join production_product_main ppm on ppri.product_main_id = ppm.id
                 left join production_product_output ppo on ppo.product_main_id = ppm.id
                 left join product_order po on ppm.product_order_id = po.id
                 left join product_process pp on ppri.process_id = pp.id
                 left join product_material_sku pms on pms.id = po.product_material_sku_id
                 left join product_material pm on pm.id = pms.product_id
        where 1=1
            <if test="c.npsNo != null and c.npsNo != ''">
                AND po.nps_no LIKE CONCAT('%', #{c.npsNo}, '%')
            </if>
            <if test="c.process != null and c.process != ''">
                AND pp.name LIKE CONCAT('%', #{c.process}, '%')
            </if>
            <if test="c.productNo != null and c.productNo != ''">
                AND ppm.product_no LIKE CONCAT('%', #{c.productNo}, '%')
            </if>
            <if test="c.productName != null and c.productName != ''">
                AND pm.product_name LIKE CONCAT('%', #{c.productName}, '%')
            </if>
            <if test="c.materialCode != null and c.materialCode != ''">
                AND pms.material_code LIKE CONCAT('%', #{c.materialCode}, '%')
            </if>
            <if test="c.model != null and c.model != ''">
                AND pms.model LIKE CONCAT('%', #{c.model}, '%')
            </if>
            <if test="c.strength != null and c.strength != ''">
                AND po.strength = #{c.strength}
            </if>
            <if test="c.startTime != null and c.endTime != null">
                AND ppri.create_time BETWEEN #{c.startTime} AND #{c.endTime} + INTERVAL 1 DAY - INTERVAL 1 MICROSECOND
            </if>
        order by ppri.id desc
    </select>
 
</mapper>