from gk_cmpt a left join common.neucmpt b on a.cmpt_id=b.gtCmptId
from gk_cmpt a
left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neuuser nu on nu.neuUserId =b.committeeNeuUserId
left join common.neuuser nu on nu.neuUserId =b.committeeNeuUserId
left join raceenroll.competition c on b.gcmptid=c.cmptid
left join raceenroll.competition c on b.gcmptid=c.cmptid
LEFT JOIN geerunner.sys_admin sa ON sa.registerId =nu.gtUserId
where a.del_flag=0
where a.del_flag=0
<includerefid="committee-cmpt-where-sql"/>
<includerefid="committee-cmpt-where-sql"/>
</select>
</select>
...
@@ -240,9 +242,10 @@
...
@@ -240,9 +242,10 @@
c.area as area,
c.area as area,
c.location as location
c.location as location
from gk_cmpt a
from gk_cmpt a
left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neucmpt b on a.cmpt_id = b.gtCmptId
left join common.neuuser nu on nu.neuUserId =b.committeeNeuUserId
left join common.neuuser nu on nu.neuUserId = b.committeeNeuUserId
left join raceenroll.competition c on b.gcmptid=c.cmptid
left join raceenroll.competition c on b.gcmptid =c.cmptid
LEFT JOIN geerunner.sys_admin sa ON sa.registerId =nu.gtUserId
where a.del_flag=0
where a.del_flag=0
<includerefid="committee-cmpt-where-sql"/>
<includerefid="committee-cmpt-where-sql"/>
order by c.startTime desc
order by c.startTime desc
...
@@ -259,7 +262,7 @@
...
@@ -259,7 +262,7 @@
and now() >= c.startTime and c.endTime >= now()
and now() >= c.startTime and c.endTime >= now()
</if>
</if>
<iftest="param.userId > 0">
<iftest="param.userId > 0">
and c.createUserId=#{param.userId} OR (nu.gUserId = #{param.userId} AND nu.gUserId != c.createUserId)
and c.createUserId=#{param.userId} OR (nu.gUserId = #{param.userId} AND nu.gUserId != c.createUserId AND sa.org_id = (SELECT org_id FROM geerunner.sys_admin WHERE registerId=#{param.userId} ))
</if>
</if>
<iftest="param.userId lt 0">
<iftest="param.userId lt 0">
AND c.createUserId NOT IN (SELECT user_id from gksite.gk_app_info WHERE user_id>0)
AND c.createUserId NOT IN (SELECT user_id from gksite.gk_app_info WHERE user_id>0)