|
|
|
@ -131,8 +131,9 @@ record_version,out_work_order_flag,project_id,order_type,auth_rule_id,bu) |
|
|
|
FROM SOIssueNotifyOrderMaterialList WITH (NOLOCK) |
|
|
|
WHERE notify_no=#{notifyNo} AND site=#{site} AND issueType=#{issueType} |
|
|
|
</select> |
|
|
|
<!-- 注意:不能用NOLOCK,结果用于生成新的item_no插入记录,脏读可能导致主键冲突 - rqrq --> |
|
|
|
<select id="getNextItemForSOIssueNotifyOrderList" resultType="BigDecimal"> |
|
|
|
SELECT ISNULL(MAX(item_no), 0) + 1 FROM SOIssueNotifyOrderList WITH (NOLOCK) WHERE site=#{site} AND notify_no=#{notifyNo} |
|
|
|
SELECT ISNULL(MAX(item_no), 0) + 1 FROM SOIssueNotifyOrderList WHERE site=#{site} AND notify_no=#{notifyNo} |
|
|
|
</select> |
|
|
|
<select id="getProductAreaByPlanner" resultType="String"> |
|
|
|
select top 1 area_type from sys_product_plannet where site=#{site} and planner=#{planner} |
|
|
|
@ -315,9 +316,10 @@ record_version,out_work_order_flag,project_id,order_type,auth_rule_id,bu) |
|
|
|
group by g.component_part_no,g.qty_to_issue ,g.partDesc |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 注意:不能用NOLOCK,结果用于判断是否可以删除订单明细,脏读可能导致错误删除 - rqrq --> |
|
|
|
<select id="checkDeleteOrderList" resultType="SOIssueNotifyOrderMaterialListData"> |
|
|
|
SELECT notify_no, site, item_no, BOMItemNo, ComponentPartNo, QtyToIssue, QtyToIssue_Original |
|
|
|
FROM SOIssueNotifyOrderMaterialList WITH (NOLOCK) |
|
|
|
FROM SOIssueNotifyOrderMaterialList |
|
|
|
WHERE site=#{site} AND notify_no=#{notifyNo} AND ItemNo=#{itemNo,jdbcType=DOUBLE} |
|
|
|
</select> |
|
|
|
|
|
|
|
@ -327,9 +329,10 @@ record_version,out_work_order_flag,project_id,order_type,auth_rule_id,bu) |
|
|
|
SET status = #{status} |
|
|
|
WHERE site = #{site} AND notify_no = #{notifyNo} |
|
|
|
</update> |
|
|
|
<!-- 注意:不能用NOLOCK,结果用于判断是否可以删除物料明细,脏读可能导致错误删除 - rqrq --> |
|
|
|
<select id="checkDeleteMaterial" resultType="SOIssueNotifyOrderMaterialListData"> |
|
|
|
SELECT notify_no, site, ItemNo, BOMItemNo, ComponentPartNo, QtyToIssue, QtyToIssue_Original |
|
|
|
FROM SOIssueNotifyOrderMaterialList WITH (NOLOCK) |
|
|
|
FROM SOIssueNotifyOrderMaterialList |
|
|
|
WHERE site=#{site} AND notify_no=#{notifyNo} AND ItemNo=#{itemNo} AND BOMItemNo=#{bOMItemNo} |
|
|
|
</select> |
|
|
|
<select id="deleteNotifyMaterial"> |
|
|
|
@ -347,19 +350,21 @@ record_version,out_work_order_flag,project_id,order_type,auth_rule_id,bu) |
|
|
|
and ItemNo=#{itemNo} |
|
|
|
</select>--> |
|
|
|
|
|
|
|
<!-- 注意:不能用NOLOCK,结果用于判断零件是否存在后进行更新操作,脏读可能导致数据不一致 - rqrq --> |
|
|
|
<select id="checkOtherPart" resultType="SOIssueNotifyOrderMaterialListData"> |
|
|
|
SELECT notify_no, site, ItemNo, BOMItemNo, ComponentPartNo, QtyToIssue, QtyToIssue_Original |
|
|
|
FROM SOIssueNotifyOrderMaterialList WITH (NOLOCK) |
|
|
|
FROM SOIssueNotifyOrderMaterialList |
|
|
|
WHERE site=#{site} AND notify_no=#{notifyNo} AND ComponentPartNo=#{componentPartNo} |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 注意:不能用NOLOCK,结果用于生成新的BOM_item_no插入记录,脏读可能导致主键冲突 - rqrq --> |
|
|
|
<select id="getNextBomItemNo" resultType="String"> |
|
|
|
|
|
|
|
SELECT #{str}+ |
|
|
|
CONVERT(VARCHAR(50),isnull( max(CONVERT(int,SUBSTRING(BOMItemNo, LEN(#{str})+1, LEN(BOMItemNo)))+1),1)) |
|
|
|
|
|
|
|
|
|
|
|
FROM SOIssueNotifyOrderMaterialList WITH (NOLOCK) |
|
|
|
FROM SOIssueNotifyOrderMaterialList |
|
|
|
WHERE site=#{site} AND notify_no=#{notifyNo} AND BOMItemNo LIKE #{str}+'%' |
|
|
|
</select> |
|
|
|
|
|
|
|
|