|
|
@ -34,6 +34,14 @@ |
|
|
<result property="citemCode" column="citem_code"/> |
|
|
<result property="citemCode" column="citem_code"/> |
|
|
<result property="qtyOfPo" column="qty_of_po"/> |
|
|
<result property="qtyOfPo" column="qty_of_po"/> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
<insert id="saveCoreSparePart"> |
|
|
|
|
|
insert into core_spare_part(site,bu_no,part_no,part_desc,serial_number,status,arrival_time,remark,create_time,create_by) |
|
|
|
|
|
values(#{site},#{buNo},#{partNo},#{partDesc},#{serialNumber},#{status},#{arrivalTime},#{remark},GETDATE(),#{createBy}) |
|
|
|
|
|
</insert> |
|
|
|
|
|
<delete id="deleteCoreSparePart"> |
|
|
|
|
|
delete from core_spare_part |
|
|
|
|
|
where site = #{site} and bu_no = #{buNo} and part_no = #{partNo} and serial_number = #{serialNumber} |
|
|
|
|
|
</delete> |
|
|
|
|
|
|
|
|
<select id="queryPage" resultType="com.xujie.sys.modules.pms.entity.InventoryStockVoData"> |
|
|
<select id="queryPage" resultType="com.xujie.sys.modules.pms.entity.InventoryStockVoData"> |
|
|
SELECT |
|
|
SELECT |
|
|
@ -126,6 +134,16 @@ |
|
|
<update id="updateQtyOfPoByIdOfSub"> |
|
|
<update id="updateQtyOfPoByIdOfSub"> |
|
|
update inventory_stock set qty_of_po = isnull(qty_of_po,0) - #{qtyOfPo} where id = #{id} |
|
|
update inventory_stock set qty_of_po = isnull(qty_of_po,0) - #{qtyOfPo} where id = #{id} |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
<update id="updateCoreSparePart"> |
|
|
|
|
|
update core_spare_part |
|
|
|
|
|
set status = #{status}, |
|
|
|
|
|
arrival_time = #{arrivalTime}, |
|
|
|
|
|
remark = #{remark}, |
|
|
|
|
|
update_time = getdate(), |
|
|
|
|
|
update_by = #{updateBy} |
|
|
|
|
|
where site = #{site} and bu_no = #{buNo} and part_no = #{partNo} and serial_number = #{serialNumber} |
|
|
|
|
|
|
|
|
|
|
|
</update> |
|
|
|
|
|
|
|
|
<select id="queryPageByPo" resultType="com.xujie.sys.modules.pms.entity.InventoryStockVoData"> |
|
|
<select id="queryPageByPo" resultType="com.xujie.sys.modules.pms.entity.InventoryStockVoData"> |
|
|
SELECT |
|
|
SELECT |
|
|
@ -296,7 +314,7 @@ |
|
|
created_by, |
|
|
created_by, |
|
|
created_date |
|
|
created_date |
|
|
FROM eam_workOrder_coreComponents |
|
|
FROM eam_workOrder_coreComponents |
|
|
WHERE oldSerialNo IS NOT NULL |
|
|
|
|
|
|
|
|
WHERE oldSerialNo IS NOT NULL and site = #{query.site} AND bu_no = #{query.buNo} AND partNo = #{query.partNo} |
|
|
UNION ALL |
|
|
UNION ALL |
|
|
SELECT |
|
|
SELECT |
|
|
site, |
|
|
site, |
|
|
@ -308,7 +326,7 @@ |
|
|
created_by, |
|
|
created_by, |
|
|
created_date |
|
|
created_date |
|
|
FROM eam_workOrder_coreComponents |
|
|
FROM eam_workOrder_coreComponents |
|
|
WHERE newSerialNo IS NOT NULL |
|
|
|
|
|
|
|
|
WHERE newSerialNo IS NOT NULL and site = #{query.site} AND bu_no = #{query.buNo} AND partNo = #{query.partNo} |
|
|
), |
|
|
), |
|
|
RankedSerials AS ( |
|
|
RankedSerials AS ( |
|
|
SELECT |
|
|
SELECT |
|
|
@ -349,6 +367,7 @@ |
|
|
ewc.OrderNo, |
|
|
ewc.OrderNo, |
|
|
ewc.partno, |
|
|
ewc.partno, |
|
|
ps.part_description, |
|
|
ps.part_description, |
|
|
|
|
|
ps.est_use_qty, |
|
|
ewc.serialNo, |
|
|
ewc.serialNo, |
|
|
ewc.action, |
|
|
ewc.action, |
|
|
ewc.created_by, |
|
|
ewc.created_by, |
|
|
@ -361,18 +380,36 @@ |
|
|
LEFT JOIN eam_workOrder ew ON ewc.site = ew.site AND ewc.bu_no = ew.bu_no AND ewc.OrderNo = ew.OrderNo |
|
|
LEFT JOIN eam_workOrder ew ON ewc.site = ew.site AND ewc.bu_no = ew.bu_no AND ewc.OrderNo = ew.OrderNo |
|
|
LEFT JOIN eam_defect_feedBack edf on ew.site = edf.site and ew.PlanID = edf.feedBackID and ew.bu_no = edf.bu_no |
|
|
LEFT JOIN eam_defect_feedBack edf on ew.site = edf.site and ew.PlanID = edf.feedBackID and ew.bu_no = edf.bu_no |
|
|
WHERE ps.coreFlag = 'Y' |
|
|
WHERE ps.coreFlag = 'Y' |
|
|
<if test="query.site != null and query.site != ''"> |
|
|
|
|
|
and ewc.site = #{query.site} |
|
|
|
|
|
|
|
|
<if test="query.serialNo != null and query.serialNo != ''"> |
|
|
|
|
|
and ewc.serialNo = #{query.serialNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.buNo != null and query.buNo != ''"> |
|
|
|
|
|
and ewc.bu_no = #{query.buNo} |
|
|
|
|
|
|
|
|
ORDER BY partno, serialNo, created_date |
|
|
|
|
|
</select> |
|
|
|
|
|
<select id="getCoreSparePartList" resultType="com.xujie.sys.modules.pms.data.CoreSparePart"> |
|
|
|
|
|
select dbo.get_bu_desc(csp.site,csp.bu_no) as bu, |
|
|
|
|
|
csp.*, |
|
|
|
|
|
ps.location_id |
|
|
|
|
|
from core_spare_part csp |
|
|
|
|
|
left join part_spare ps on csp.site = ps.site and csp.bu_no = ps.bu_no and csp.part_no = ps.part_no |
|
|
|
|
|
<where> |
|
|
|
|
|
<if test="site != null and site != ''"> |
|
|
|
|
|
and csp.site = #{site} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.partNo != null and query.partNo != ''"> |
|
|
|
|
|
and ewc.partNo = #{query.partNo} |
|
|
|
|
|
|
|
|
<if test="buNo != null and buNo != ''"> |
|
|
|
|
|
and csp.bu_no = #{buNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.partDescription != null and query.partDescription != ''"> |
|
|
|
|
|
and ps.part_description like '%'+ #{query.partDescription} +'%' |
|
|
|
|
|
|
|
|
<if test="partNo != null and partNo != ''"> |
|
|
|
|
|
and csp.part_no like '%' + #{partNo} + '%' |
|
|
</if> |
|
|
</if> |
|
|
ORDER BY partno, serialNo, created_date |
|
|
|
|
|
|
|
|
<if test="partDesc != null and partDesc != ''"> |
|
|
|
|
|
and csp.part_desc like '%' + #{partDesc} + '%' |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="serialNumber != null and serialNumber != ''"> |
|
|
|
|
|
and csp.serial_number like '%' + #{serialNumber} + '%' |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="status != null and status != ''"> |
|
|
|
|
|
and csp.status = #{status} |
|
|
|
|
|
</if> |
|
|
|
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
</mapper> |
|
|
</mapper> |