Files
shanxia2.0/docs/sql/migrations/2026-07-01_pl_settlement_status_rejected.sql
T
2026-07-04 08:21:49 +08:00

16 lines
733 B
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.
-- 运费结算:新增「已驳回」状态字典(审批驳回后 settlement_status = rejected)
INSERT INTO `sys_dict_data` (
`id`, `dict_label`, `dict_value`, `tag_type`, `dict_type`, `tenant_no`, `order_num`,
`remark`, `create_by`, `create_dept_id`, `create_time`, `update_by`, `update_time`, `del_flag`
)
SELECT
'PL_SETTLE_REJECTED', '已驳回', 'rejected', 'danger', 'pl_settlement_status', t.tenant_no, 2,
NULL, 'system', '', NOW(), NULL, NOW(), 0
FROM (
SELECT DISTINCT `tenant_no` FROM `sys_dict_type` WHERE `dict_type` = 'pl_settlement_status' AND `del_flag` = 0
) t
WHERE NOT EXISTS (
SELECT 1 FROM `sys_dict_data` d
WHERE d.id = 'PL_SETTLE_REJECTED' AND d.tenant_no = t.tenant_no AND d.del_flag = 0
);