|
|
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `view_sys_dept` AS select `dis`.`NAME` AS `district`,`dis`.`ID` AS `districtId`,`str`.`NAME` AS `street`,`str`.`ID` AS `streetId`,`com`.`NAME` AS `community`,`com`.`ID` AS `communityId`,`gri`.`NAME` AS `grid`,`gri`.`ID` AS `gridId`,concat(`dis`.`NAME`,'-',`str`.`NAME`,'-',`com`.`NAME`,'-',`gri`.`NAME`) AS `allDeptNames`,concat(`dis`.`ID`,',',`str`.`ID`,',',`com`.`ID`,',',`gri`.`ID`) AS `allDeptIds` from (((`meta_sys_dept` `gri` left join `meta_sys_dept` `com` on((`gri`.`PID` = `com`.`ID`))) left join `meta_sys_dept` `str` on((`com`.`PID` = `str`.`ID`))) left join `meta_sys_dept` `dis` on((`str`.`PID` = `dis`.`ID`))) where ((`gri`.`DEL_FLAG` = '0') and (`dis`.`ID` is not null)); |
|
|
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `view_sys_dept` AS select `dis`.`NAME` AS `district`,`dis`.`ID` AS `districtId`,`str`.`NAME` AS `street`,`str`.`ID` AS `streetId`,`com`.`NAME` AS `community`,`com`.`ID` AS `communityId`,`gri`.`NAME` AS `grid`,`gri`.`ID` AS `gridId`,concat(`dis`.`NAME`,'-',`str`.`NAME`,'-',`com`.`NAME`,'-',`gri`.`NAME`) AS `allDeptNames`,concat(`dis`.`ID`,',',`str`.`ID`,',',`com`.`ID`,',',`gri`.`ID`) AS `allDeptIds` from (((`meta_sys_dept` `gri` left join `meta_sys_dept` `com` on((`gri`.`PID` = `com`.`ID`))) left join `meta_sys_dept` `str` on((`com`.`PID` = `str`.`ID`))) left join `meta_sys_dept` `dis` on((`str`.`PID` = `dis`.`ID`))) where ((`gri`.`DEL_FLAG` = '0') and (`dis`.`ID` is not null)); |