|
@@ -30,7 +30,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<result property="remark" column="remark"/>
|
|
<result property="remark" column="remark"/>
|
|
<result property="status" column="status"/>
|
|
<result property="status" column="status"/>
|
|
<result property="subjectName" column="subject_name"/>
|
|
<result property="subjectName" column="subject_name"/>
|
|
- <association property="courseProjectTypes" javaType="java.util.List" resultMap="CourseProjectTypeVoTwoResult" />
|
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zhongzheng.modules.course.vo.CourseProjectTypeVo" id="CourseProjectTypeVoTwoResult">
|
|
<resultMap type="com.zhongzheng.modules.course.vo.CourseProjectTypeVo" id="CourseProjectTypeVoTwoResult">
|
|
@@ -65,20 +64,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="queryList" parameterType="com.zhongzheng.modules.course.bo.CourseSubjectQueryBo" resultMap="CourseSubjectVoResult">
|
|
<select id="queryList" parameterType="com.zhongzheng.modules.course.bo.CourseSubjectQueryBo" resultMap="CourseSubjectVoResult">
|
|
SELECT
|
|
SELECT
|
|
- s.*,
|
|
|
|
- p.id as pid,
|
|
|
|
- p.project_name as pproject_name,
|
|
|
|
- p.encoder as pencoder,
|
|
|
|
- p.remark as premark,
|
|
|
|
- p.education_id as peducation_id,
|
|
|
|
- p.status as pstatus,
|
|
|
|
- e.education_name as peducation_name
|
|
|
|
|
|
+ s.*
|
|
FROM
|
|
FROM
|
|
course_subject s
|
|
course_subject s
|
|
- LEFT JOIN course_subject_project c ON s.id = c.subject_id
|
|
|
|
- LEFT JOIN course_project_type p ON c.project_id = p.id
|
|
|
|
- LEFT JOIN course_education_type e ON p.education_id = e.id
|
|
|
|
- LEFT JOIN course_business b on b.project_id =p.id
|
|
|
|
WHERE
|
|
WHERE
|
|
1 =1
|
|
1 =1
|
|
<if test="status != null and status.size()!=0 ">
|
|
<if test="status != null and status.size()!=0 ">
|
|
@@ -88,19 +76,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
<if test="educationId != null and educationId!=0 ">
|
|
<if test="educationId != null and educationId!=0 ">
|
|
- AND e.id = #{educationId}
|
|
|
|
|
|
+ and (SELECT COUNT(p.id) FROM course_subject_project t LEFT JOIN course_project_type p on t.project_id = p.id where p.education_id = #{educationId} ) > 0
|
|
</if>
|
|
</if>
|
|
<if test="projectId != null and projectId!=0 ">
|
|
<if test="projectId != null and projectId!=0 ">
|
|
- AND p.id = #{projectId}
|
|
|
|
|
|
+ and (SELECT COUNT(t.id) FROM course_subject_project t where t.project_id = #{projectId}) > 0
|
|
</if>
|
|
</if>
|
|
<if test="subjectName != null and subjectName!=0 ">
|
|
<if test="subjectName != null and subjectName!=0 ">
|
|
AND s.subject_name = #{subjectName}
|
|
AND s.subject_name = #{subjectName}
|
|
</if>
|
|
</if>
|
|
- <if test="businessId != null and businessId!=0 ">
|
|
|
|
- AND b.id = #{businessId}
|
|
|
|
- </if>
|
|
|
|
<if test="wrong != null and wrong!=0 ">
|
|
<if test="wrong != null and wrong!=0 ">
|
|
and (select COUNT(v.id) FROM course_subject_project v where s.id=v.subject_id) = 0
|
|
and (select COUNT(v.id) FROM course_subject_project v where s.id=v.subject_id) = 0
|
|
</if>
|
|
</if>
|
|
|
|
+ order by s.update_time desc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="queryProject" parameterType="map" resultMap="CourseProjectTypeVoResult">
|
|
|
|
+ SELECT
|
|
|
|
+ p.*,
|
|
|
|
+ (SELECT e.education_name FROM course_education_type e where p.education_id = e.id) as education_name,
|
|
|
|
+ (SELECT e.id FROM course_education_type e where p.education_id = e.id) as education_id
|
|
|
|
+ FROM
|
|
|
|
+ course_project_type p
|
|
|
|
+ LEFT JOIN course_subject_project j ON p.id = j.project_id
|
|
|
|
+ WHERE
|
|
|
|
+ j.subject_id=#{id}
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|