liyong
9 小时以前 2652673d45d9f142baed0d92f1deab38276dbd90
src/main/resources/mapper/basic/ProductModelMapper.xml
@@ -15,9 +15,16 @@
        <result column="product_id" property="productId" />
    </resultMap>
    <select id="listPageProductModel" resultType="com.ruoyi.basic.pojo.ProductModel">
        select pm.*,p.product_name
        select pm.*,p.product_name,p.parent_id,p1.product_name as parent_name,
        case
        when p1.product_name is null then 0 -- 原材料
        when p1.product_name is not null and p1.product_name like '%半成品%' then 1 -- 半成品
        when p1.product_name is not null and p1.product_name like '%成品%' then 2 -- 成品
        else 0 -- 默认为原材料
        end as product_type
        from product_model pm
        left join product p on pm.product_id = p.id
        left join product p1 on p1.id = p.parent_id
        <where>
            <if test="c.model != null and c.model != ''">
                and pm.model  like  concat('%',#{c.model},'%')
@@ -27,6 +34,7 @@
            </if>
        </where>
        order by  pm.id
    </select>
    <select id="selectLatestRecord" resultType="com.ruoyi.basic.pojo.ProductModel">
            SELECT * FROM product_model