zhuo
2025-04-03 eb975b40828b3a930fb38b75c739a7385b14ee12
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
<?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.basic.mapper.ProductPartMapper">
    <select id="selectListByProductId" resultType="com.ruoyi.basic.pojo.ProductPart">
        SELECT * from product_part pp
        where  pp.product_id=#{productId}
    </select>
    <select id="inspectionItems" resultType="java.util.Map">
        SELECT DISTINCT
        sp.inspection_item AS inspectionItem
        FROM
        structure_item_parameter sp
        WHERE 1=1
        <if test="name != null and name != ''">
            AND JSON_CONTAINS(sp.sample, concat('"', #{name}, '"'))
        </if>
        AND sp.son_laboratory = '原材料'
    </select>
    <select id="productPartLogList" resultType="java.util.Map">
        SELECT
            pp.part_no AS partNo,
            pp.color,
            pp.color_code AS colorCode,
            pp.inspection_item AS inspectionItem,
            pp.review,
            pl.oper_name AS operName,
            pl.oper_time AS operTime
        FROM
            product_part pp
                LEFT JOIN product_part_log pl ON pp.id = pl.product_part_id
        WHERE
            pp.id = #{id}
    </select>
</mapper>