drop VIEW if exists `view_czy`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_czy` AS
select
`czy`.`czycode` AS `代码`,
if((`czy`.`leve` = 1),
'操作员',
if((`czy`.`leve`=2),
'出纳员',
if((`czy`.`leve`=9),
'管理员','其它'))) AS `级别`
from
`czy`
order by
`czy`.`czycode`;
INSERT INTO `czy` (`czycode`, `leve`) VALUES ('3333',1);