|
@@ -146,7 +146,7 @@
|
|
</resultMap>
|
|
</resultMap>
|
|
<sql id="ActivityTeacherPageInfo_Column_List">
|
|
<sql id="ActivityTeacherPageInfo_Column_List">
|
|
t1.id_ AS teacher_id, t1.real_name_, t1.username_, t1.phone_, t2.subject_id_
|
|
t1.id_ AS teacher_id, t1.real_name_, t1.username_, t1.phone_, t2.subject_id_
|
|
- <if test="record.activityId != null">, t3.id_</if>
|
|
|
|
|
|
+ <if test="record.activityId != null and record.addType == 0">, t3.id_</if>
|
|
</sql>
|
|
</sql>
|
|
<sql id="ActivityTeacherPageInfo_Condition_List">
|
|
<sql id="ActivityTeacherPageInfo_Condition_List">
|
|
<if test="record.id != null">
|
|
<if test="record.id != null">
|
|
@@ -172,14 +172,21 @@
|
|
<if test="record.activityType != null">
|
|
<if test="record.activityType != null">
|
|
AND t1.activity_type_ = #{record.activityType}
|
|
AND t1.activity_type_ = #{record.activityType}
|
|
</if>
|
|
</if>
|
|
- <if test="record.activityState != null">
|
|
|
|
- AND t1.activity_state_ = #{record.activityState}
|
|
|
|
- </if>
|
|
|
|
<if test="record.resourceType != null">
|
|
<if test="record.resourceType != null">
|
|
- AND t2.resource_type_ = #{record.resourceType})
|
|
|
|
|
|
+ AND t2.resource_type_ = #{record.resourceType}
|
|
</if>
|
|
</if>
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="record.activityId != null">
|
|
|
|
+ AND (t2.activity_id_ = #{record.activityId} <if test="record.startTime != null and record.endTime != null"> OR (<include refid="ActivityTeacherNotIn_ActivityTime_Condition_List" />) </if>)
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ AND <include refid="ActivityTeacherNotIn_ActivityTime_Condition_List" />
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="ActivityTeacherNotIn_ActivityTime_Condition_List">
|
|
<if test="record.startTime != null and record.endTime != null">
|
|
<if test="record.startTime != null and record.endTime != null">
|
|
- AND (unix_timestamp(t1.activity_start_) <= #{record.startTime} AND #{record.startTime} <= unix_timestamp(t1.activity_end_) OR unix_timestamp(t1.activity_start_) <= #{record.endTime} AND #{record.endTime} <= unix_timestamp(t1.activity_end_))
|
|
|
|
|
|
+ t1.activity_state_ = #{record.activityState} AND ((unix_timestamp(t1.activity_start_) <= #{record.startTime} AND #{record.startTime} <= unix_timestamp(t1.activity_end_)) OR (unix_timestamp(t1.activity_start_) <= #{record.endTime} AND #{record.endTime} <= unix_timestamp(t1.activity_end_)))
|
|
</if>
|
|
</if>
|
|
</sql>
|
|
</sql>
|
|
<select id="selectActivityTeacherPageInfo" resultMap="ActivityTeacherPageInfoResultMap">
|
|
<select id="selectActivityTeacherPageInfo" resultMap="ActivityTeacherPageInfoResultMap">
|
|
@@ -187,10 +194,10 @@
|
|
FROM sys_user t1 JOIN teacher t2 ON (t1.id_ = t2.user_id_ <if test="record.lockFlag !=null"> AND t2.lock_flag_ = #{record.lockFlag} </if> )
|
|
FROM sys_user t1 JOIN teacher t2 ON (t1.id_ = t2.user_id_ <if test="record.lockFlag !=null"> AND t2.lock_flag_ = #{record.lockFlag} </if> )
|
|
<choose>
|
|
<choose>
|
|
<when test="record.addType == 1">
|
|
<when test="record.addType == 1">
|
|
- LEFT JOIN (SELECT t2.music_sheet_id_ AS user_id FROM activity_plan t1 JOIN activity_evaluation t2 ON (t1.id_ = t2.activity_id_ <include refid="ActivityTeacherNotIn_Condition_List"/> ) t4 ON (t4.user_id = t1.id_)
|
|
|
|
|
|
+ LEFT JOIN (SELECT t2.music_sheet_id_ AS user_id FROM activity_plan t1 JOIN activity_evaluation t2 ON (t1.id_ = t2.activity_id_ <include refid="ActivityTeacherNotIn_Condition_List"/> ) )t4 ON (t4.user_id = t1.id_)
|
|
</when>
|
|
</when>
|
|
<otherwise>
|
|
<otherwise>
|
|
- <if test="record.activityId != null"> JOIN activity_evaluation t3 ON (t1.id_ = t3.music_sheet_id_ AND t3.activity_id_ = #{record.activityId}) </if>
|
|
|
|
|
|
+ <if test="record.activityId != null and record.addType == 0"> JOIN activity_evaluation t3 ON (t1.id_ = t3.music_sheet_id_ AND t3.activity_id_ = #{record.activityId}) </if>
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
<where>
|
|
<where>
|
|
@@ -201,4 +208,37 @@
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
<!--活动老师信息-->
|
|
<!--活动老师信息-->
|
|
|
|
+
|
|
|
|
+ <!--时间匹配活动老师信息-->
|
|
|
|
+ <resultMap id="ActivityTeacherByTimePageInfoResultMap" type="com.yonge.cooleshow.biz.dal.vo.activity.ActivityTeacherWrapper">
|
|
|
|
+ <result column="real_name_" jdbcType="BIGINT" property="realName" />
|
|
|
|
+ <result column="username_" jdbcType="VARCHAR" property="username" />
|
|
|
|
+ <result column="teacher_id" jdbcType="BIGINT" property="teacherId" />
|
|
|
|
+ </resultMap>
|
|
|
|
+ <sql id="ActivityTeacherByTimePageInfo_Column_List">
|
|
|
|
+ t4.id_ AS teacher_id, t4.real_name_, t4.username_
|
|
|
|
+ </sql>
|
|
|
|
+ <select id="selectActivityTeacherByTimePageInfo" resultMap="ActivityTeacherByTimePageInfoResultMap">
|
|
|
|
+ SELECT <include refid="ActivityTeacherByTimePageInfo_Column_List" />
|
|
|
|
+ FROM activity_plan t1 JOIN activity_evaluation t2 ON t1.id_ = t2.activity_id_ LEFT JOIN activity_evaluation t3 ON (t3.music_sheet_id_ = t2.music_sheet_id_ AND t3.activity_id_ = #{record.activityId}) JOIN sys_user t4 ON (t2.music_sheet_id_ = t4.id_)
|
|
|
|
+ <where>
|
|
|
|
+ t3.id_ IS NOT NULL
|
|
|
|
+ <if test="record.activityId != null">
|
|
|
|
+ AND t2.activity_id_ != #{record.activityId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.lockFlag != null">
|
|
|
|
+ AND t4.lock_flag_ = #{record.lockFlag}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.deleteFlag != null">
|
|
|
|
+ AND t4.del_flag_ = #{record.deleteFlag}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.activityState != null">
|
|
|
|
+ AND t1.activity_state_ = #{record.activityState}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="record.startTime != null and record.endTime != null">
|
|
|
|
+ AND ((unix_timestamp(t1.activity_start_) <= #{record.startTime} AND #{record.startTime} <= unix_timestamp(t1.activity_end_)) OR (unix_timestamp(t1.activity_start_) <= #{record.endTime} AND #{record.endTime} <= unix_timestamp(t1.activity_end_)))
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+ <!--时间匹配活动老师信息-->
|
|
</mapper>
|
|
</mapper>
|