/****** Object:  StoredProcedure [dbo].[sp_web_map_op_eqp_create]    Script Date: 2026/7/23 下午 05:35:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*
	OODA_REMARK: map op eqp
	OODA_RESULT: SCALAR
*/
ALTER PROCEDURE [dbo].[sp_web_map_op_eqp_create] 
	@opid		INT,
	@eqpid		INT
AS
	DECLARE @state		INT

	SELECT @state = COUNT(*) FROM dbo.map_op_eqp WHERE opid = @opid AND eqpid = @eqpid

	IF(@state > 0)
	BEGIN
		SET @state = -1
	END
	ELSE 
	BEGIN
		INSERT INTO dbo.map_op_eqp
			(opid, eqpid)
		VALUES
			(@opid, @eqpid)

		SET @state = 1
	END

	SELECT @state AS RESULT
		
