| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?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.xjrsoft.module.internship.mapper.InternshipPlanManageMapper">
- <select id="getPage" parameterType="com.xjrsoft.module.internship.dto.InternshipPlanManagePageDto" resultType="com.xjrsoft.module.internship.vo.InternshipPlanManagePageVo">
- SELECT t1.id,t1.base_semester,t1.internship_plan_name,t1.status,t1.start_time,t1.end_time,t2.name AS insurance_purchaser_cn,
- t3.name AS internship_plan_type_cn,t4.name AS internship_whereabouts_cn,t5.name AS insurance_type_cn,t1.internship_unit_name,
- t6.name AS enterprise_industry_cn,t7.name AS lodging_plan_cn,t8.name AS internship_site_type_cn,t9.name AS internship_unit_source_cn,
- t10.name AS professional_relevance_enterprise_cn,IFNULL(t11.training_name,t12.training_name) AS training_base_name,t1.internship_job_name FROM internship_plan_manage t1
- LEFT JOIN xjr_dictionary_detail t2 ON t1.insurance_purchaser = t2.code AND t2.item_id = 1826514469123567618
- LEFT JOIN xjr_dictionary_detail t3 ON t1.internship_plan_type = t3.code AND t3.item_id = 1826151188882042882
- LEFT JOIN xjr_dictionary_detail t4 ON t1.internship_whereabouts = t4.code AND t4.item_id = 1826520014937174017
- LEFT JOIN xjr_dictionary_detail t5 ON t1.insurance_type = t5.code AND t5.item_id = 1826517478180171778
- LEFT JOIN xjr_dictionary_detail t6 ON t1.enterprise_industry = t6.code AND t6.item_id = 1826458251034144769
- LEFT JOIN xjr_dictionary_detail t7 ON t1.lodging_plan = t7.code AND t7.item_id = 1826523742578716673
- LEFT JOIN xjr_dictionary_detail t8 ON t1.internship_site_type = t8.code AND t8.item_id = 1826522165537189889
- LEFT JOIN xjr_dictionary_detail t9 ON t1.internship_unit_source = t9.code AND t9.item_id = 1826522877876809730
- LEFT JOIN xjr_dictionary_detail t10 ON t1.insurance_type = t10.code AND t10.item_id = 1826513919233536002
- LEFT JOIN training_school t11 ON t1.training_base_id = t11.id
- LEFT JOIN training_outside t12 ON t1.training_base_id = t12.id
- WHERE t1.delete_mark = 0
- <if test="dto.internshipPlanName != null and dto.internshipPlanName != ''">
- and t1.internship_plan_name like concat('%', #{dto.internshipPlanName}, '%')
- </if>
- <if test="dto.internshipPlanType != null and dto.internshipPlanType != ''">
- and t1.internship_plan_type = #{dto.internshipPlanType}
- </if>
- <if test="dto.internshipUnitSource != null and dto.internshipUnitSource != ''">
- and t1.internship_unit_source = #{dto.internshipUnitSource}
- </if>
- <if test="dto.internshipSiteType != null and dto.internshipSiteType != ''">
- and t1.internship_site_type = #{dto.internshipSiteType}
- </if>
- <if test="dto.internshipUnitName != null and dto.internshipUnitName != ''">
- and t1.internship_unit_name like concat('%', #{dto.internshipUnitName}, '%')
- </if>
- <if test="dto.startTimeStart != null and dto.startTimeEnd != null">
- and t1.start_time between #{dto.startTimeStart} and #{dto.startTimeEnd}
- </if>
- <if test="dto.endTimeStart != null and dto.endTimeEnd != null">
- and t1.start_time between #{dto.endTimeStart} and #{dto.endTimeEnd}
- </if>
- <if test="dto.internshipWhereabouts != null and dto.internshipWhereabouts != ''">
- and t1.internship_whereabouts like concat('%', #{dto.internshipWhereabouts}, '%')
- </if>
- <if test="dto.baseSemesterId != null">
- and t1.base_semester_id = #{dto.baseSemesterId}
- </if>
- <if test="dto.teacherId != null">
- and (t1.id in (
- SELECT DISTINCT c1.internship_plan_manage_id FROM internship_plan_class c1
- INNER JOIN base_class c2 ON c1.class_id = c2.id
- WHERE c1.delete_mark = 0 AND c2.delete_mark = 0
- AND c2.teacher_id = #{dto.teacherId}
- ) or t1.id in (
- SELECT DISTINCT internship_plan_manage_id FROM internship_plan_teacher
- WHERE delete_mark = 0 AND user_id = #{dto.teacherId}
- ))
- </if>
- <if test="dto.studentUserId != null">
- and t1.id in (
- SELECT DISTINCT internship_plan_manage_id FROM internship_plan_manage_participant
- WHERE delete_mark = 0 AND participant_user_id = #{dto.studentUserId}
- )
- </if>
- order by t1.create_date desc
- </select>
- </mapper>
|