5-5 问题修改
This commit is contained in:
@@ -0,0 +1,84 @@
|
|||||||
|
package com.yxt.demo.common.core.query;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dimengzhe
|
||||||
|
* @date 2021/9/3 16:41
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class PagerQuery01<T> implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前页号", example = "1")
|
||||||
|
private long current = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "每页记录数", example = "10")
|
||||||
|
private long size = 10L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标识符")
|
||||||
|
private Integer identifier;
|
||||||
|
|
||||||
|
@ApiModelProperty("查询条件的项")
|
||||||
|
private T params;
|
||||||
|
|
||||||
|
@ApiModelProperty("临时值")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
public PagerQuery01() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagerQuery01(long current) {
|
||||||
|
this.current = current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagerQuery01(long current, long size) {
|
||||||
|
this.size = size;
|
||||||
|
this.current = current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagerQuery01 setSize(long size) {
|
||||||
|
this.size = size;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getCurrent() {
|
||||||
|
return current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagerQuery01 setCurrent(long current) {
|
||||||
|
this.current = current;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagerQuery01 setParams(T params) {
|
||||||
|
this.params = params;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIdentifier() {
|
||||||
|
return identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdentifier(Integer identifier) {
|
||||||
|
this.identifier = identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.yxt.demo.system.api.sys_info;
|
package com.yxt.demo.system.api.sys_info;
|
||||||
|
|
||||||
import com.yxt.demo.common.core.query.PagerQuery;
|
import com.yxt.demo.common.core.query.PagerQuery;
|
||||||
|
import com.yxt.demo.common.core.query.PagerQuery01;
|
||||||
import com.yxt.demo.common.core.vo.PagerVo;
|
import com.yxt.demo.common.core.vo.PagerVo;
|
||||||
import com.yxt.demo.system.api.dict_type.DictTypeQuery;
|
import com.yxt.demo.system.api.dict_type.DictTypeQuery;
|
||||||
import com.yxt.demo.system.api.dict_type.DictTypeVo;
|
import com.yxt.demo.system.api.dict_type.DictTypeVo;
|
||||||
@@ -30,7 +31,7 @@ public interface SysInfoFeign {
|
|||||||
|
|
||||||
@ApiOperation(value = "查询基本信息")
|
@ApiOperation(value = "查询基本信息")
|
||||||
@RequestMapping("/selectInfoList")
|
@RequestMapping("/selectInfoList")
|
||||||
ResultBean selectInfoList(@RequestBody String type);
|
ResultBean selectInfoList(@RequestBody PagerQuery01<SysInfo> pagerQuery);
|
||||||
|
|
||||||
@ApiOperation(value = "删除基本信息")
|
@ApiOperation(value = "删除基本信息")
|
||||||
@RequestMapping("/deleteInfo/{sid}")
|
@RequestMapping("/deleteInfo/{sid}")
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ public class SysInfoShip extends BaseEntity {
|
|||||||
private String studentNo;
|
private String studentNo;
|
||||||
@ApiModelProperty("学生")
|
@ApiModelProperty("学生")
|
||||||
private String studentName;
|
private String studentName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty("入学时间")
|
@ApiModelProperty("入学时间")
|
||||||
private String studyYear;
|
private String studyYear;
|
||||||
@ApiModelProperty("类别")
|
@ApiModelProperty("类别")
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.yxt.demo.system.api.sys_info_ship;
|
package com.yxt.demo.system.api.sys_info_ship;
|
||||||
|
|
||||||
|
import com.yxt.demo.common.core.query.PagerQuery01;
|
||||||
import com.yxt.demo.system.api.sys_user.SysUserDto;
|
import com.yxt.demo.system.api.sys_user.SysUserDto;
|
||||||
import com.yxt.demo.system.biz.sys_info_ship.SysInfoShipService;
|
import com.yxt.demo.system.biz.sys_info_ship.SysInfoShipService;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
@@ -34,6 +36,10 @@ public interface SysInfoShipFeign {
|
|||||||
@RequestMapping("/selectSysInfoShip")
|
@RequestMapping("/selectSysInfoShip")
|
||||||
ResultBean selectSysInfoShip();
|
ResultBean selectSysInfoShip();
|
||||||
|
|
||||||
|
@ApiOperation(value = "分页查询")
|
||||||
|
@RequestMapping("/pageSelectSysInfoShip")
|
||||||
|
ResultBean pageSelectSysInfoShip(@RequestBody PagerQuery01<SysInfoShip> pagerQuery);
|
||||||
|
|
||||||
@ApiOperation(value = "查询该老师下的学生")
|
@ApiOperation(value = "查询该老师下的学生")
|
||||||
@RequestMapping("/selectTeacherDownStudent/{teacher}")
|
@RequestMapping("/selectTeacherDownStudent/{teacher}")
|
||||||
ResultBean selectTeacherDownStudent(@PathVariable String teacher);
|
ResultBean selectTeacherDownStudent(@PathVariable String teacher);
|
||||||
|
|||||||
@@ -32,4 +32,12 @@ public interface SysStudentScoreFeign {
|
|||||||
@ApiOperation(value = "查询学生信息")
|
@ApiOperation(value = "查询学生信息")
|
||||||
@RequestMapping("/selectStudentScore")
|
@RequestMapping("/selectStudentScore")
|
||||||
ResultBean selectStudentScore();
|
ResultBean selectStudentScore();
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询学生成绩及格率及通过人数")
|
||||||
|
@RequestMapping("/selectStudentScoreYIELD")
|
||||||
|
ResultBean selectStudentScoreYIELD(@RequestBody SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询学生升学率、就业率、考公率")
|
||||||
|
@RequestMapping("/selectStudentRate")
|
||||||
|
ResultBean selectStudentRate(@RequestBody SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.yxt.demo.system.api.sys_student_score;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author shkstart
|
||||||
|
* @create 2023-05-05-15:23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysStudentScoreYIELD {
|
||||||
|
@ApiModelProperty("班级")
|
||||||
|
private String calss;
|
||||||
|
@ApiModelProperty("查询科目名称")
|
||||||
|
private String name;
|
||||||
|
@ApiModelProperty("及格率")
|
||||||
|
private String YIELD;
|
||||||
|
@ApiModelProperty("通过人数")
|
||||||
|
private Integer count;
|
||||||
|
}
|
||||||
@@ -1,6 +1,11 @@
|
|||||||
package com.yxt.demo.system.biz.sys_info;
|
package com.yxt.demo.system.biz.sys_info;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.yxt.demo.system.api.dict_common.DictCommon;
|
||||||
|
import com.yxt.demo.system.api.dict_common.DictCommonVo;
|
||||||
import com.yxt.demo.system.api.sys_info.SysInfo;
|
import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||||
import com.yxt.demo.system.api.sys_info.SysInfoPageCount;
|
import com.yxt.demo.system.api.sys_info.SysInfoPageCount;
|
||||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||||
@@ -30,4 +35,6 @@ public interface SysInfoMapper extends BaseMapper<SysInfo> {
|
|||||||
void deleteInfoBySid(@Param("sid") String sid);
|
void deleteInfoBySid(@Param("sid") String sid);
|
||||||
|
|
||||||
SysInfo selectInfoByUserSid(@Param("userSid") String userSid);
|
SysInfo selectInfoByUserSid(@Param("userSid") String userSid);
|
||||||
|
|
||||||
|
IPage<SysInfo> listPageVo(IPage<SysInfo> page, @Param(Constants.WRAPPER) QueryWrapper<SysInfo> qw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,4 +35,12 @@
|
|||||||
<select id="selectInfoByUserSid" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
<select id="selectInfoByUserSid" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
||||||
select * from sys_info where userSid = #{userSid}
|
select * from sys_info where userSid = #{userSid}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="listPageVo" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
||||||
|
SELECT *
|
||||||
|
FROM sys_info
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.yxt.demo.system.biz.sys_info;
|
package com.yxt.demo.system.biz.sys_info;
|
||||||
|
|
||||||
|
import com.yxt.demo.common.core.query.PagerQuery01;
|
||||||
|
import com.yxt.demo.common.core.vo.PagerVo;
|
||||||
import com.yxt.demo.system.api.sys_info.SysInfo;
|
import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||||
import com.yxt.demo.system.api.sys_info.SysInfoFeign;
|
import com.yxt.demo.system.api.sys_info.SysInfoFeign;
|
||||||
import com.yxt.demo.system.api.sys_info.SysInfoPageCount;
|
import com.yxt.demo.system.api.sys_info.SysInfoPageCount;
|
||||||
@@ -33,8 +35,17 @@ public class SysInfoRest implements SysInfoFeign {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultBean selectInfoList(String type) {
|
public ResultBean selectInfoList(PagerQuery01<SysInfo> pagerQuery) {
|
||||||
return sysInfoService.selectInfoList(type);
|
ResultBean objectResultBean = ResultBean.fireFail();
|
||||||
|
PagerVo<SysInfo> sysInfoPagerVo = null;
|
||||||
|
if (pagerQuery.getType() != null){
|
||||||
|
if (pagerQuery.getType().equals("xs")){
|
||||||
|
sysInfoPagerVo = sysInfoService.listPageVo(pagerQuery);
|
||||||
|
}else if (pagerQuery.getType().equals("js")){
|
||||||
|
sysInfoPagerVo = sysInfoService.listPageVo(pagerQuery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return objectResultBean.success().setData(sysInfoPagerVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
package com.yxt.demo.system.biz.sys_info;
|
package com.yxt.demo.system.biz.sys_info;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.yxt.demo.common.core.query.PagerQuery01;
|
||||||
|
import com.yxt.demo.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.demo.system.api.dict_common.DictCommon;
|
||||||
|
import com.yxt.demo.system.api.dict_common.DictCommonQuery;
|
||||||
|
import com.yxt.demo.system.api.dict_common.DictCommonVo;
|
||||||
import com.yxt.demo.system.api.sys_info.SysInfoPageCount;
|
import com.yxt.demo.system.api.sys_info.SysInfoPageCount;
|
||||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||||
import com.yxt.demo.system.biz.sys_user.SysUserMapper;
|
import com.yxt.demo.system.biz.sys_user.SysUserMapper;
|
||||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
import com.yxt.demo.system.api.sys_info.SysInfo;
|
import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||||
|
import com.yxt.demo.system.jdbc.service.PagerUtil;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.yxt.demo.common.core.query.PagerQuery;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -45,18 +54,35 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
|||||||
return rb.success().setData(sysInfo);
|
return rb.success().setData(sysInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultBean selectInfoList(String type) {
|
// public ResultBean selectInfoList(String type) {
|
||||||
ResultBean objectResultBean = ResultBean.fireFail();
|
// ResultBean objectResultBean = ResultBean.fireFail();
|
||||||
List<SysInfo> sysInfos = null;
|
// PagerQuery01<SysInfo> pagerQuery = new PagerQuery01<SysInfo>();
|
||||||
if (type != null){
|
// List<SysInfo> sysInfos = null;
|
||||||
if (type.equals("xs")){
|
// if (type != null){
|
||||||
sysInfos = sysInfoMapper.selectInfoStudentList();
|
// if (type.equals("xs")){
|
||||||
}else if (type.equals("js")){
|
// sysInfos = sysInfoMapper.listPageVo(pagerQuery);
|
||||||
sysInfos = sysInfoMapper.selectInfoTeacherList();
|
// }else if (type.equals("js")){
|
||||||
}
|
// sysInfos = sysInfoMapper.selectInfoTeacherList();
|
||||||
return objectResultBean.success().setData(sysInfos);
|
// }
|
||||||
|
// return objectResultBean.success().setData(sysInfos);
|
||||||
|
// }
|
||||||
|
// return objectResultBean;
|
||||||
|
// }
|
||||||
|
|
||||||
|
public PagerVo<SysInfo> listPageVo(PagerQuery01<SysInfo> pagerQuery) {
|
||||||
|
IPage page = PagerUtil.queryToPage(pagerQuery);
|
||||||
|
SysInfo params = pagerQuery.getParams();
|
||||||
|
String type = pagerQuery.getType();
|
||||||
|
QueryWrapper<SysInfo> qw = new QueryWrapper<>();
|
||||||
|
if (params != null) {
|
||||||
|
|
||||||
}
|
}
|
||||||
return objectResultBean;
|
if (type != null){
|
||||||
|
qw.like("infoId",type);
|
||||||
|
}
|
||||||
|
IPage<SysInfo> pagging = baseMapper.listPageVo(page, qw);
|
||||||
|
PagerVo<SysInfo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultBean deleteInfoBySid(String sid){
|
public ResultBean deleteInfoBySid(String sid){
|
||||||
@@ -70,6 +96,10 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
|||||||
public ResultBean saveInfo(SysInfo sysInfo){
|
public ResultBean saveInfo(SysInfo sysInfo){
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
if (sysInfo.getInfoId().contains("xs") || sysInfo.getInfoId().contains("js")){
|
if (sysInfo.getInfoId().contains("xs") || sysInfo.getInfoId().contains("js")){
|
||||||
|
SysInfo sysInfo1 = sysUserMapper.selectInfoByInfoId(sysInfo.getInfoId());
|
||||||
|
if (sysInfo1 != null){
|
||||||
|
return rb.setMsg("已有该用户信息");
|
||||||
|
}
|
||||||
SysUser sysUser = sysUserMapper.selectByNameAndUserName(sysInfo.getInfoId(), sysInfo.getName());
|
SysUser sysUser = sysUserMapper.selectByNameAndUserName(sysInfo.getInfoId(), sysInfo.getName());
|
||||||
if (sysUser != null){
|
if (sysUser != null){
|
||||||
sysInfo.setUserSid(sysUser.getSid());
|
sysInfo.setUserSid(sysUser.getSid());
|
||||||
@@ -83,7 +113,7 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
|||||||
return rb.success();
|
return rb.success();
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
return rb.setMsg("学号格式不正确!!!");
|
return rb.setMsg("学号或工号格式不正确!!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
package com.yxt.demo.system.biz.sys_info_ship;
|
package com.yxt.demo.system.biz.sys_info_ship;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||||
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -17,4 +21,6 @@ public interface SysInfoShipMapper extends BaseMapper<SysInfoShip> {
|
|||||||
List<SysInfoShip> selectSysInfoShipList();
|
List<SysInfoShip> selectSysInfoShipList();
|
||||||
|
|
||||||
List<SysInfoShip> selectTeacherDownStudent(@Param("teacher") String teacher);
|
List<SysInfoShip> selectTeacherDownStudent(@Param("teacher") String teacher);
|
||||||
|
|
||||||
|
IPage<SysInfoShip> listPageVo(IPage<SysInfoShip> page, @Param(Constants.WRAPPER) QueryWrapper<SysInfoShip> qw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,4 +10,11 @@
|
|||||||
left join sys_info i on s.StudentNo = i.infoId
|
left join sys_info i on s.StudentNo = i.infoId
|
||||||
where s.teacherNo = #{teacher}
|
where s.teacherNo = #{teacher}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="listPageVo" resultType="com.yxt.demo.system.api.sys_info_ship.SysInfoShip">
|
||||||
|
select * from sys_info_ship
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.yxt.demo.system.biz.sys_info_ship;
|
package com.yxt.demo.system.biz.sys_info_ship;
|
||||||
|
|
||||||
|
import com.yxt.demo.common.core.query.PagerQuery01;
|
||||||
|
import com.yxt.demo.common.core.vo.PagerVo;
|
||||||
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
||||||
import com.yxt.demo.system.api.sys_info_ship.SysInfoShipFeign;
|
import com.yxt.demo.system.api.sys_info_ship.SysInfoShipFeign;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
@@ -49,4 +51,11 @@ public class SysInfoShipRest implements SysInfoShipFeign {
|
|||||||
public ResultBean selectTeacherDownStudent(String teacher) {
|
public ResultBean selectTeacherDownStudent(String teacher) {
|
||||||
return sysInfoShipService.selectTeacherDownStudent(teacher);
|
return sysInfoShipService.selectTeacherDownStudent(teacher);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean pageSelectSysInfoShip(PagerQuery01<SysInfoShip> pagerQuery) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
PagerVo<SysInfoShip> pagerVo = sysInfoShipService.listPageVo(pagerQuery);
|
||||||
|
return rb.success().setData(pagerVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
package com.yxt.demo.system.biz.sys_info_ship;
|
package com.yxt.demo.system.biz.sys_info_ship;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.yxt.demo.common.core.query.PagerQuery01;
|
||||||
|
import com.yxt.demo.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||||
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
||||||
|
import com.yxt.demo.system.biz.sys_user.SysUserMapper;
|
||||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
|
import com.yxt.demo.system.jdbc.service.PagerUtil;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -19,9 +26,15 @@ public class SysInfoShipService extends MybatisBaseService<SysInfoShipMapper, Sy
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysInfoShipMapper sysInfoShipMapper;
|
private SysInfoShipMapper sysInfoShipMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
public ResultBean saveSysInfoShip(SysInfoShip sysInfoShip) {
|
public ResultBean saveSysInfoShip(SysInfoShip sysInfoShip) {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
SysInfo sysInfo = sysUserMapper.selectInfoByInfoId(sysInfoShip.getStudentNo());
|
||||||
|
if (!sysInfo.getName().equals(sysInfoShip.getStudentName())){
|
||||||
|
return rb.setMsg("学生姓名与学号不符,请重新选择");
|
||||||
|
}
|
||||||
int insert = baseMapper.insert(sysInfoShip);
|
int insert = baseMapper.insert(sysInfoShip);
|
||||||
if (insert == 0){
|
if (insert == 0){
|
||||||
return rb.setMsg("添加失败");
|
return rb.setMsg("添加失败");
|
||||||
@@ -53,4 +66,18 @@ public class SysInfoShipService extends MybatisBaseService<SysInfoShipMapper, Sy
|
|||||||
}
|
}
|
||||||
return rb.success().setData(list);
|
return rb.success().setData(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PagerVo<SysInfoShip> listPageVo(PagerQuery01<SysInfoShip> pagerQuery) {
|
||||||
|
IPage page = PagerUtil.queryToPage(pagerQuery);
|
||||||
|
SysInfoShip params = pagerQuery.getParams();
|
||||||
|
String type = pagerQuery.getType();
|
||||||
|
QueryWrapper<SysInfoShip> qw = new QueryWrapper<>();
|
||||||
|
if (params != null) {
|
||||||
|
}
|
||||||
|
if (type != null){
|
||||||
|
}
|
||||||
|
IPage<SysInfoShip> pagging = baseMapper.listPageVo(page, qw);
|
||||||
|
PagerVo<SysInfoShip> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.yxt.demo.system.biz.sys_student_score;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
||||||
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -14,4 +15,16 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface SysStudentScoreMapper extends BaseMapper<SysStudentScore> {
|
public interface SysStudentScoreMapper extends BaseMapper<SysStudentScore> {
|
||||||
List<SysStudentScore> selectStudentScoreList();
|
List<SysStudentScore> selectStudentScoreList();
|
||||||
|
|
||||||
|
SysStudentScoreYIELD electStudentScoreYIELD(SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
|
|
||||||
|
SysStudentScoreYIELD electStudentScoreSixYIELD(SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
|
|
||||||
|
SysStudentScoreYIELD electStudentScoreComputerYIELD(SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
|
|
||||||
|
SysStudentScoreYIELD selectStudentScoreSchool(SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
|
|
||||||
|
SysStudentScoreYIELD selectStudentScoreEmployment(SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
|
|
||||||
|
SysStudentScoreYIELD selectStudentScoreComputerKaoGong(SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,52 @@
|
|||||||
<select id="selectStudentScoreList" resultType="com.yxt.demo.system.api.sys_student_score.SysStudentScore">
|
<select id="selectStudentScoreList" resultType="com.yxt.demo.system.api.sys_student_score.SysStudentScore">
|
||||||
select * from sys_student_score
|
select * from sys_student_score
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="electStudentScoreYIELD" resultType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD" parameterType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD">
|
||||||
|
select i.calss,count(*) count,s.type name,count(*)/(select count(*) from sys_info where calss = #{calss} and infoId not like 'js%')*100 YIELD
|
||||||
|
from (select type,score from sys_score where type = #{name}) s
|
||||||
|
inner join sys_student_score ss on ss.fourScore >= s.score
|
||||||
|
inner join sys_info i on i.infoId = ss.studentNo
|
||||||
|
group by i.calss
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="electStudentScoreSixYIELD" resultType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD" parameterType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD">
|
||||||
|
select i.calss,count(*) count,s.type name,count(*)/(select count(*) from sys_info where calss = #{calss} and infoId not like 'js%')*100 YIELD
|
||||||
|
from (select type,score from sys_score where type = #{name}) s
|
||||||
|
inner join sys_student_score ss on ss.sixScore >= s.score
|
||||||
|
inner join sys_info i on i.infoId = ss.studentNo
|
||||||
|
group by i.calss
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="electStudentScoreComputerYIELD" resultType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD" parameterType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD">
|
||||||
|
select i.calss,count(*) count,s.type name,count(*)/(select count(*) from sys_info where calss = #{calss} and infoId not like 'js%')*100 YIELD
|
||||||
|
from (select type,score from sys_score where type = #{name}) s
|
||||||
|
inner join sys_student_score ss on ss.computerScore >= s.score
|
||||||
|
inner join sys_info i on i.infoId = ss.studentNo
|
||||||
|
group by i.calss
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStudentScoreSchool" resultType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD" parameterType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD">
|
||||||
|
select i.calss,count(*) count,count(*)/(select count(*) from sys_info where calss = '8班' and infoId not like 'js%')*100 YIELD
|
||||||
|
from sys_student_score s
|
||||||
|
inner join sys_info i on i.infoId = s.studentNo
|
||||||
|
where s.enterSchool = '1'
|
||||||
|
group by i.calss
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStudentScoreEmployment" resultType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD" parameterType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD">
|
||||||
|
select i.calss,count(*) count,count(*)/(select count(*) from sys_info where calss = '8班' and infoId not like 'js%')*100 YIELD
|
||||||
|
from sys_student_score s
|
||||||
|
inner join sys_info i on i.infoId = s.studentNo
|
||||||
|
where s.employment = '1'
|
||||||
|
group by i.calss
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStudentScoreComputerKaoGong" resultType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD" parameterType="com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD">
|
||||||
|
select i.calss,count(*) count,count(*)/(select count(*) from sys_info where calss = '8班' and infoId not like 'js%')*100 YIELD
|
||||||
|
from sys_student_score s
|
||||||
|
inner join sys_info i on i.infoId = s.studentNo
|
||||||
|
where s.kaoGong = '1'
|
||||||
|
group by i.calss
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -2,6 +2,7 @@ package com.yxt.demo.system.biz.sys_student_score;
|
|||||||
|
|
||||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
||||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScoreFeign;
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScoreFeign;
|
||||||
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD;
|
||||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -47,4 +48,14 @@ public class SysStudentScoreRest implements SysStudentScoreFeign {
|
|||||||
public ResultBean selectStudentScore() {
|
public ResultBean selectStudentScore() {
|
||||||
return sysStudentScoreService.selectStudentScore();
|
return sysStudentScoreService.selectStudentScore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean selectStudentScoreYIELD(SysStudentScoreYIELD sysStudentScoreYIELD) {
|
||||||
|
return sysStudentScoreService.selectStudentScoreYIELD(sysStudentScoreYIELD);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean selectStudentRate(SysStudentScoreYIELD sysStudentScoreYIELD) {
|
||||||
|
return sysStudentScoreService.selectStudentRate(sysStudentScoreYIELD);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.yxt.demo.system.biz.sys_student_score;
|
package com.yxt.demo.system.biz.sys_student_score;
|
||||||
|
|
||||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
||||||
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD;
|
||||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
@@ -42,4 +43,59 @@ public class SysStudentScoreService extends MybatisBaseService<SysStudentScoreM
|
|||||||
List<SysStudentScore> sysStudentScores = sysStudentScoreMapper.selectStudentScoreList();
|
List<SysStudentScore> sysStudentScores = sysStudentScoreMapper.selectStudentScoreList();
|
||||||
return rb.success().setData(sysStudentScores);
|
return rb.success().setData(sysStudentScores);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultBean selectStudentScoreYIELD(SysStudentScoreYIELD sysStudentScoreYIELD) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
String name = sysStudentScoreYIELD.getName();
|
||||||
|
SysStudentScoreYIELD ssy = null;
|
||||||
|
if (name.equals("四级")){
|
||||||
|
ssy = baseMapper.electStudentScoreYIELD(sysStudentScoreYIELD);
|
||||||
|
}else if (name.equals("六级")){
|
||||||
|
ssy = baseMapper.electStudentScoreSixYIELD(sysStudentScoreYIELD);
|
||||||
|
}else if (name.equals("计算机")){
|
||||||
|
ssy = baseMapper.electStudentScoreComputerYIELD(sysStudentScoreYIELD);
|
||||||
|
}
|
||||||
|
return rb.success().setData(ssy);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean selectStudentRate(SysStudentScoreYIELD sysStudentScoreYIELD) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
String name = sysStudentScoreYIELD.getName();
|
||||||
|
SysStudentScoreYIELD ssy = new SysStudentScoreYIELD();
|
||||||
|
if (name.equals("升学率")){
|
||||||
|
ssy = baseMapper.selectStudentScoreSchool(sysStudentScoreYIELD);
|
||||||
|
if (ssy == null){
|
||||||
|
SysStudentScoreYIELD ssyq = new SysStudentScoreYIELD();
|
||||||
|
ssyq.setName("升学率");
|
||||||
|
ssyq.setCount(0);
|
||||||
|
ssyq.setYIELD("0");
|
||||||
|
return rb.success().setData(ssyq);
|
||||||
|
}else {
|
||||||
|
ssy.setName("升学率");
|
||||||
|
}
|
||||||
|
}else if (name.equals("就业率")){
|
||||||
|
ssy = baseMapper.selectStudentScoreEmployment(sysStudentScoreYIELD);
|
||||||
|
if (ssy == null){
|
||||||
|
SysStudentScoreYIELD ssyq = new SysStudentScoreYIELD();
|
||||||
|
ssyq.setName("就业率");
|
||||||
|
ssyq.setCount(0);
|
||||||
|
ssyq.setYIELD("0");
|
||||||
|
return rb.success().setData(ssyq);
|
||||||
|
}else {
|
||||||
|
ssy.setName("就业率");
|
||||||
|
}
|
||||||
|
}else if (name.equals("考公率")){
|
||||||
|
ssy = baseMapper.selectStudentScoreComputerKaoGong(sysStudentScoreYIELD);
|
||||||
|
if (ssy == null){
|
||||||
|
SysStudentScoreYIELD ssyq = new SysStudentScoreYIELD();
|
||||||
|
ssyq.setName("考公率");
|
||||||
|
ssyq.setCount(0);
|
||||||
|
ssyq.setYIELD("0");
|
||||||
|
return rb.success().setData(ssyq);
|
||||||
|
}else {
|
||||||
|
ssy.setName("考公率");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rb.success().setData(ssy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.yxt.demo.system.biz.sys_user;
|
package com.yxt.demo.system.biz.sys_user;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -23,4 +24,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
|||||||
void updateUserById(SysUser sysUser);
|
void updateUserById(SysUser sysUser);
|
||||||
|
|
||||||
SysUser selectUser(@Param("sid") String sid);
|
SysUser selectUser(@Param("sid") String sid);
|
||||||
|
|
||||||
|
SysInfo selectInfoByInfoId(@Param("infoId") String infoId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,4 +40,8 @@
|
|||||||
<select id="selectUser" resultType="com.yxt.demo.system.api.sys_user.SysUser">
|
<select id="selectUser" resultType="com.yxt.demo.system.api.sys_user.SysUser">
|
||||||
select * from sys_user where sid = #{sid}
|
select * from sys_user where sid = #{sid}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectInfoByInfoId" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
||||||
|
select * from sys_info where infoId = #{infoId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -44,9 +44,7 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
|||||||
//查看该账号是否已激活
|
//查看该账号是否已激活
|
||||||
SysUser sysUser = baseMapper.selectByNo(userName);
|
SysUser sysUser = baseMapper.selectByNo(userName);
|
||||||
if (sysUser != null) {
|
if (sysUser != null) {
|
||||||
if (sysUser.getHasActivated() == 1) {
|
return rb.setMsg("该账号已注册");
|
||||||
return rb.setMsg("该账号已注册");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sysUser = new SysUser();
|
sysUser = new SysUser();
|
||||||
BeanUtil.copyProperties(dto, sysUser);
|
BeanUtil.copyProperties(dto, sysUser);
|
||||||
@@ -59,9 +57,7 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
|||||||
}else {
|
}else {
|
||||||
SysUser sysUser = baseMapper.selectByNo(userName);
|
SysUser sysUser = baseMapper.selectByNo(userName);
|
||||||
if (sysUser != null) {
|
if (sysUser != null) {
|
||||||
if (sysUser.getHasActivated() == 1) {
|
return rb.setMsg("该学号已注册");
|
||||||
return rb.setMsg("该账号已注册");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sysUser = new SysUser();
|
sysUser = new SysUser();
|
||||||
BeanUtil.copyProperties(dto, sysUser);
|
BeanUtil.copyProperties(dto, sysUser);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.yxt.demo.system.jdbc.service;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.yxt.demo.common.core.query.PagerQuery;
|
import com.yxt.demo.common.core.query.PagerQuery;
|
||||||
|
import com.yxt.demo.common.core.query.PagerQuery01;
|
||||||
import com.yxt.demo.common.core.vo.PagerVo;
|
import com.yxt.demo.common.core.vo.PagerVo;
|
||||||
import com.yxt.demo.common.core.vo.Vo;
|
import com.yxt.demo.common.core.vo.Vo;
|
||||||
|
|
||||||
@@ -29,6 +30,12 @@ public abstract class PagerUtil {
|
|||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <T> IPage<T> queryToPage(PagerQuery01 pq) {
|
||||||
|
IPage<T> page = new Page<>();
|
||||||
|
page.setSize(pq.getSize()).setCurrent(pq.getCurrent());
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
public static <V, T> PagerVo<V> pageToVo(IPage pr, PagerVo<V> pv) {
|
public static <V, T> PagerVo<V> pageToVo(IPage pr, PagerVo<V> pv) {
|
||||||
if (pv == null) {
|
if (pv == null) {
|
||||||
pv = new PagerVo<V>();
|
pv = new PagerVo<V>();
|
||||||
|
|||||||
Reference in New Issue
Block a user