同步学生信息修改
This commit is contained in:
@@ -9,10 +9,7 @@ import com.srs.comprehensive.service.ISrsClassService;
|
|||||||
import com.srs.comprehensive.service.ISrsMajorsService;
|
import com.srs.comprehensive.service.ISrsMajorsService;
|
||||||
import com.srs.comprehensive.service.SyncDataService;
|
import com.srs.comprehensive.service.SyncDataService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -72,6 +69,13 @@ public class SyncDataController extends BaseController {
|
|||||||
iSrsClassService.synchronousMYSQL(list);//同步班级
|
iSrsClassService.synchronousMYSQL(list);//同步班级
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
@RequestMapping("/getStudentInfo")
|
||||||
|
public AjaxResult getStudentInfoList(@RequestParam("pageNum")Integer pageNum,
|
||||||
|
@RequestParam("pageSize") Integer pageSize,
|
||||||
|
@RequestParam(value = "stuNo", required = false)String stuNo){
|
||||||
|
int studentInfoNumber = syncDataService.getStudentInfoNumber();
|
||||||
|
List<Map> list=syncDataService.getStudentInfoList(pageNum,pageSize,stuNo);
|
||||||
|
return success(list).put("total", studentInfoNumber);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.srs.comprehensive.mapper;
|
package com.srs.comprehensive.mapper;
|
||||||
|
|
||||||
import com.srs.comprehensive.domain.Dto.SelectClass;
|
import com.srs.comprehensive.domain.Dto.SelectClass;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -9,5 +10,11 @@ public interface SyncDataMapper {
|
|||||||
public List<Map> getEmployEEInfoList(String zgh);//教职工
|
public List<Map> getEmployEEInfoList(String zgh);//教职工
|
||||||
public List<Map> getSpecialtyInfoList(String zydm);//专业
|
public List<Map> getSpecialtyInfoList(String zydm);//专业
|
||||||
public List<Map> getSpecialtyALLInfo();//所有专业
|
public List<Map> getSpecialtyALLInfo();//所有专业
|
||||||
public List<Map> getClassInfoList(SelectClass selectClass);//班级
|
public List<Map> getClassInfoList(SelectClass selectClass);//所有班级
|
||||||
|
//统计学生数量
|
||||||
|
int selectNumber();
|
||||||
|
/*
|
||||||
|
* 学生
|
||||||
|
* */
|
||||||
|
public List<Map> getStudentInfoList(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize,@Param("stuNo") String stuNo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,4 +10,6 @@ public interface SyncDataService {
|
|||||||
List<Map> getSpecialtyInfoList(String zydm);//专业
|
List<Map> getSpecialtyInfoList(String zydm);//专业
|
||||||
List<Map> getSpecialtyALLInfo();//所有专业
|
List<Map> getSpecialtyALLInfo();//所有专业
|
||||||
List<Map> getClassInfoList(SelectClass selectClass);//班级
|
List<Map> getClassInfoList(SelectClass selectClass);//班级
|
||||||
|
public int getStudentInfoNumber();
|
||||||
|
public List<Map> getStudentInfoList(Integer pageNum,Integer pageSize,String stuNo);//学生
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,21 @@ public class SyncDataServiceImpl implements SyncDataService {
|
|||||||
public List<Map> getClassInfoList(SelectClass selectClass){
|
public List<Map> getClassInfoList(SelectClass selectClass){
|
||||||
return syncDataMapper.getClassInfoList(selectClass);
|
return syncDataMapper.getClassInfoList(selectClass);
|
||||||
}
|
}
|
||||||
|
//统计学生数量
|
||||||
|
@Override
|
||||||
|
public int getStudentInfoNumber() {
|
||||||
|
return syncDataMapper.selectNumber();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public List<Map> getStudentInfoList(Integer pageNum,Integer pageSize,String stuNo) {
|
||||||
|
// 1. 参数校验:页码/条数不能为空,且≥1
|
||||||
|
if (pageNum == null || pageNum < 1) {
|
||||||
|
pageNum = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null || pageSize < 1) {
|
||||||
|
pageSize = 10; // 默认每页10条
|
||||||
|
}
|
||||||
|
int offset = (pageNum - 1) * pageSize;
|
||||||
|
return syncDataMapper.getStudentInfoList(offset,pageSize,stuNo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,4 +32,19 @@
|
|||||||
<if test="gradeCode != null and gradeCode!= '' ">and BJSSNJ=#{gradeCode}</if>
|
<if test="gradeCode != null and gradeCode!= '' ">and BJSSNJ=#{gradeCode}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectNumber" resultType="java.lang.Integer">
|
||||||
|
select count(1) as number from from_gxsdxyxxzx_student
|
||||||
|
</select>
|
||||||
|
<select id="getStudentInfoList" resultType="java.util.Map">
|
||||||
|
SELECT ROW_NUMBER() OVER(ORDER BY TBA.XH) as xsid,TBA.XH as xh,TBA.XM as xm,CASE
|
||||||
|
WHEN TBA.XBDM = 1 THEN '男'
|
||||||
|
WHEN TBA.XBDM = 2 THEN '女'
|
||||||
|
ELSE '未知' -- 可选:添加默认值,避免NULL
|
||||||
|
END as xb,TBA.XSDQZTDM as sfzx,TBA.XSDQZTDMMC as status,TBA.MZDM as mz,TBB.BJMC as bjmc
|
||||||
|
FROM `from_gxsdxyxxzx_student` TBA
|
||||||
|
LEFT JOIN from_gxsdxyxxzx_class TBB ON TBA.SZBJBH=TBB.BJBH
|
||||||
|
where TBB.BJSSNJ>=2019 and TBA.XH is not null
|
||||||
|
<if test="stuNo != null and stuNo != ''">and TBA.XH=#{stuNo}</if>
|
||||||
|
LIMIT #{offset}, #{pageSize}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user