CourseSectionBusinessMapper.xml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhongzheng.modules.course.mapper.CourseSectionBusinessMapper">
  6. <resultMap type="com.zhongzheng.modules.course.domain.CourseSectionBusiness" id="CourseSectionBusinessResult">
  7. <result property="id" column="id"/>
  8. <result property="sectionId" column="section_id"/>
  9. <result property="educationTypeId" column="education_type_id"/>
  10. <result property="businessId" column="business_id"/>
  11. <result property="subjectId" column="subject_id"/>
  12. <result property="projectId" column="project_id"/>
  13. <result property="educationName" column="education_name"/>
  14. <result property="projectName" column="project_name"/>
  15. <result property="businessName" column="business_name"/>
  16. <result property="subjectName" column="subject_name"/>
  17. </resultMap>
  18. <select id="getListById" parameterType="Long" resultMap="CourseSectionBusinessResult">
  19. SELECT
  20. csb.*,
  21. cet.education_name,
  22. cpt.project_name,
  23. cb.business_name,
  24. cs.subject_name
  25. FROM
  26. course_section_business csb
  27. LEFT JOIN course_education_type cet ON csb.education_type_id = cet.id
  28. AND cet.`status` = 1
  29. LEFT JOIN course_project_type cpt ON csb.project_id = cpt.id
  30. AND cpt.`status` = 1
  31. LEFT JOIN course_business cb ON csb.business_id = cb.id
  32. AND cb.`status` = 1
  33. LEFT JOIN course_subject cs ON csb.subject_id = cs.id
  34. AND cs.`status` = 1
  35. WHERE
  36. csb.section_id =#{id}
  37. </select>
  38. <delete id="deleteByIdAndTenant" parameterType="map" >
  39. delete from course_section_business where section_id = #{sectionId} and tenant_id = #{newTenantId}
  40. </delete>
  41. </mapper>