添加学生签到无分组查询功能

dev
zhangyue 2026-03-10 14:38:21 +08:00
parent 130e436c69
commit 7802380a75
9 changed files with 60 additions and 1 deletions

View File

@ -53,6 +53,11 @@ public class AppStudentSignController {
public MultiResponse<StudentSignCO> listAll(@RequestBody ClassAppSignQry qry) {
return studentSignService.listAll(qry);
}
@ApiOperation("所有数据")
@PostMapping("/listAllNoGroup")
public MultiResponse<StudentSignCO> listAllNoGroup(@RequestBody ClassAppSignQry qry) {
return studentSignService.listAllNoGroup(qry);
}
@ApiOperation("详情")
@GetMapping("/{id}")

View File

@ -67,6 +67,13 @@ public class StudentSignQueryExe {
return MultiResponse.of(studentSignCOS);
}
public MultiResponse<StudentSignCO> executeListAllNogGroup(ClassAppSignQry qry) {
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
List<StudentSignDO> list = studentSignRepository.listAllByStudentNoGroup(params);
List<StudentSignCO> studentSignCOS = studentSignCoConvertor.converDOsToCOs(list);
return MultiResponse.of(studentSignCOS);
}
public SingleResponse<StudentCO> executeVerify(StudentSignVerifyQry qry) {
ClassDO classDO = classRepository.getByClassId(qry.getClassId());

View File

@ -45,7 +45,6 @@ public class StudentExamRecordAddExe {
private final TrainingUserRepository trainingUserRepository;
@Transactional(rollbackFor = Exception.class)
public SingleResponse<StudentExamRecordCO> execute(StudentExamRecordAddCmd cmd) {
System.out.println("StudentExamRecordAddCmd"+ cmd.toString());
ClassDO classDO = classRepository.getByClassId(cmd.getClassId());
Integer count = studentExamRecordRepository.countByStudentId(cmd.getStudentId());
if (count >= classDO.getNumberofexams()) {

View File

@ -60,6 +60,10 @@ public class StudentSignServiceImpl implements StudentSignServiceI {
public MultiResponse<StudentSignCO> listAll(ClassAppSignQry qry) {
return studentSignQueryExe.executeListAll(qry);
}
@Override
public MultiResponse<StudentSignCO> listAllNoGroup(ClassAppSignQry qry) {
return studentSignQueryExe.executeListAllNogGroup(qry);
}
@Override
public SingleResponse<StudentCO> verify(StudentSignVerifyQry qry) {

View File

@ -26,6 +26,7 @@ public interface StudentSignServiceI {
void removeBatch(Long[] ids);
MultiResponse<StudentSignCO> listAll(ClassAppSignQry qry);
MultiResponse<StudentSignCO> listAllNoGroup(ClassAppSignQry qry);
SingleResponse<StudentCO> verify(StudentSignVerifyQry qry);
}

View File

@ -18,5 +18,6 @@ import java.util.Map;
public interface StudentSignMapper extends BaseMapper<StudentSignDO> {
List<StudentSignDO> listAll(@Param("params") Map<String, Object> params);
List<StudentSignDO> listAllByStudent(@Param("params") Map<String, Object> params);
List<StudentSignDO> listAllByStudentNoGroup(@Param("params") Map<String, Object> params);
}

View File

@ -58,6 +58,10 @@ public class StudentSignRepositoryImpl extends BaseRepositoryImpl<StudentSignMap
public List<StudentSignDO> listAllByStudent(Map<String, Object> params) {
return studentSignMapper.listAllByStudent(params);
}
@Override
public List<StudentSignDO> listAllByStudentNoGroup(Map<String, Object> params) {
return studentSignMapper.listAllByStudentNoGroup(params);
}
@Override
public List<StudentSignDO> listAllByStudentId(Map<String, Object> params) {

View File

@ -23,6 +23,8 @@ public interface StudentSignRepository extends BaseRepository<StudentSignDO> {
List<StudentSignDO> listAllByStudent(Map<String, Object> params);
List<StudentSignDO> listAllByStudentNoGroup(Map<String, Object> params);
List<StudentSignDO> listAllByStudentId(Map<String, Object> params);
Integer countByClassId(String classId);

View File

@ -71,6 +71,42 @@
</select>
<select id="listAllByStudentNoGroup" resultType="com.zcloud.edu.persistence.dataobject.study.StudentSignDO">
SELECT
s.name student_name,
cl.name class_name,
cl.training_location,
MAX(CASE WHEN ss.type = 1 THEN ss.face_url END) AS sign_face_url,
MAX(CASE WHEN ss.type = 2 THEN ss.face_url END) AS exam_face_url,
u.user_avatar_url,
s.user_id_card,
s.phone,
ss.*
FROM
student_sign ss
LEFT JOIN student s ON ss.student_id = s.student_id
LEFT JOIN class cl ON cl.class_id = s.class_id
left join user u on u.phone = s.phone
<where>
<if test="params.classId != null and params.classId != ''">
AND ss.class_id = #{params.classId}
</if>
<if test="params.studentId != null and params.studentId != ''">
AND ss.student_id = #{params.studentId}
</if>
<if test="params.type != null and params.type != ''">
AND ss.type = #{params.type}
</if>
AND ss.delete_enum = 'FALSE'
and ss.sign_url is not null
and ss.sign_url != ''
order by
ss.create_time desc
</where>
</select>
<!--<select id="listAllByStudentId" resultType="com.zcloud.edu.persistence.dataobject.study.StudentSignDO">-->
<!-- SELECT-->
<!-- s.name student_name,-->