-- H5 商户工作台轮播图：按钮权限（可重复执行）

INSERT INTO `SYSTEM_PERMISSION` (`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`)
SELECT 'business:ywh5banner:create', '新建H5轮播图', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0
WHERE NOT EXISTS (SELECT 1 FROM `SYSTEM_PERMISSION` p WHERE p.`CODE` = 'business:ywh5banner:create' AND p.`DELETED` = 0);

INSERT INTO `SYSTEM_PERMISSION` (`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`)
SELECT 'business:ywh5banner:delete', '删除H5轮播图', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0
WHERE NOT EXISTS (SELECT 1 FROM `SYSTEM_PERMISSION` p WHERE p.`CODE` = 'business:ywh5banner:delete' AND p.`DELETED` = 0);

INSERT INTO `SYSTEM_PERMISSION` (`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`)
SELECT 'business:ywh5banner:update', '修改H5轮播图', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0
WHERE NOT EXISTS (SELECT 1 FROM `SYSTEM_PERMISSION` p WHERE p.`CODE` = 'business:ywh5banner:update' AND p.`DELETED` = 0);

INSERT INTO `SYSTEM_PERMISSION` (`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`)
SELECT 'business:ywh5banner:query', '查询H5轮播图', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0
WHERE NOT EXISTS (SELECT 1 FROM `SYSTEM_PERMISSION` p WHERE p.`CODE` = 'business:ywh5banner:query' AND p.`DELETED` = 0);
