yangys
2024-10-15 131d4bcb26e721c09c89d330f78639af7a0eda72
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.qianwen.smartman.modules.coproduction.mapper.PlanMapper">
 
    <select id="getProductType" resultType="com.qianwen.smartman.modules.coproduction.dto.PlanProductTypeDTO">
        SELECT
            p.id as productId,
            pt.NAME as productTypeName
        FROM
            blade_product p
        LEFT JOIN blade_product_type pt ON p.type_id = pt.id
        WHERE
            p.id IN
        <foreach collection="products" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
        AND p.is_deleted = 0
        AND pt.is_deleted =0
    </select>
    <!--工艺路线查询-->
    <select id="getListCraft" resultType="com.qianwen.smartman.modules.coproduction.dto.PlanCraftDTO">
        SELECT
            cr.id as craftId,
            cr.NAME as craftName,
            pcv.NAME as versionName,
            pcv.id AS versionId,
            pcv.edition_status AS editionStatus,
            p.id as productId,
            p.name as productName,
            p.code as productCode
        FROM
            blade_craft_routing cr
                LEFT JOIN blade_product p ON p.id =cr.product_id
                LEFT JOIN blade_production_craft_version pcv ON pcv.craft_id=cr.id
        WHERE
            cr.is_deleted = 0
          AND pcv.is_deleted = 0 AND pcv.edition_status=1
    </select>
</mapper>