|
@@ -18,7 +18,10 @@
|
|
|
t5.credential_number,
|
|
t5.credential_number,
|
|
|
t6.name AS gender,
|
|
t6.name AS gender,
|
|
|
t3.name AS teacher_name,
|
|
t3.name AS teacher_name,
|
|
|
- t.class_id,t.punishment_type_id,
|
|
|
|
|
|
|
+ t.file_id,
|
|
|
|
|
+ t.class_id,ifnull((SELECT punishment_type_id FROM base_punishment_student_handle
|
|
|
|
|
+ WHERE base_student_punishment_info_id = t.id
|
|
|
|
|
+ ORDER BY adjust_date DESC,id desc LIMIT 1), t.punishment_type_id) as punishment_type_id,
|
|
|
(SELECT IF(a1.adjust_type = 3, REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')')) FROM base_punishment_student_handle a1
|
|
(SELECT IF(a1.adjust_type = 3, REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')')) FROM base_punishment_student_handle a1
|
|
|
LEFT JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.id
|
|
LEFT JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.id
|
|
|
WHERE base_student_punishment_info_id = t.id
|
|
WHERE base_student_punishment_info_id = t.id
|
|
@@ -44,14 +47,14 @@
|
|
|
<if test="dto.punishmentTypeId != null and dto.punishmentTypeId > 0">
|
|
<if test="dto.punishmentTypeId != null and dto.punishmentTypeId > 0">
|
|
|
and t.punishment_type_id = #{dto.punishmentTypeId}
|
|
and t.punishment_type_id = #{dto.punishmentTypeId}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dto.startTime != null and dto.startTime != ''">
|
|
|
|
|
- and t.start_time = #{dto.startTime}
|
|
|
|
|
|
|
+ <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''">
|
|
|
|
|
+ and t.start_time between date_format(#{dto.startTime}, '%Y-%m-%d') and date_format(#{dto.endTime}, '%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dto.endTime != null and dto.endTime != ''">
|
|
|
|
|
- and t.end_time = #{dto.endTime}
|
|
|
|
|
|
|
+ <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
|
|
|
|
|
+ and t5.credential_number = #{dto.credentialNumber}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dto.credentialNumber != null and dto.endTime != ''">
|
|
|
|
|
- and t.end_time = #{dto.credentialNumber}
|
|
|
|
|
|
|
+ <if test="dto.name != null and dto.name != ''">
|
|
|
|
|
+ and t.name like concat('%', #{dto.name},'%')
|
|
|
</if>
|
|
</if>
|
|
|
ORDER BY t.id DESC;
|
|
ORDER BY t.id DESC;
|
|
|
</select>
|
|
</select>
|
|
@@ -73,17 +76,14 @@
|
|
|
#{punishmentTypeId}
|
|
#{punishmentTypeId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dto.startDate != null and dto.startDate != ''">
|
|
|
|
|
- and t1.start_time >= #{dto.startDate}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="dto.endDate != null and dto.endDate != ''">
|
|
|
|
|
- and t1.start_time <= #{dto.endDate}
|
|
|
|
|
|
|
+ <if test="dto.startDate != null and dto.startDate != '' and dto.endDate != null and dto.endDate != ''">
|
|
|
|
|
+ and t1.start_time between date_format(#{dto.startDate}, '%Y-%m-%d') and date_format(#{dto.endDate}, '%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="dto.isHandle != null">
|
|
<if test="dto.isHandle != null">
|
|
|
- and t.adjust_type is not null
|
|
|
|
|
|
|
+ and t1.adjust_type is not null
|
|
|
</if>
|
|
</if>
|
|
|
<if test="dto.studentName != null and dto.studentName != ''">
|
|
<if test="dto.studentName != null and dto.studentName != ''">
|
|
|
- and t.name like concat('$',#{dto.studentName},'%')
|
|
|
|
|
|
|
+ and (t3.name like concat('%',#{dto.studentName},'%') or t3.credential_number like concat('%',#{dto.studentName},'%'))
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -98,12 +98,14 @@
|
|
|
t.push_message_object,
|
|
t.push_message_object,
|
|
|
t.reason,
|
|
t.reason,
|
|
|
t.class_name,
|
|
t.class_name,
|
|
|
|
|
+ t5.name as student_name,
|
|
|
t5.name,
|
|
t5.name,
|
|
|
t5.credential_number,
|
|
t5.credential_number,
|
|
|
t6.name AS gender,
|
|
t6.name AS gender,
|
|
|
|
|
+ t5.credential_number as student_id,
|
|
|
t3.name AS teacher_name,
|
|
t3.name AS teacher_name,
|
|
|
t.class_id,
|
|
t.class_id,
|
|
|
- t8.name as major,
|
|
|
|
|
|
|
+ t8.name as major,t.file_id,
|
|
|
(SELECT IF(a1.adjust_type = 3, REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')')) FROM base_punishment_student_handle a1
|
|
(SELECT IF(a1.adjust_type = 3, REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')')) FROM base_punishment_student_handle a1
|
|
|
LEFT JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.id
|
|
LEFT JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.id
|
|
|
WHERE base_student_punishment_info_id = t.id
|
|
WHERE base_student_punishment_info_id = t.id
|
|
@@ -122,7 +124,7 @@
|
|
|
LEFT JOIN base_semester t1 ON (t1.id = t.base_semester_id)
|
|
LEFT JOIN base_semester t1 ON (t1.id = t.base_semester_id)
|
|
|
LEFT JOIN xjr_user t3 ON (t3.id = t.teacher_id)
|
|
LEFT JOIN xjr_user t3 ON (t3.id = t.teacher_id)
|
|
|
LEFT JOIN xjr_dictionary_detail t6 ON (t6.code = t5.gender)
|
|
LEFT JOIN xjr_dictionary_detail t6 ON (t6.code = t5.gender)
|
|
|
- left join base_student_school_roll t7 on t.user_id = t7.id
|
|
|
|
|
|
|
+ left join base_student_school_roll t7 on t.user_id = t7.user_id
|
|
|
left join base_major_set t8 on t7.major_set_id = t8.id
|
|
left join base_major_set t8 on t7.major_set_id = t8.id
|
|
|
WHERE t.delete_mark = 0
|
|
WHERE t.delete_mark = 0
|
|
|
and t.id = #{dto.id}
|
|
and t.id = #{dto.id}
|
|
@@ -143,7 +145,7 @@
|
|
|
t5.credential_number,
|
|
t5.credential_number,
|
|
|
t6.name AS gender,
|
|
t6.name AS gender,
|
|
|
t3.name AS teacher_name,
|
|
t3.name AS teacher_name,
|
|
|
- t.class_id,
|
|
|
|
|
|
|
+ t.class_id,t.file_id,
|
|
|
(SELECT adjust_type FROM base_punishment_student_handle
|
|
(SELECT adjust_type FROM base_punishment_student_handle
|
|
|
WHERE base_student_punishment_info_id = t.id
|
|
WHERE base_student_punishment_info_id = t.id
|
|
|
ORDER BY adjust_date DESC LIMIT 1) as adjust_type,
|
|
ORDER BY adjust_date DESC LIMIT 1) as adjust_type,
|
|
@@ -154,7 +156,8 @@
|
|
|
WHERE base_student_punishment_info_id = t.id
|
|
WHERE base_student_punishment_info_id = t.id
|
|
|
ORDER BY adjust_date DESC LIMIT 1) as adjust_reason,
|
|
ORDER BY adjust_date DESC LIMIT 1) as adjust_reason,
|
|
|
(SELECT COUNT(*) FROM base_punishment_student_handle
|
|
(SELECT COUNT(*) FROM base_punishment_student_handle
|
|
|
- WHERE base_student_punishment_info_id = t.id) as handle_count
|
|
|
|
|
|
|
+ WHERE base_student_punishment_info_id = t.id) as handle_count,
|
|
|
|
|
+ t.punishment_type_id,t.base_semester_id
|
|
|
FROM base_student_punishment_info t
|
|
FROM base_student_punishment_info t
|
|
|
INNER JOIN base_punishment_type t2 ON (t2.id = t.punishment_type_id)
|
|
INNER JOIN base_punishment_type t2 ON (t2.id = t.punishment_type_id)
|
|
|
INNER JOIN xjr_user t5 ON (t.user_id = t5.id)
|
|
INNER JOIN xjr_user t5 ON (t.user_id = t5.id)
|