lyh
2025-01-23 8d63dd77b9b3cd9b6d9768f216670fc499a8cab3
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/xml/ProcessStreamMapper.xml
@@ -20,10 +20,46 @@
             , p.create_by
             , p.UPDATE_TIME
             , p.update_by
             , (select sys_user.realname from sys_user where p.create_by=sys_user.username) as createName
             , (select sys_user.realname from sys_user where p.update_by=sys_user.username) as updateName
        from nc_process_stream p
                 inner join
             (select distinct PROCESS_ID from nc_permission_stream where delete_flag = 0 and user_id=#{userId}) s
             on p.PROCESS_ID = s.PROCESS_ID
        where p.delete_flag = 0
    </select>
    <select id="findByPartsAndComponents" resultType="org.jeecg.modules.dnc.entity.ProcessStream">
        SELECT
        *
        FROM
        nc_process_stream ps
        WHERE
        ps.PROCESS_ID IN (
        SELECT
        pss.PROCESS_ID
        FROM
        nc_process_stream pss
        WHERE
        1=1
        <if test="productId != null and productId != ''">
        AND pss.PRODUCT_ID = #{productId}
        </if>
        <if test="componentIds != null and componentIds.size() > 0">
        AND pss.COMPONENT_ID IN
        <foreach collection = "componentIds" item = "componentId" index = "index" open = "(" close= ")" separator = ",">
        #{ componentId }
        </foreach>
        </if>
        AND (
        pss.PARTS_ID IS NULL
        <if test="partsIds != null and partsIds.size() > 0">
        OR pss.PARTS_ID IN
        <foreach collection = "partsIds" item = "partsId" index = "index" open = "(" close = ")" separator = ",">
        #{ partsId }
        </foreach>
        </if>
        )
        );
    </select>
</mapper>