and t.application_info_original =#applicationInfoOriginal#
@}
queryMyApplicationByConditionQuery
===
* 根据当前登录人身份查询应用列表(可渲染排序)
SELECT
@pageTag(){
zz.*
@}
FROM
(
SELECT DISTINCT
t.*,
@// 查询教师和应用关联的排序值
@if(!isEmpty(teacherId)){
( SELECT teacher_merge_application_order_index FROM teacher_merge_application WHERE resources_application_id = t.resources_application_id ) AS order_index
@}
@// 查询学生和应用关联的排序值
@if(!isEmpty(studentId)){
( SELECT student_merge_application_order_index FROM student_merge_application WHERE resources_application_id = t.resources_application_id ) AS order_index
@}
FROM
resources_application t
LEFT JOIN universities_colleges_jurisdiction_experimental_system tb ON tb.type_id = t.resources_application_id
WHERE
1 = 1
@if(!isEmpty(resourcesApplicationId)){
and t.resources_application_id =#resourcesApplicationId#
@}
@if(!isEmpty(applicationName)){
and t.application_name =#applicationName#
@}
@if(!isEmpty(applicationLink)){
and t.application_link =#applicationLink#
@}
@if(!isEmpty(linkSecretKey)){
and t.link_secret_key =#linkSecretKey#
@}
@if(!isEmpty(applicationOneLevelRelation)){
and t.application_one_level_relation =#applicationOneLevelRelation#
@}
@if(!isEmpty(applicationSecondLevelRelation)){
and t.application_second_level_relation =#applicationSecondLevelRelation#
@}
@if(!isEmpty(applicationCarousel)){
and t.application_carousel =#applicationCarousel#
@}
@if(!isEmpty(applicationExperimentProgram)){
and t.application_experiment_program =#applicationExperimentProgram#
@}
@if(!isEmpty(applicationExperimentalCourse)){
and t.application_experimental_course =#applicationExperimentalCourse#
@}
@if(!isEmpty(applicationUserManual)){
and t.application_user_manual =#applicationUserManual#
@}
@if(!isEmpty(applicationInstallationPackage)){
and t.application_installation_package =#applicationInstallationPackage#
@}
@if(!isEmpty(applicationIntroduction)){
and t.application_introduction =#applicationIntroduction#
@}
@if(!isEmpty(applicationInfo)){
and t.application_info =#applicationInfo#
@}
@if(!isEmpty(orgId)){
and t.org_id =#orgId#
@}
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(applicationIntroductionOriginal)){
and t.application_introduction_original =#applicationIntroductionOriginal#
@}
@if(!isEmpty(applicationInfoOriginal)){
and t.application_info_original =#applicationInfoOriginal#
@}
@// 查找老师所在的院校
@if(!isEmpty(teacherId)){
and tb.universities_colleges_id =
(select universities_colleges_id from teacher where teacher_id = #teacherId# and teacher_status = 1 limit 1)
@}
@// 查找学生所在的院校
@if(!isEmpty(studentId)){
and tb.universities_colleges_id =
(SELECT
rb.universities_colleges_id
FROM
student ra
LEFT JOIN school_class rb ON rb.class_id = ra.class_id
WHERE
ra.student_status = 1 and ra.student_id = #studentId#
LIMIT 1)
@}
AND tb.`type` = 1
AND tb.use_end_time > now()
) zz
ORDER BY
CASE zz.order_index WHEN NULL THEN 0 ELSE zz.order_index END DESC