guoyujie
2025-10-23 cc8efc81d2d35bed40e47d0a5b0920a4b6f8095f
north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml
@@ -75,7 +75,16 @@
            </if>
        </where>
        order by id desc
        order by
        <if test="orderBy == null ">
            id desc
        </if>
        <if test="orderBy == 'desc'">
            ${field} desc
        </if>
        <if test="orderBy == 'asc'">
            ${field}
        </if>
        limit #{offset},#{pageSize}
        ;
    </select>
@@ -133,4 +142,14 @@
    <update id="updateProductStateById">
        update product set state = #{state} where id = #{id}
    </update>
    <select id="getGlassThickness">
        select sum(REPLACE(JSON_UNQUOTE(JSON_EXTRACT(separation, '$.thickness')),'mm',''))
        from product_detail as a
        where a.prod_id = #{productId}
        and a.id &lt;= (select b.id
                        from product_detail as b
                        where b.prod_id = #{productId} and b.glass_sort = #{technologyNumber})
    </select>
</mapper>