工艺组成上道工序、下道工序判断修改

This commit is contained in:
JinLu.Yin 2022-05-14 00:14:03 +08:00
parent 5374c2f32e
commit 8b661d5e7b

View File

@ -70,28 +70,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="findPreProcess" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult"> <select id="findPreProcess" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
<include refid="selectProRouteProcessVo"/> <include refid="selectProRouteProcessVo"/>
where route_id = #{routeId} where route_id = #{routeId}
AND order_num &lt; ( <choose>
SELECT order_num <when test="orderNum != null "> and order_num &lt; #{orderNum}</when>
FROM pro_route_process <otherwise>
WHERE route_id = #{routeId} AND order_num &lt; (
<if test="processId != null "> and process_id = #{processId}</if> SELECT order_num
<if test="orderNum != null "> and order_num = #{orderNum}</if> FROM pro_route_process
AND order_num = #{orderNum} limit 1 WHERE route_id = #{routeId} limit 1
) )
</otherwise>
</choose>
ORDER BY order_num DESC LIMIT 1 ORDER BY order_num DESC LIMIT 1
</select> </select>
<select id="findNextProcess" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult"> <select id="findNextProcess" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
<include refid="selectProRouteProcessVo"/> <include refid="selectProRouteProcessVo"/>
where route_id = #{routeId} where route_id = #{routeId}
AND order_num &gt; ( <choose>
SELECT order_num <when test="orderNum != null "> and order_num &gt; #{orderNum}</when>
FROM pro_route_process <otherwise>
WHERE route_id = #{routeId} AND order_num &gt; (
<if test="processId != null "> and process_id = #{processId}</if> SELECT order_num
<if test="orderNum != null "> and order_num = #{orderNum}</if> FROM pro_route_process
AND order_num = #{orderNum} limit 1 WHERE route_id = #{routeId} limit 1
) )
</otherwise>
</choose>
ORDER BY order_num ASC LIMIT 1 ORDER BY order_num ASC LIMIT 1
</select> </select>