Blame view

ProjectMapper.xml 5.83 KB
涂亚平 committed
1 2 3 4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.ProjectMapper">

涂亚平 committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    <select id="getSeedTrackProjectPage" resultType="com.subsidy.vo.project.SeedTrackProjectPageVO">
        SELECT
        p.course_name,
        c.`name` AS collegeName,
        s.user_name,
        s.position,
        s.title,
        s.education,
        s.major,
        s.telephone,
        p.project_group,
        p.`status`,
        DATE_FORMAT( p.create_date, '%Y-%m-%d' ) AS applicationTime
        FROM
        project p
        LEFT JOIN teacher s ON s.id = p.teacher_id
        LEFT JOIN colleges_dict c ON s.academy_id = c.id
        WHERE
        p.delete_date IS NULL
        AND s.delete_date IS NULL
        AND c.delete_date IS NULL
        <if test="projectGroup != null and projectGroup != '' and projectGroup !='中职/高职'">
            and p.project_group = #{projectGroup}
        </if>
        <if test="courseName != null and courseName != ''">
            AND ( p.course_name like concat('%',#{courseName} ,'%') or p.college like concat('%',#{courseName} ,'%') )
        </if>
        AND p.match_id = #{matchId}
        <if test="projectSchedule != null and projectSchedule != ''">
            and p.project_schedule = #{projectSchedule}
        </if>
    </select>
涂亚平 committed
37

涂亚平 committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
    <select id="matchCollegeVods" resultType="com.subsidy.vo.college.MatchCollegeVodsVO">
        SELECT
            t.id,
            t.course_name,
            t2.user_name,
            t2.position,
            t2.title,
            t2.education,
            t2.major,
            t2.telephone,
            t.vod_url,
            t.upload_date
        FROM
            project t
            LEFT JOIN teacher t2 ON t.teacher_id = t2.id
        WHERE
            t.delete_date IS NULL
            AND t2.delete_date IS NULL
            AND t.match_id = #{matchId}
            AND t.college_id = #{collegeId}
            and t.project_schedule != '校内报名'
    </select>
涂亚平 committed
60

涂亚平 committed
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
    <select id="getList" resultType="com.subsidy.model.MatchDictDO">
        SELECT
        p.*
        FROM project p
        LEFT JOIN student s ON s.id = p.proposer_id
        LEFT JOIN colleges_dict c ON c.`name` = s.college
        <where>
            AND p.project_status != '填写中'
            <if test="projectType != null and projectType != ''">
                AND p.project_type = #{projectType}
            </if>
            <if test="projectGroup != null and projectGroup != ''">
                AND p.project_group = #{projectGroup}
            </if>
            AND p.delete_time IS NULL
            AND s.delete_time IS NULL
            AND c.delete_time IS NULL
        </where>
        GROUP BY
        c.id
    </select>

    <select id="getSeedTrackProjectList" resultType="com.subsidy.model.ProjectDO">
        select
        p.*
        from project p
        left join teacher s on s.id = p.teacher_id
        <where>
            <if test="matchId != null and matchId !=''">
                and p.match_id = #{matchId}
            </if>
            <if test="projectGroup != null and projectGroup != ''">
                and p.project_group = #{projectGroup}
            </if>
            <if test="collegeId != null and collegeId != ''">
                and p.college_id = #{collegeId}
            </if>
            <if test="projectProgress!= null and projectProgress != ''">
                and p.project_progress = #{projectProgress}
            </if>
            and p.project_status != '填写中'
            and p.delete_date is null
            and s.delete_date is null
        </where>
    </select>

    <select id="recentVod" resultType="com.subsidy.vo.project.RecentVodVO">
        SELECT
            t.*
        FROM
            project t
        WHERE
            t.delete_date IS NULL
            AND t.college_id = #{collegeId}
            AND t.match_id = #{matchId}
            and t.project_schedule !='校内报名'
        ORDER BY
            t.upload_date DESC
    </select>

    <select id="getSeedTrackProjectPage1" resultType="com.subsidy.vo.project.SeedTrackProjectPageVO">
        select
        p.*,
        cd.name college,
        s.user_name,
        s.major,
        s.telephone,
        s.position,
        s.title,
        s.education,
        p.course_name,
        DATE_FORMAT(p.create_date, '%Y-%m-%d') as applicationTime
        from project p
        left join teacher s ON s.id = p.teacher_id
        left join colleges_dict cd on p.college_id = cd.id
        <where>
            and p.match_id = #{matchId}
            and p.project_status != '填写中'
            <if test="collegeId  != null and collegeId != ''">
                and cd.id = #{collegeId}
            </if>
            <if test="projectGroup != null and projectGroup != ''">
                and p.project_group = #{projectGroup}
            </if>
            <if test="projectSchedule != null and projectSchedule != ''">
                and p.project_schedule = #{projectSchedule}
            </if>
            <if test="projectStatus != null and projectStatus != ''">
                <if test="projectStatus == '已评审'">
                    and p.project_status != '待评审'
                </if>
                <if test="projectStatus != '已评审'">
                    and p.project_status = #{projectStatus}
                </if>
            </if>
            <if test="projectProgress != null and projectProgress != ''">
                and p.project_progress = #{projectProgress}
            </if>
            <if test="name != null and name != ''">
                and (p.course_name like concat('%',#{name},'%') or s.user_name like concat('%',#{name},'%') or cd.name like concat('%',#{name},'%'))
            </if>
            and p.delete_date is null
            and s.delete_date is null
        </where>
    </select>
涂亚平 committed
166
</mapper>