IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id = OBJECT_ID(N'dbo.asr_bas_wrk_status') AND name = N'wrk_sts')
BEGIN
    PRINT 'asr_bas_wrk_status not found, skip 7.12 status initialization';
END
ELSE
BEGIN
    IF NOT EXISTS (SELECT 1 FROM asr_bas_wrk_status WHERE wrk_sts = 21)
    BEGIN
        INSERT INTO asr_bas_wrk_status (wrk_sts, wrk_desc, modi_time, appe_time)
        VALUES (21, N'给ERP开始任务下发成功', GETDATE(), GETDATE());
    END

    IF NOT EXISTS (SELECT 1 FROM asr_bas_wrk_status WHERE wrk_sts = 22)
    BEGIN
        INSERT INTO asr_bas_wrk_status (wrk_sts, wrk_desc, modi_time, appe_time)
        VALUES (22, N'给ERP开始任务下发失败', GETDATE(), GETDATE());
    END
END
