Files
old_jintiantongye_wms/db/数据库更新20171014.sql
2025-09-12 17:30:18 +08:00

59 lines
2.1 KiB
Transact-SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

update sys_SQL_statements set SQL_string=SQL_string + ',nckw,wckw'
where id='可入空托盘库位的提取语句(自动)' and SQL_string not like '%,nckw,wckw';
update sys_SQL_statements set SQL_string='最近托盘放入时间,ceng,hdh'
where id='空盘出库库位排序'
update wxzd_sbztxx set sbcs1='01', sbcs2='02' where sbcs1='03' and sbcs2='06' and sbid like '[GT]%[12]'
update wxzd_sbztxx set sbcs1='03', sbcs2='06' where sbcs1='01' and sbcs2='02' and sbid like '[GT]%[34]'
--select * from wxzd_sbztxx
go
ALTER VIEW [dbo].[v_kctp]
-- WITH ENCRYPTION
AS
/**
*
* 提取可出空托盘库位的视图
* Created by 蒋智湘 ON 2005-12-06
* Used by 空托盘出库指令生成模块
* Modified by jzx on 2015-8-31 增加qysx, zsl, wckw, emptyPalletDist, hdh字段输出
*/
SELECT ckmc AS ckdm, kwbh, tpbh, convert(int, zsl) AS sl, pai, lie, ceng
, qysx, zsl, wckw, emptyPalletDist, hdh,最近托盘放入时间
FROM kwjbxx
WHERE sfwzzl = 'T' AND zsl > 0 AND sfsd = 0
go
ALTER TRIGGER [dbo].[t_wxzd_sbztxx_U] ON [dbo].[wxzd_sbztxx]
FOR UPDATE
AS
/**
* 堆垛机设备出现故障或者恢复时,对相应操作库位上锁或解锁
* Created by jzx 2012-4-7 12.50
* Modified by jzx on 2014-12-5 给库位上锁的条件中将sfsd=0改成sfsd>=0即自动上锁的库位也要强制设定-2锁
* Modified by jzx on 2017-9-28 堆垛机识别ID可以是中文
* Modified by jzx on 2017-10-15 debug: @v_cs1 和 @v_cs2 变量值可能不是整数而是带有A~Z字母的任何文字所以之前将其转换成int会报错
* 解锁时,需要检查是否有未完成指令操作目标库位,如果有,则恢复指令锁
*/
IF UPDATE(sbzt)
BEGIN
DECLARE @v_sbzt TINYINT, @v_sbid VARCHAR(50), @v_cs1 varchar(20), @v_cs2 varchar(20)
SELECT @v_sbzt = sbzt, @v_sbid = sbid, @v_cs1 = sbcs1, @v_cs2 = sbcs2 FROM inserted
IF (@v_sbid LIKE 'DDJ.%' OR @v_sbid LIKE '%堆垛机' OR @v_sbid LIKE '[1-9][#号]机')
BEGIN
IF @v_sbzt = 0
UPDATE kwjbxx SET sfsd=-2 WHERE sfsd>=0 AND xnkw=0 AND pai BETWEEN @v_cs1 AND @v_cs2;
ELSE IF @v_sbzt = 2
BEGIN
UPDATE kwjbxx SET sfsd=ISNULL(a.zlbh, 0)
FROM kwjbxx r LEFT JOIN v_未完成指令 a ON r.kwbh=a.kwbh
WHERE sfsd=-2 AND pai BETWEEN @v_cs1 AND @v_cs2
END;
END
END
go