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.
|
|
|
|
queryUsersTeams
|
|
|
|
|
===
|
|
|
|
|
* 根据团队id查询队员
|
|
|
|
|
SELECT
|
|
|
|
|
`users`.*
|
|
|
|
|
FROM
|
|
|
|
|
`users`
|
|
|
|
|
INNER JOIN `user_teams` ON `users`.`id` = `user_teams`.`user_id`
|
|
|
|
|
WHERE
|
|
|
|
|
`user_teams`.`team_id` IN ( #id# )
|
|
|
|
|
|
|
|
|
|
getUserTeamsIds
|
|
|
|
|
===
|
|
|
|
|
* 获取队友是否在其他团队里面,有就返回用户的id数组
|
|
|
|
|
SELECT DISTINCT
|
|
|
|
|
ut.user_id
|
|
|
|
|
FROM
|
|
|
|
|
examinations e
|
|
|
|
|
LEFT JOIN teams t ON t.examination_id = e.id
|
|
|
|
|
LEFT JOIN user_teams ut ON t.id = ut.team_id
|
|
|
|
|
WHERE ut.user_id is not null
|
|
|
|
|
AND t.end_time > now()
|
|
|
|
|
|
|
|
|
|
userTeamsByQuery
|
|
|
|
|
===
|
|
|
|
|
*
|
|
|
|
|
SELECT
|
|
|
|
|
*
|
|
|
|
|
FROM
|
|
|
|
|
user_teams
|
|
|
|
|
WHERE
|
|
|
|
|
team_id = #teamId#
|
|
|
|
|
AND user_id = #userId#
|
|
|
|
|
ORDER BY
|
|
|
|
|
id DESC
|
|
|
|
|
LIMIT 0,1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
queryByCondition
|
|
|
|
|
===
|
|
|
|
|
* 根据不为空的参数进行分页查询
|
|
|
|
|
|
|
|
|
|
select
|
|
|
|
|
@pageTag(){
|
|
|
|
|
t.*
|
|
|
|
|
@}
|
|
|
|
|
from user_teams t
|
|
|
|
|
where 1=1
|
|
|
|
|
@//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行
|
|
|
|
|
and #function("userTeams.query")#
|
|
|
|
|
@if(!isEmpty(id)){
|
|
|
|
|
and t.id =#id#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(userId)){
|
|
|
|
|
and t.user_id =#userId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teamId)){
|
|
|
|
|
and t.team_id =#teamId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(roles)){
|
|
|
|
|
and t.roles =#roles#
|
|
|
|
|
@}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deleteUserTeamsByIds
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
* 批量删除
|
|
|
|
|
|
|
|
|
|
delete from user_teams where find_in_set(id,#ids#)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getUserTeamsValues
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
* 根据不为空的参数进行查询
|
|
|
|
|
|
|
|
|
|
select t.*
|
|
|
|
|
from user_teams t
|
|
|
|
|
where 1=1
|
|
|
|
|
@if(!isEmpty(id)){
|
|
|
|
|
and t.id =#id#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(userId)){
|
|
|
|
|
and t.user_id =#userId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teamId)){
|
|
|
|
|
and t.team_id =#teamId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(roles)){
|
|
|
|
|
and t.roles =#roles#
|
|
|
|
|
@}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getValuesByQuery
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
* 根据不为空的参数进行查询
|
|
|
|
|
|
|
|
|
|
select t.*
|
|
|
|
|
from user_teams t
|
|
|
|
|
where 1=1
|
|
|
|
|
@if(!isEmpty(id)){
|
|
|
|
|
and t.id =#id#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(userId)){
|
|
|
|
|
and t.user_id =#userId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(teamId)){
|
|
|
|
|
and t.team_id =#teamId#
|
|
|
|
|
@}
|
|
|
|
|
@if(!isEmpty(roles)){
|
|
|
|
|
and t.roles =#roles#
|
|
|
|
|
@}
|