select
distinct tbsysmodul0_.ID as col_0_0_,
tbsysmodul0_.NAME as col_1_0_,
tbsysmodul0_.URL as col_2_0_,
tbsysmodul0_.CODE as col_3_0_,
tbsysmodul0_.ISLEAF as col_4_0_,
tbsysmodul0_.SORT as col_5_0_
from
TB_SYS_MODULE tbsysmodul0_,
TB_SYS_ROLE_MODULE tbsysrolem1_,
TB_SYS_USER_ROLE tbsysuserr2_
where
tbsysmodul0_.ID=tbsysrolem1_.MODULEID
and tbsysrolem1_.ROLEID=tbsysuserr2_.ROLEID
and tbsysuserr2_.USERID='402894cf41b630e40141b63128590001'
and (
tbsysmodul0_.PID is null
)
order by
sort asc
注意:1、distinct是对关键字后所有列组合 筛选重复;
2、order by 语句,是对于筛选后的结果进行排序,因此排序字段必须在select的列中;