You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
|
|
|
|
queryByCondition
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
select
|
|
|
|
|
@pageTag(){
|
|
|
|
|
t.*,o.name org_name,(SELECT GROUP_CONCAT(ROLE_ID) FROM core_user_role WHERE user_id = t.id) ROLE_IDS
|
|
|
|
|
@}
|
|
|
|
|
from core_user t left join core_org o on t.org_id=o.id where t.ID != 1 and t.del_flag = 0
|
|
|
|
|
@//数据权限,该sql语句功能点
|
|
|
|
|
and #function("user.query")#
|
|
|
|
|
@if(!isEmpty(orgId)){
|
|
|
|
|
and t.org_id =#orgId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(orgId)){
|
|
|
|
|
and t.org_id =#orgId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(code)){
|
|
|
|
|
and t.code like #"%"+code+"%"#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(name)){
|
|
|
|
|
and t.name like #"%"+name+"%"#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(state)){
|
|
|
|
|
and t.state = #state#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(jobType0)){
|
|
|
|
|
and t.job_type0= #jobType0#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(jobType1)){
|
|
|
|
|
and t.job_type1= #jobType1#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(createDateMin)){
|
|
|
|
|
and t.create_time>= #createDateMin#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(createDateMax)){
|
|
|
|
|
and t.create_time< #nextDay(createDateMax)#
|
|
|
|
|
@}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
batchDelUserByIds
|
|
|
|
|
===
|
|
|
|
|
update core_user set del_flag = 1 where id in( #join(ids)#)
|
|
|
|
|
|
|
|
|
|
batchUpdateUserState
|
|
|
|
|
===
|
|
|
|
|
update core_user set state = #state# where id in( #join(ids)#)
|
|
|
|
|
|
|
|
|
|
queryUserRole
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
* 查询用户所有权限
|
|
|
|
|
|
|
|
|
|
select
|
|
|
|
|
ur.*, u.code as user_code,
|
|
|
|
|
u.name as user_name,
|
|
|
|
|
org.name as org_name, role.name as role_name
|
|
|
|
|
from core_user_role ur
|
|
|
|
|
left join core_org org on org.id = ur.org_id
|
|
|
|
|
left join core_user u on u.id = ur.user_id
|
|
|
|
|
left join core_role role on role.id = ur.role_id
|
|
|
|
|
where u.id=#id#
|
|
|
|
|
@if(isNotEmpty(orgId)){
|
|
|
|
|
and org.id=#orgId#
|
|
|
|
|
@}
|
|
|
|
|
@if(isNotEmpty(roleId)){
|
|
|
|
|
and role.id=#roleId#
|
|
|
|
|
@}
|