添加学生签到无分组查询功能
parent
130e436c69
commit
7802380a75
|
|
@ -53,6 +53,11 @@ public class AppStudentSignController {
|
||||||
public MultiResponse<StudentSignCO> listAll(@RequestBody ClassAppSignQry qry) {
|
public MultiResponse<StudentSignCO> listAll(@RequestBody ClassAppSignQry qry) {
|
||||||
return studentSignService.listAll(qry);
|
return studentSignService.listAll(qry);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("所有数据")
|
||||||
|
@PostMapping("/listAllNoGroup")
|
||||||
|
public MultiResponse<StudentSignCO> listAllNoGroup(@RequestBody ClassAppSignQry qry) {
|
||||||
|
return studentSignService.listAllNoGroup(qry);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("详情")
|
@ApiOperation("详情")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,13 @@ public class StudentSignQueryExe {
|
||||||
return MultiResponse.of(studentSignCOS);
|
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) {
|
public SingleResponse<StudentCO> executeVerify(StudentSignVerifyQry qry) {
|
||||||
ClassDO classDO = classRepository.getByClassId(qry.getClassId());
|
ClassDO classDO = classRepository.getByClassId(qry.getClassId());
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ public class StudentExamRecordAddExe {
|
||||||
private final TrainingUserRepository trainingUserRepository;
|
private final TrainingUserRepository trainingUserRepository;
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public SingleResponse<StudentExamRecordCO> execute(StudentExamRecordAddCmd cmd) {
|
public SingleResponse<StudentExamRecordCO> execute(StudentExamRecordAddCmd cmd) {
|
||||||
System.out.println("StudentExamRecordAddCmd"+ cmd.toString());
|
|
||||||
ClassDO classDO = classRepository.getByClassId(cmd.getClassId());
|
ClassDO classDO = classRepository.getByClassId(cmd.getClassId());
|
||||||
Integer count = studentExamRecordRepository.countByStudentId(cmd.getStudentId());
|
Integer count = studentExamRecordRepository.countByStudentId(cmd.getStudentId());
|
||||||
if (count >= classDO.getNumberofexams()) {
|
if (count >= classDO.getNumberofexams()) {
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,10 @@ public class StudentSignServiceImpl implements StudentSignServiceI {
|
||||||
public MultiResponse<StudentSignCO> listAll(ClassAppSignQry qry) {
|
public MultiResponse<StudentSignCO> listAll(ClassAppSignQry qry) {
|
||||||
return studentSignQueryExe.executeListAll(qry);
|
return studentSignQueryExe.executeListAll(qry);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public MultiResponse<StudentSignCO> listAllNoGroup(ClassAppSignQry qry) {
|
||||||
|
return studentSignQueryExe.executeListAllNogGroup(qry);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SingleResponse<StudentCO> verify(StudentSignVerifyQry qry) {
|
public SingleResponse<StudentCO> verify(StudentSignVerifyQry qry) {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ public interface StudentSignServiceI {
|
||||||
void removeBatch(Long[] ids);
|
void removeBatch(Long[] ids);
|
||||||
|
|
||||||
MultiResponse<StudentSignCO> listAll(ClassAppSignQry qry);
|
MultiResponse<StudentSignCO> listAll(ClassAppSignQry qry);
|
||||||
|
MultiResponse<StudentSignCO> listAllNoGroup(ClassAppSignQry qry);
|
||||||
|
|
||||||
SingleResponse<StudentCO> verify(StudentSignVerifyQry qry);
|
SingleResponse<StudentCO> verify(StudentSignVerifyQry qry);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,6 @@ import java.util.Map;
|
||||||
public interface StudentSignMapper extends BaseMapper<StudentSignDO> {
|
public interface StudentSignMapper extends BaseMapper<StudentSignDO> {
|
||||||
List<StudentSignDO> listAll(@Param("params") Map<String, Object> params);
|
List<StudentSignDO> listAll(@Param("params") Map<String, Object> params);
|
||||||
List<StudentSignDO> listAllByStudent(@Param("params") Map<String, Object> params);
|
List<StudentSignDO> listAllByStudent(@Param("params") Map<String, Object> params);
|
||||||
|
List<StudentSignDO> listAllByStudentNoGroup(@Param("params") Map<String, Object> params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,10 @@ public class StudentSignRepositoryImpl extends BaseRepositoryImpl<StudentSignMap
|
||||||
public List<StudentSignDO> listAllByStudent(Map<String, Object> params) {
|
public List<StudentSignDO> listAllByStudent(Map<String, Object> params) {
|
||||||
return studentSignMapper.listAllByStudent(params);
|
return studentSignMapper.listAllByStudent(params);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public List<StudentSignDO> listAllByStudentNoGroup(Map<String, Object> params) {
|
||||||
|
return studentSignMapper.listAllByStudentNoGroup(params);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StudentSignDO> listAllByStudentId(Map<String, Object> params) {
|
public List<StudentSignDO> listAllByStudentId(Map<String, Object> params) {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ public interface StudentSignRepository extends BaseRepository<StudentSignDO> {
|
||||||
|
|
||||||
List<StudentSignDO> listAllByStudent(Map<String, Object> params);
|
List<StudentSignDO> listAllByStudent(Map<String, Object> params);
|
||||||
|
|
||||||
|
List<StudentSignDO> listAllByStudentNoGroup(Map<String, Object> params);
|
||||||
|
|
||||||
List<StudentSignDO> listAllByStudentId(Map<String, Object> params);
|
List<StudentSignDO> listAllByStudentId(Map<String, Object> params);
|
||||||
|
|
||||||
Integer countByClassId(String classId);
|
Integer countByClassId(String classId);
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,42 @@
|
||||||
</select>
|
</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 id="listAllByStudentId" resultType="com.zcloud.edu.persistence.dataobject.study.StudentSignDO">-->
|
||||||
<!-- SELECT-->
|
<!-- SELECT-->
|
||||||
<!-- s.name student_name,-->
|
<!-- s.name student_name,-->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue