diff --git a/pom.xml b/pom.xml index a904345..9a07a60 100644 --- a/pom.xml +++ b/pom.xml @@ -286,7 +286,7 @@ com.alibaba easyexcel - 3.2.1 + 4.0.1 @@ -309,6 +309,8 @@ + + org.apache.poi poi @@ -354,6 +356,13 @@ 4.9.3 + + + org.lionsoul + ip2region + 2.6.5 + + diff --git a/src/main/java/com/sztzjy/trade/controller/tch/TchLoginLogAndStuListController.java b/src/main/java/com/sztzjy/trade/controller/tch/TchLoginLogAndStuListController.java new file mode 100644 index 0000000..73cebcf --- /dev/null +++ b/src/main/java/com/sztzjy/trade/controller/tch/TchLoginLogAndStuListController.java @@ -0,0 +1,140 @@ +package com.sztzjy.trade.controller.tch; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.sztzjy.trade.annotation.AnonymousAccess; +import com.sztzjy.trade.entity.dto.LoginLogDTO; +import com.sztzjy.trade.entity.dto.RestPassWordDTO; +import com.sztzjy.trade.service.TchLoginLogAndStuListService; +import com.sztzjy.trade.util.ResultEntity; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.util.Date; + +/** + * @author 17803 + * @date 2024-08-06 10:46 + */ + +@RequestMapping("api/tch/loginLogAndStuList") +@RestController +@Api(tags = "教学管理(登录日志和学生列表)") +public class TchLoginLogAndStuListController { + + @Autowired + private TchLoginLogAndStuListService tchLoginLogAndStuListService; + + + //登录和登出调用,数据更新操作,从新计算登录时长,累计登录时长,累计登录天数,是否在线 + + @ApiOperation("登录/退出统计") + @PostMapping("/loginLog") + @AnonymousAccess + public ResultEntity loginLog(@RequestBody LoginLogDTO loginLogDTO, HttpServletRequest request) { + //"yyyy-MM-dd HH:mm:ss" + + return tchLoginLogAndStuListService.loginLog(loginLogDTO, request); + + } + + + @ApiOperation("查询登录日志") + @GetMapping("/loginLogBySchoolId") + @AnonymousAccess + public ResultEntity loginLogBySchoolId(@ApiParam("学校ID") String schoolId + , @ApiParam("当前页") Integer page, + @ApiParam("每页展示条数") Integer size) { + //"yyyy-MM-dd HH:mm:ss" + + return tchLoginLogAndStuListService.loginLogBySchoolId(schoolId, page, size); + + } + + + @ApiOperation("班级下拉框") + @GetMapping("/getClassList") + @AnonymousAccess + public ResultEntity getClassList(@ApiParam("学校ID") String schoolId) { + //"yyyy-MM-dd HH:mm:ss" + + return tchLoginLogAndStuListService.getClassList(schoolId); + + } + + + @ApiOperation("登录日志条件查询") + @GetMapping("/queryCondition ") + @AnonymousAccess + public ResultEntity queryCondition(@ApiParam("用户名") @RequestParam(required = false) String name, + @ApiParam("所属班级ID") @RequestParam(required = false) String classID, + @ApiParam("开始时间") @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime, + @ApiParam("结束时间") @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime, + @ApiParam("当前页") Integer page, + @ApiParam("每页展示条数") Integer size, + @ApiParam("学校ID") String schoolId) { + //"yyyy-MM-dd HH:mm:ss" + + return tchLoginLogAndStuListService.queryCondition(name, classID, startTime, endTime, page, size, schoolId); + + } + + + @ApiOperation("日志导出") + @GetMapping("/exportExcel") + @AnonymousAccess + public void exportExcel( + @ApiParam("开始时间") @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime, + @ApiParam("结束时间") @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime, + @ApiParam("学校ID") String schoolId, HttpServletResponse response) { + //"yyyy-MM-dd HH:mm:ss" + + tchLoginLogAndStuListService.exportExcel(startTime, endTime, schoolId, response); + + } + + + + @ApiOperation("学生列表") + @GetMapping("/getStuListInfo") + @AnonymousAccess + public ResultEntity getStuListInfo(@ApiParam("学校ID") String schoolId, + @ApiParam("当前页") Integer page, + @ApiParam("每页展示条数") Integer size) { + //"yyyy-MM-dd HH:mm:ss" + + return tchLoginLogAndStuListService.getStuListInfo(schoolId, page, size); + + } + + + + @ApiOperation("学生列表删除用户") + @PostMapping("/delStuInfo") + @AnonymousAccess + public ResultEntity delStuInfo(String userId) { + //"yyyy-MM-dd HH:mm:ss" + + return tchLoginLogAndStuListService.delStuInfo(userId); + + } + + @ApiOperation("学生列表重置密码") + @PostMapping("/restPwd") + @AnonymousAccess + public ResultEntity restPwd(@RequestBody @Valid RestPassWordDTO restPassWord) { + //"yyyy-MM-dd HH:mm:ss" + + return tchLoginLogAndStuListService.restPwd(restPassWord); + + } + + +} diff --git a/src/main/java/com/sztzjy/trade/entity/StuUser.java b/src/main/java/com/sztzjy/trade/entity/StuUser.java index f23591f..6636585 100644 --- a/src/main/java/com/sztzjy/trade/entity/StuUser.java +++ b/src/main/java/com/sztzjy/trade/entity/StuUser.java @@ -1,6 +1,7 @@ package com.sztzjy.trade.entity; import java.math.BigDecimal; +import java.util.Date; import io.swagger.annotations.ApiModelProperty; /** @@ -99,6 +100,15 @@ public class StuUser { @ApiModelProperty("综合得分(学校)(乘完权重后)") private BigDecimal totalScore; + @ApiModelProperty("创建时间") + private Date createTime; + + @ApiModelProperty("0:未删除 1:已删除") + private Integer delState; + + @ApiModelProperty("更新时间") + private Date updateTime; + public String getUserId() { return userId; } @@ -338,4 +348,28 @@ public class StuUser { public void setTotalScore(BigDecimal totalScore) { this.totalScore = totalScore; } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Integer getDelState() { + return delState; + } + + public void setDelState(Integer delState) { + this.delState = delState; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/trade/entity/StuUserExample.java b/src/main/java/com/sztzjy/trade/entity/StuUserExample.java index 3948fd7..534a704 100644 --- a/src/main/java/com/sztzjy/trade/entity/StuUserExample.java +++ b/src/main/java/com/sztzjy/trade/entity/StuUserExample.java @@ -2,6 +2,7 @@ package com.sztzjy.trade.entity; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Date; import java.util.List; public class StuUserExample { @@ -1994,6 +1995,186 @@ public class StuUserExample { addCriterion("total_score not between", value1, value2, "totalScore"); return (Criteria) this; } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andDelStateIsNull() { + addCriterion("del_state is null"); + return (Criteria) this; + } + + public Criteria andDelStateIsNotNull() { + addCriterion("del_state is not null"); + return (Criteria) this; + } + + public Criteria andDelStateEqualTo(Integer value) { + addCriterion("del_state =", value, "delState"); + return (Criteria) this; + } + + public Criteria andDelStateNotEqualTo(Integer value) { + addCriterion("del_state <>", value, "delState"); + return (Criteria) this; + } + + public Criteria andDelStateGreaterThan(Integer value) { + addCriterion("del_state >", value, "delState"); + return (Criteria) this; + } + + public Criteria andDelStateGreaterThanOrEqualTo(Integer value) { + addCriterion("del_state >=", value, "delState"); + return (Criteria) this; + } + + public Criteria andDelStateLessThan(Integer value) { + addCriterion("del_state <", value, "delState"); + return (Criteria) this; + } + + public Criteria andDelStateLessThanOrEqualTo(Integer value) { + addCriterion("del_state <=", value, "delState"); + return (Criteria) this; + } + + public Criteria andDelStateIn(List values) { + addCriterion("del_state in", values, "delState"); + return (Criteria) this; + } + + public Criteria andDelStateNotIn(List values) { + addCriterion("del_state not in", values, "delState"); + return (Criteria) this; + } + + public Criteria andDelStateBetween(Integer value1, Integer value2) { + addCriterion("del_state between", value1, value2, "delState"); + return (Criteria) this; + } + + public Criteria andDelStateNotBetween(Integer value1, Integer value2) { + addCriterion("del_state not between", value1, value2, "delState"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/src/main/java/com/sztzjy/trade/entity/TchLoginLog.java b/src/main/java/com/sztzjy/trade/entity/TchLoginLog.java new file mode 100644 index 0000000..6a0ea41 --- /dev/null +++ b/src/main/java/com/sztzjy/trade/entity/TchLoginLog.java @@ -0,0 +1,174 @@ +package com.sztzjy.trade.entity; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * + * @author whb + * tch_login_log + */ +@Builder +public class TchLoginLog { + @ApiModelProperty("id") + private Integer id; + + @ApiModelProperty("学号") + private String studentId; + + @ApiModelProperty("姓名") + private String name; + + @ApiModelProperty("登入时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private Date loginTimeLast; + + @ApiModelProperty("登出时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private Date exitTimeLast; + + @ApiModelProperty("登录时长") + private Long loginDuration; + + @ApiModelProperty("是否在线(0:离线,1:在线)") + private Byte online; + + @ApiModelProperty("登录IP") + private String loginIp; + + @ApiModelProperty("IP归属地") + private String ipOwnerLocation; + + @ApiModelProperty("累计登录时长") + private Long totalLoginDuration; + + @ApiModelProperty("累计登录天数") + private Integer totalLoginDays; + + @ApiModelProperty("班级ID") + private String classId; + + @ApiModelProperty("用户ID") + private String userId; + + @ApiModelProperty("学校ID") + private String schoolId; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getStudentId() { + return studentId; + } + + public void setStudentId(String studentId) { + this.studentId = studentId == null ? null : studentId.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Date getLoginTimeLast() { + return loginTimeLast; + } + + public void setLoginTimeLast(Date loginTimeLast) { + this.loginTimeLast = loginTimeLast; + } + + public Date getExitTimeLast() { + return exitTimeLast; + } + + public void setExitTimeLast(Date exitTimeLast) { + this.exitTimeLast = exitTimeLast; + } + + public Long getLoginDuration() { + return loginDuration; + } + + public void setLoginDuration(Long loginDuration) { + this.loginDuration = loginDuration; + } + + public Byte getOnline() { + return online; + } + + public void setOnline(Byte online) { + this.online = online; + } + + public String getLoginIp() { + return loginIp; + } + + public void setLoginIp(String loginIp) { + this.loginIp = loginIp == null ? null : loginIp.trim(); + } + + public String getIpOwnerLocation() { + return ipOwnerLocation; + } + + public void setIpOwnerLocation(String ipOwnerLocation) { + this.ipOwnerLocation = ipOwnerLocation == null ? null : ipOwnerLocation.trim(); + } + + public Long getTotalLoginDuration() { + return totalLoginDuration; + } + + public void setTotalLoginDuration(Long totalLoginDuration) { + this.totalLoginDuration = totalLoginDuration; + } + + public Integer getTotalLoginDays() { + return totalLoginDays; + } + + public void setTotalLoginDays(Integer totalLoginDays) { + this.totalLoginDays = totalLoginDays; + } + + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId == null ? null : classId.trim(); + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId == null ? null : userId.trim(); + } + + public String getSchoolId() { + return schoolId; + } + + public void setSchoolId(String schoolId) { + this.schoolId = schoolId == null ? null : schoolId.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/trade/entity/TchLoginLogExample.java b/src/main/java/com/sztzjy/trade/entity/TchLoginLogExample.java new file mode 100644 index 0000000..5e72fdc --- /dev/null +++ b/src/main/java/com/sztzjy/trade/entity/TchLoginLogExample.java @@ -0,0 +1,1110 @@ +package com.sztzjy.trade.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class TchLoginLogExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public TchLoginLogExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andStudentIdIsNull() { + addCriterion("student_id is null"); + return (Criteria) this; + } + + public Criteria andStudentIdIsNotNull() { + addCriterion("student_id is not null"); + return (Criteria) this; + } + + public Criteria andStudentIdEqualTo(String value) { + addCriterion("student_id =", value, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdNotEqualTo(String value) { + addCriterion("student_id <>", value, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdGreaterThan(String value) { + addCriterion("student_id >", value, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdGreaterThanOrEqualTo(String value) { + addCriterion("student_id >=", value, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdLessThan(String value) { + addCriterion("student_id <", value, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdLessThanOrEqualTo(String value) { + addCriterion("student_id <=", value, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdLike(String value) { + addCriterion("student_id like", value, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdNotLike(String value) { + addCriterion("student_id not like", value, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdIn(List values) { + addCriterion("student_id in", values, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdNotIn(List values) { + addCriterion("student_id not in", values, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdBetween(String value1, String value2) { + addCriterion("student_id between", value1, value2, "studentId"); + return (Criteria) this; + } + + public Criteria andStudentIdNotBetween(String value1, String value2) { + addCriterion("student_id not between", value1, value2, "studentId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastIsNull() { + addCriterion("login_time_last is null"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastIsNotNull() { + addCriterion("login_time_last is not null"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastEqualTo(Date value) { + addCriterion("login_time_last =", value, "loginTimeLast"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastNotEqualTo(Date value) { + addCriterion("login_time_last <>", value, "loginTimeLast"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastGreaterThan(Date value) { + addCriterion("login_time_last >", value, "loginTimeLast"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastGreaterThanOrEqualTo(Date value) { + addCriterion("login_time_last >=", value, "loginTimeLast"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastLessThan(Date value) { + addCriterion("login_time_last <", value, "loginTimeLast"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastLessThanOrEqualTo(Date value) { + addCriterion("login_time_last <=", value, "loginTimeLast"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastIn(List values) { + addCriterion("login_time_last in", values, "loginTimeLast"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastNotIn(List values) { + addCriterion("login_time_last not in", values, "loginTimeLast"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastBetween(Date value1, Date value2) { + addCriterion("login_time_last between", value1, value2, "loginTimeLast"); + return (Criteria) this; + } + + public Criteria andLoginTimeLastNotBetween(Date value1, Date value2) { + addCriterion("login_time_last not between", value1, value2, "loginTimeLast"); + return (Criteria) this; + } + + public Criteria andExitTimeLastIsNull() { + addCriterion("exit_time_last is null"); + return (Criteria) this; + } + + public Criteria andExitTimeLastIsNotNull() { + addCriterion("exit_time_last is not null"); + return (Criteria) this; + } + + public Criteria andExitTimeLastEqualTo(Date value) { + addCriterion("exit_time_last =", value, "exitTimeLast"); + return (Criteria) this; + } + + public Criteria andExitTimeLastNotEqualTo(Date value) { + addCriterion("exit_time_last <>", value, "exitTimeLast"); + return (Criteria) this; + } + + public Criteria andExitTimeLastGreaterThan(Date value) { + addCriterion("exit_time_last >", value, "exitTimeLast"); + return (Criteria) this; + } + + public Criteria andExitTimeLastGreaterThanOrEqualTo(Date value) { + addCriterion("exit_time_last >=", value, "exitTimeLast"); + return (Criteria) this; + } + + public Criteria andExitTimeLastLessThan(Date value) { + addCriterion("exit_time_last <", value, "exitTimeLast"); + return (Criteria) this; + } + + public Criteria andExitTimeLastLessThanOrEqualTo(Date value) { + addCriterion("exit_time_last <=", value, "exitTimeLast"); + return (Criteria) this; + } + + public Criteria andExitTimeLastIn(List values) { + addCriterion("exit_time_last in", values, "exitTimeLast"); + return (Criteria) this; + } + + public Criteria andExitTimeLastNotIn(List values) { + addCriterion("exit_time_last not in", values, "exitTimeLast"); + return (Criteria) this; + } + + public Criteria andExitTimeLastBetween(Date value1, Date value2) { + addCriterion("exit_time_last between", value1, value2, "exitTimeLast"); + return (Criteria) this; + } + + public Criteria andExitTimeLastNotBetween(Date value1, Date value2) { + addCriterion("exit_time_last not between", value1, value2, "exitTimeLast"); + return (Criteria) this; + } + + public Criteria andLoginDurationIsNull() { + addCriterion("login_duration is null"); + return (Criteria) this; + } + + public Criteria andLoginDurationIsNotNull() { + addCriterion("login_duration is not null"); + return (Criteria) this; + } + + public Criteria andLoginDurationEqualTo(Long value) { + addCriterion("login_duration =", value, "loginDuration"); + return (Criteria) this; + } + + public Criteria andLoginDurationNotEqualTo(Long value) { + addCriterion("login_duration <>", value, "loginDuration"); + return (Criteria) this; + } + + public Criteria andLoginDurationGreaterThan(Long value) { + addCriterion("login_duration >", value, "loginDuration"); + return (Criteria) this; + } + + public Criteria andLoginDurationGreaterThanOrEqualTo(Long value) { + addCriterion("login_duration >=", value, "loginDuration"); + return (Criteria) this; + } + + public Criteria andLoginDurationLessThan(Long value) { + addCriterion("login_duration <", value, "loginDuration"); + return (Criteria) this; + } + + public Criteria andLoginDurationLessThanOrEqualTo(Long value) { + addCriterion("login_duration <=", value, "loginDuration"); + return (Criteria) this; + } + + public Criteria andLoginDurationIn(List values) { + addCriterion("login_duration in", values, "loginDuration"); + return (Criteria) this; + } + + public Criteria andLoginDurationNotIn(List values) { + addCriterion("login_duration not in", values, "loginDuration"); + return (Criteria) this; + } + + public Criteria andLoginDurationBetween(Long value1, Long value2) { + addCriterion("login_duration between", value1, value2, "loginDuration"); + return (Criteria) this; + } + + public Criteria andLoginDurationNotBetween(Long value1, Long value2) { + addCriterion("login_duration not between", value1, value2, "loginDuration"); + return (Criteria) this; + } + + public Criteria andOnlineIsNull() { + addCriterion("online is null"); + return (Criteria) this; + } + + public Criteria andOnlineIsNotNull() { + addCriterion("online is not null"); + return (Criteria) this; + } + + public Criteria andOnlineEqualTo(Byte value) { + addCriterion("online =", value, "online"); + return (Criteria) this; + } + + public Criteria andOnlineNotEqualTo(Byte value) { + addCriterion("online <>", value, "online"); + return (Criteria) this; + } + + public Criteria andOnlineGreaterThan(Byte value) { + addCriterion("online >", value, "online"); + return (Criteria) this; + } + + public Criteria andOnlineGreaterThanOrEqualTo(Byte value) { + addCriterion("online >=", value, "online"); + return (Criteria) this; + } + + public Criteria andOnlineLessThan(Byte value) { + addCriterion("online <", value, "online"); + return (Criteria) this; + } + + public Criteria andOnlineLessThanOrEqualTo(Byte value) { + addCriterion("online <=", value, "online"); + return (Criteria) this; + } + + public Criteria andOnlineIn(List values) { + addCriterion("online in", values, "online"); + return (Criteria) this; + } + + public Criteria andOnlineNotIn(List values) { + addCriterion("online not in", values, "online"); + return (Criteria) this; + } + + public Criteria andOnlineBetween(Byte value1, Byte value2) { + addCriterion("online between", value1, value2, "online"); + return (Criteria) this; + } + + public Criteria andOnlineNotBetween(Byte value1, Byte value2) { + addCriterion("online not between", value1, value2, "online"); + return (Criteria) this; + } + + public Criteria andLoginIpIsNull() { + addCriterion("login_ip is null"); + return (Criteria) this; + } + + public Criteria andLoginIpIsNotNull() { + addCriterion("login_ip is not null"); + return (Criteria) this; + } + + public Criteria andLoginIpEqualTo(String value) { + addCriterion("login_ip =", value, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpNotEqualTo(String value) { + addCriterion("login_ip <>", value, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpGreaterThan(String value) { + addCriterion("login_ip >", value, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpGreaterThanOrEqualTo(String value) { + addCriterion("login_ip >=", value, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpLessThan(String value) { + addCriterion("login_ip <", value, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpLessThanOrEqualTo(String value) { + addCriterion("login_ip <=", value, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpLike(String value) { + addCriterion("login_ip like", value, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpNotLike(String value) { + addCriterion("login_ip not like", value, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpIn(List values) { + addCriterion("login_ip in", values, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpNotIn(List values) { + addCriterion("login_ip not in", values, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpBetween(String value1, String value2) { + addCriterion("login_ip between", value1, value2, "loginIp"); + return (Criteria) this; + } + + public Criteria andLoginIpNotBetween(String value1, String value2) { + addCriterion("login_ip not between", value1, value2, "loginIp"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationIsNull() { + addCriterion("ip_owner_location is null"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationIsNotNull() { + addCriterion("ip_owner_location is not null"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationEqualTo(String value) { + addCriterion("ip_owner_location =", value, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationNotEqualTo(String value) { + addCriterion("ip_owner_location <>", value, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationGreaterThan(String value) { + addCriterion("ip_owner_location >", value, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationGreaterThanOrEqualTo(String value) { + addCriterion("ip_owner_location >=", value, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationLessThan(String value) { + addCriterion("ip_owner_location <", value, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationLessThanOrEqualTo(String value) { + addCriterion("ip_owner_location <=", value, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationLike(String value) { + addCriterion("ip_owner_location like", value, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationNotLike(String value) { + addCriterion("ip_owner_location not like", value, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationIn(List values) { + addCriterion("ip_owner_location in", values, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationNotIn(List values) { + addCriterion("ip_owner_location not in", values, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationBetween(String value1, String value2) { + addCriterion("ip_owner_location between", value1, value2, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andIpOwnerLocationNotBetween(String value1, String value2) { + addCriterion("ip_owner_location not between", value1, value2, "ipOwnerLocation"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationIsNull() { + addCriterion("total_login_duration is null"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationIsNotNull() { + addCriterion("total_login_duration is not null"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationEqualTo(Long value) { + addCriterion("total_login_duration =", value, "totalLoginDuration"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationNotEqualTo(Long value) { + addCriterion("total_login_duration <>", value, "totalLoginDuration"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationGreaterThan(Long value) { + addCriterion("total_login_duration >", value, "totalLoginDuration"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationGreaterThanOrEqualTo(Long value) { + addCriterion("total_login_duration >=", value, "totalLoginDuration"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationLessThan(Long value) { + addCriterion("total_login_duration <", value, "totalLoginDuration"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationLessThanOrEqualTo(Long value) { + addCriterion("total_login_duration <=", value, "totalLoginDuration"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationIn(List values) { + addCriterion("total_login_duration in", values, "totalLoginDuration"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationNotIn(List values) { + addCriterion("total_login_duration not in", values, "totalLoginDuration"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationBetween(Long value1, Long value2) { + addCriterion("total_login_duration between", value1, value2, "totalLoginDuration"); + return (Criteria) this; + } + + public Criteria andTotalLoginDurationNotBetween(Long value1, Long value2) { + addCriterion("total_login_duration not between", value1, value2, "totalLoginDuration"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysIsNull() { + addCriterion("total_login_days is null"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysIsNotNull() { + addCriterion("total_login_days is not null"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysEqualTo(Integer value) { + addCriterion("total_login_days =", value, "totalLoginDays"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysNotEqualTo(Integer value) { + addCriterion("total_login_days <>", value, "totalLoginDays"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysGreaterThan(Integer value) { + addCriterion("total_login_days >", value, "totalLoginDays"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysGreaterThanOrEqualTo(Integer value) { + addCriterion("total_login_days >=", value, "totalLoginDays"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysLessThan(Integer value) { + addCriterion("total_login_days <", value, "totalLoginDays"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysLessThanOrEqualTo(Integer value) { + addCriterion("total_login_days <=", value, "totalLoginDays"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysIn(List values) { + addCriterion("total_login_days in", values, "totalLoginDays"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysNotIn(List values) { + addCriterion("total_login_days not in", values, "totalLoginDays"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysBetween(Integer value1, Integer value2) { + addCriterion("total_login_days between", value1, value2, "totalLoginDays"); + return (Criteria) this; + } + + public Criteria andTotalLoginDaysNotBetween(Integer value1, Integer value2) { + addCriterion("total_login_days not between", value1, value2, "totalLoginDays"); + return (Criteria) this; + } + + public Criteria andClassIdIsNull() { + addCriterion("class_id is null"); + return (Criteria) this; + } + + public Criteria andClassIdIsNotNull() { + addCriterion("class_id is not null"); + return (Criteria) this; + } + + public Criteria andClassIdEqualTo(String value) { + addCriterion("class_id =", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdNotEqualTo(String value) { + addCriterion("class_id <>", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdGreaterThan(String value) { + addCriterion("class_id >", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdGreaterThanOrEqualTo(String value) { + addCriterion("class_id >=", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdLessThan(String value) { + addCriterion("class_id <", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdLessThanOrEqualTo(String value) { + addCriterion("class_id <=", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdLike(String value) { + addCriterion("class_id like", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdNotLike(String value) { + addCriterion("class_id not like", value, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdIn(List values) { + addCriterion("class_id in", values, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdNotIn(List values) { + addCriterion("class_id not in", values, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdBetween(String value1, String value2) { + addCriterion("class_id between", value1, value2, "classId"); + return (Criteria) this; + } + + public Criteria andClassIdNotBetween(String value1, String value2) { + addCriterion("class_id not between", value1, value2, "classId"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(String value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(String value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(String value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(String value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(String value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(String value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLike(String value) { + addCriterion("user_id like", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotLike(String value) { + addCriterion("user_id not like", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(String value1, String value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(String value1, String value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andSchoolIdIsNull() { + addCriterion("school_id is null"); + return (Criteria) this; + } + + public Criteria andSchoolIdIsNotNull() { + addCriterion("school_id is not null"); + return (Criteria) this; + } + + public Criteria andSchoolIdEqualTo(String value) { + addCriterion("school_id =", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotEqualTo(String value) { + addCriterion("school_id <>", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdGreaterThan(String value) { + addCriterion("school_id >", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdGreaterThanOrEqualTo(String value) { + addCriterion("school_id >=", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLessThan(String value) { + addCriterion("school_id <", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLessThanOrEqualTo(String value) { + addCriterion("school_id <=", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdLike(String value) { + addCriterion("school_id like", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotLike(String value) { + addCriterion("school_id not like", value, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdIn(List values) { + addCriterion("school_id in", values, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotIn(List values) { + addCriterion("school_id not in", values, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdBetween(String value1, String value2) { + addCriterion("school_id between", value1, value2, "schoolId"); + return (Criteria) this; + } + + public Criteria andSchoolIdNotBetween(String value1, String value2) { + addCriterion("school_id not between", value1, value2, "schoolId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/trade/entity/dto/LoginLogDTO.java b/src/main/java/com/sztzjy/trade/entity/dto/LoginLogDTO.java new file mode 100644 index 0000000..ed01780 --- /dev/null +++ b/src/main/java/com/sztzjy/trade/entity/dto/LoginLogDTO.java @@ -0,0 +1,43 @@ +package com.sztzjy.trade.entity.dto;/** + * @author 17803 + * @date 2024-08-06 11:05 + */ + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +@Data +public class LoginLogDTO { + + @ApiModelProperty("登入时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + Date loginTimeLast; + + + @ApiModelProperty("登出时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + Date exitTimeLast; + + @ApiModelProperty("学校ID") + private String schoolId; + + @ApiModelProperty("用户ID") + private String userId; + + @ApiModelProperty("班级ID") + private String classId; + + @ApiModelProperty("学号") + private String studentId; + + @ApiModelProperty("姓名") + private String name; + + +} diff --git a/src/main/java/com/sztzjy/trade/entity/dto/RestPassWordDTO.java b/src/main/java/com/sztzjy/trade/entity/dto/RestPassWordDTO.java new file mode 100644 index 0000000..02f2dc1 --- /dev/null +++ b/src/main/java/com/sztzjy/trade/entity/dto/RestPassWordDTO.java @@ -0,0 +1,31 @@ +package com.sztzjy.trade.entity.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author 17803 + * @date 2024-08-06 16:08 + */ + +@Data +@ApiModel(description="重置密码参数") +public class RestPassWordDTO { + + + @ApiModelProperty("用户ID") + @NotNull + private String userId; + @ApiModelProperty("第一次输入密码") + @NotNull + private String passwordOne; + @ApiModelProperty("第二次输入密码") + @NotNull + private String passwordTwo; + + + +} diff --git a/src/main/java/com/sztzjy/trade/mapper/StuUserMapper.java b/src/main/java/com/sztzjy/trade/mapper/StuUserMapper.java index f5fec8f..92db6c5 100644 --- a/src/main/java/com/sztzjy/trade/mapper/StuUserMapper.java +++ b/src/main/java/com/sztzjy/trade/mapper/StuUserMapper.java @@ -3,10 +3,11 @@ package com.sztzjy.trade.mapper; import com.sztzjy.trade.entity.StuUser; import com.sztzjy.trade.entity.StuUserExample; import java.util.List; +import java.util.Map; -import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -@Mapper +import org.apache.ibatis.annotations.Select; + public interface StuUserMapper { long countByExample(StuUserExample example); @@ -57,4 +58,11 @@ public interface StuUserMapper { * @return 学生信息 */ List selectStuList(@Param("lists") List lists, String schoolId); + + @Select("SELECT class_name, class_id\n" + + "FROM stu_user\n" + + "WHERE school_id = #{schoolId}\n" + + " AND class_name IS NOT NULL\n" + + "GROUP BY class_name, class_id") + List> getClassList(String schoolId); } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/trade/mapper/TchLoginLogMapper.java b/src/main/java/com/sztzjy/trade/mapper/TchLoginLogMapper.java new file mode 100644 index 0000000..6bcb374 --- /dev/null +++ b/src/main/java/com/sztzjy/trade/mapper/TchLoginLogMapper.java @@ -0,0 +1,30 @@ +package com.sztzjy.trade.mapper; + +import com.sztzjy.trade.entity.TchLoginLog; +import com.sztzjy.trade.entity.TchLoginLogExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface TchLoginLogMapper { + long countByExample(TchLoginLogExample example); + + int deleteByExample(TchLoginLogExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(TchLoginLog record); + + int insertSelective(TchLoginLog record); + + List selectByExample(TchLoginLogExample example); + + TchLoginLog selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") TchLoginLog record, @Param("example") TchLoginLogExample example); + + int updateByExample(@Param("record") TchLoginLog record, @Param("example") TchLoginLogExample example); + + int updateByPrimaryKeySelective(TchLoginLog record); + + int updateByPrimaryKey(TchLoginLog record); +} \ No newline at end of file diff --git a/src/main/java/com/sztzjy/trade/service/TchLoginLogAndStuListService.java b/src/main/java/com/sztzjy/trade/service/TchLoginLogAndStuListService.java new file mode 100644 index 0000000..4b09657 --- /dev/null +++ b/src/main/java/com/sztzjy/trade/service/TchLoginLogAndStuListService.java @@ -0,0 +1,84 @@ +package com.sztzjy.trade.service; + +import com.sztzjy.trade.entity.dto.LoginLogDTO; +import com.sztzjy.trade.entity.dto.RestPassWordDTO; +import com.sztzjy.trade.util.ResultEntity; +import org.apache.ibatis.annotations.Param; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Date; + +/** + * @author 17803 + * @date 2024-08-06 11:03 + */ + + +public interface TchLoginLogAndStuListService { + + //登录/退出统计 + ResultEntity loginLog(LoginLogDTO loginLogDTO, HttpServletRequest request); + + /** + * 查询登录日志 + * @param schoolId + * @return + */ + ResultEntity loginLogBySchoolId(@Param("schoolId") String schoolId,Integer page,Integer size); + + /** + * 班级下拉框 + * @param schoolId + * @return + */ + + ResultEntity getClassList(String schoolId); + + /** + * 登录日志条件查询 + * @param name + * @param classID + * @param startTime + * @param endTime + * @return + */ + + ResultEntity queryCondition(@Param("name") String name, @Param("classID") String classID, @Param("startTime") Date startTime, @Param("endTime") Date endTime,Integer page,Integer size,String schoolId); + + /** + * 日志导出 + * @param startTime + * @param endTime + * @param schoolId + * @return + */ + + void exportExcel(Date startTime, Date endTime, String schoolId, HttpServletResponse response); + + /** + * 学生列表查询 + * @param schoolId + * @param page + * @param size + * @return + */ + + ResultEntity getStuListInfo(String schoolId, Integer page, Integer size); + + /** + * 学生列表删除 + * @param userId + * @return + */ + + ResultEntity delStuInfo(@Param("userId") String userId); + + /** + * 学生列表重置密码 + * @param restPassWord + * @return + */ + + ResultEntity restPwd(RestPassWordDTO restPassWord); +} diff --git a/src/main/java/com/sztzjy/trade/service/impl/TchLoginLogAndStuListServiceImpl.java b/src/main/java/com/sztzjy/trade/service/impl/TchLoginLogAndStuListServiceImpl.java new file mode 100644 index 0000000..1607b1f --- /dev/null +++ b/src/main/java/com/sztzjy/trade/service/impl/TchLoginLogAndStuListServiceImpl.java @@ -0,0 +1,424 @@ +package com.sztzjy.trade.service.impl;/** + * @author 17803 + * @date 2024-08-06 11:03 + */ + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.IdUtil; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.sztzjy.trade.entity.StuUser; +import com.sztzjy.trade.entity.StuUserExample; +import com.sztzjy.trade.entity.TchLoginLog; +import com.sztzjy.trade.entity.TchLoginLogExample; +import com.sztzjy.trade.entity.dto.LoginLogDTO; +import com.sztzjy.trade.entity.dto.RestPassWordDTO; +import com.sztzjy.trade.mapper.StuUserMapper; +import com.sztzjy.trade.mapper.TchLoginLogMapper; +import com.sztzjy.trade.service.TchLoginLogAndStuListService; +import com.sztzjy.trade.util.ResultEntity; +import com.sztzjy.trade.util.excel.FilePortUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ClassPathResource; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.lionsoul.ip2region.xdb.Searcher; + +@Service +@Slf4j +public class TchLoginLogAndStuListServiceImpl implements TchLoginLogAndStuListService { + + @Autowired + private TchLoginLogMapper tchLoginLogMapper; + + private Searcher searcher; + + @Autowired + private StuUserMapper stuUserMapper; + + /** + * 登录/退出统计 + * + * @param loginLogDTO + * @return + */ + + @Override + public ResultEntity loginLog(LoginLogDTO loginLogDTO, HttpServletRequest request) { + + if (loginLogDTO == null) { + return new ResultEntity<>(HttpStatus.BAD_REQUEST, "空传参!"); + } + + // todo 登录IP IP归属地 + String ip = request.getRemoteAddr(); + String ipAddress = ""; + if (StringUtils.isNotBlank(ip)) { + + String ipHomePlace = getIpAddress(ip); + if (ipHomePlace != null) { + ipAddress = ipHomePlace; + } + } + + + //登录时间不为空 + if (loginLogDTO.getLoginTimeLast() != null) { + //loginTimeLast 都不为 null 的情况 + + TchLoginLogExample example = new TchLoginLogExample(); + example.createCriteria().andUserIdEqualTo(loginLogDTO.getUserId()).andSchoolIdEqualTo(loginLogDTO.getSchoolId()); + List tchLoginLogList = tchLoginLogMapper.selectByExample(example); + + if (tchLoginLogList.isEmpty()) { //首次登录 + + TchLoginLog tchLoginLog = TchLoginLog.builder() + .studentId(loginLogDTO.getStudentId()) + .name(loginLogDTO.getName()) + .loginTimeLast(loginLogDTO.getLoginTimeLast()) + .online((byte) 1) + .loginIp(ip) + .ipOwnerLocation(ipAddress) + .totalLoginDuration(0L) + .totalLoginDays(1) + .classId(loginLogDTO.getClassId()) + .userId(loginLogDTO.getUserId()) + .schoolId(loginLogDTO.getSchoolId()) + .build(); + tchLoginLogMapper.insertSelective(tchLoginLog); + + return new ResultEntity<>(HttpStatus.OK, "success"); + + + } else { + //多次登录 + TchLoginLog tchLoginLogOld = tchLoginLogList.get(0); + + //累计登录天数 和登录时间判断时间是否为同一天,不相同就是登录+1 + //最近一次登录 + LocalDateTime localDateTime = Convert.toLocalDateTime(tchLoginLogOld.getLoginTimeLast()); + //这一次登录 + LocalDateTime newlocalDateTime = Convert.toLocalDateTime(loginLogDTO.getLoginTimeLast()); + + //判断是否为同一天 + if (!localDateTime.equals(newlocalDateTime)) { + tchLoginLogOld.setTotalLoginDays(tchLoginLogOld.getTotalLoginDays() + 1); + } + + tchLoginLogOld.setLoginTimeLast(loginLogDTO.getLoginTimeLast()); + //在线状态 + tchLoginLogOld.setOnline((byte) 1); + tchLoginLogOld.setLoginIp(ip); + tchLoginLogOld.setIpOwnerLocation(ipAddress); + + + tchLoginLogMapper.updateByPrimaryKey(tchLoginLogOld); + return new ResultEntity<>(HttpStatus.OK, "success"); + } + } + + //退出时间不为空 + if (loginLogDTO.getExitTimeLast() != null) { + + TchLoginLogExample example = new TchLoginLogExample(); + example.createCriteria().andUserIdEqualTo(loginLogDTO.getUserId()).andSchoolIdEqualTo(loginLogDTO.getSchoolId()); + List tchLoginLogList = tchLoginLogMapper.selectByExample(example); + + if (tchLoginLogList.isEmpty()) { //首次登录 + return new ResultEntity(HttpStatus.BAD_REQUEST, "请重新登录!"); + + } else { + + TchLoginLog tchLoginLog = tchLoginLogList.get(0); + tchLoginLog.setExitTimeLast(loginLogDTO.getExitTimeLast()); + //根据登录时间计算在线时长 + Date loginTimeLast = tchLoginLog.getLoginTimeLast(); + //登录时间 + long loginTime = loginTimeLast.getTime(); + + Date exitTimeLast = loginLogDTO.getExitTimeLast(); + //退出时长 + long exitTime = exitTimeLast.getTime(); + + //在线时长 转换为秒 + long timeInMinutes = (exitTime - loginTime) / 1000; + + //在线时长 + tchLoginLog.setLoginDuration(timeInMinutes); + + //累计登录时长 + tchLoginLog.setTotalLoginDuration(tchLoginLog.getTotalLoginDuration() + timeInMinutes); + + tchLoginLog.setLoginIp(ip); + tchLoginLog.setIpOwnerLocation(ipAddress); + tchLoginLog.setOnline((byte) 0); + + tchLoginLogMapper.updateByPrimaryKeySelective(tchLoginLog); + + return new ResultEntity<>(HttpStatus.OK, "success"); + + } + + + } + + return new ResultEntity(HttpStatus.BAD_REQUEST, "请重新登录!"); + } + + //分页查询登录日志 + @Override + public ResultEntity loginLogBySchoolId(String schoolId, Integer page, Integer size) { + PageHelper.startPage(page, size); + TchLoginLogExample example = new TchLoginLogExample(); + example.createCriteria().andSchoolIdEqualTo(schoolId); + List tchLoginLogList = tchLoginLogMapper.selectByExample(example); + if (!tchLoginLogList.isEmpty()) { + PageInfo tchLoginLogPageInfo = new PageInfo<>(tchLoginLogList); + return new ResultEntity<>(HttpStatus.OK, tchLoginLogPageInfo); + } else { + return new ResultEntity<>(HttpStatus.OK); + } + + } + + /** + * 班级下拉框 + * + * @param schoolId + * @return + */ + + @Override + public ResultEntity getClassList(String schoolId) { + + + // @Select("select DISTINCT class_name form stu_user where school_id=#{schoolId} AND class_name IS not NULL") + // List getClassList(String schoolId); + List nameList = stuUserMapper.getClassList(schoolId); + + return new ResultEntity<>(HttpStatus.OK, nameList); + } + + /** + * 登录日志条件查询 + * + * @param name + * @param classID + * @param startTime + * @param endTime + * @return + */ + + @Override + public ResultEntity queryCondition(String name, String classID, Date startTime, Date endTime, Integer page, Integer size, String schoolId) { + PageHelper.startPage(page, size); + TchLoginLogExample example = new TchLoginLogExample(); + TchLoginLogExample.Criteria criteria = example.createCriteria(); + if (name != null) { + criteria.andNameLike("%" + name + "%"); + } + if (classID != null) { + criteria.andClassIdEqualTo("%" + classID + "%"); + } + + if (startTime != null && endTime != null) { + + criteria.andLoginTimeLastBetween(startTime, endTime); + } + + criteria.andSchoolIdEqualTo(schoolId); + + List tchLoginLogList = tchLoginLogMapper.selectByExample(example); + if (tchLoginLogList.isEmpty()) { + return new ResultEntity<>(HttpStatus.OK); + } else { + + PageInfo pageInfo = new PageInfo<>(tchLoginLogList); + return new ResultEntity<>(HttpStatus.OK, pageInfo); + + } + + } + + /** + * 日志导出 + * @param startTime + * @param endTime + * @param schoolId + * @return + */ + + @Override + public void exportExcel(Date startTime, Date endTime, String schoolId, HttpServletResponse response) { + TchLoginLogExample example = new TchLoginLogExample(); + TchLoginLogExample.Criteria criteria = example.createCriteria(); + if (startTime != null && endTime != null) { + + criteria.andLoginTimeLastBetween(startTime, endTime); + } + criteria.andSchoolIdEqualTo(schoolId); + + List tchLoginLogList = tchLoginLogMapper.selectByExample(example); + if (tchLoginLogList.isEmpty()) { + //导出的表名 + String title = IdUtil.simpleUUID(); + //表中第一行表头字段 + String[] headers = {"学号", "姓名", "登入时间","登出时间","登录时长","是否在线(0:离线,1:在线)","登录IP","IP归属地","累计登录时长","累计登录天数"}; + + try { + FilePortUtil.exportExcel(response, title, headers, null, null); + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //导出的表名 + String title = IdUtil.simpleUUID(); + //表中第一行表头字段 + String[] headers = {"学号", "姓名", "登入时间","登出时间","登录时长","是否在线(0:离线,1:在线)","登录IP","IP归属地","累计登录时长","累计登录天数"}; + + + //具体需要写入excel需要哪些字段,这些字段取自UserReward类,也就是上面的实际数据结果集的泛型 + List listColumn = Arrays.asList("studentId", "name", "loginTimeLast", + "exitTimeLast","loginDuration", + "online","loginIp", + "ipOwnerLocation","totalLoginDuration", + "totalLoginDays"); + try { + FilePortUtil.exportExcel(response, title, headers, tchLoginLogList, listColumn); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + + } + + /** + * 学生列表查询 + * @param schoolId + * @param page + * @param size + * @return + */ + + @Override + public ResultEntity getStuListInfo(String schoolId, Integer page, Integer size) { + PageHelper.startPage(page,size); + + StuUserExample stuUserExample = new StuUserExample(); + stuUserExample.createCriteria().andSchoolIdEqualTo(schoolId).andDelStateEqualTo(0); + List stuUserList = stuUserMapper.selectByExample(stuUserExample); + if (stuUserList.isEmpty()) + { + return new ResultEntity(HttpStatus.OK); + }else { + + PageInfo stuUserPageInfo = new PageInfo<>(stuUserList); + return new ResultEntity<>(HttpStatus.OK,stuUserPageInfo); + + } + + + + } + + /** + * 学生列表删除 + * @param userId + * @return + */ + + @Override + public ResultEntity delStuInfo(String userId) { + + StuUserExample stuUserExample = new StuUserExample(); + stuUserExample.createCriteria().andUserIdEqualTo(userId); + List stuUserList = stuUserMapper.selectByExample(stuUserExample); + if (stuUserList.isEmpty()) + { + return new ResultEntity(HttpStatus.BAD_REQUEST,"用户不存在"); + }else { + + stuUserList.get(0).setDelState(1); + stuUserMapper.updateByPrimaryKeySelective(stuUserList.get(0)); + return new ResultEntity<>(HttpStatus.OK,"删除成功!"); + + } + } + + /** + * 学生列表重置密码 + * @param restPassWord + * @return + */ + + @Override + public ResultEntity restPwd(RestPassWordDTO restPassWord) { + + if (!restPassWord.getPasswordOne().equals(restPassWord.getPasswordTwo())) + { + return new ResultEntity<>(HttpStatus.BAD_REQUEST,"两次输入密码不一致!"); + } + + + StuUserExample stuUserExample = new StuUserExample(); + stuUserExample.createCriteria().andUserIdEqualTo(restPassWord.getUserId()); + List stuUserList = stuUserMapper.selectByExample(stuUserExample); + if (stuUserList.isEmpty()) + { + return new ResultEntity(HttpStatus.BAD_REQUEST,"用户不存在"); + }else { + + stuUserList.get(0).setPassword(restPassWord.getPasswordOne()); + stuUserMapper.updateByPrimaryKeySelective(stuUserList.get(0)); + return new ResultEntity<>(HttpStatus.OK,"密码重置成功!"); + + } + + } + + + public String getIpAddress(String ip) { + if ("127.0.0.1".equals(ip) || ip.startsWith("192.168")) { + return "局域网 ip"; + } + if (searcher == null) { + try { + searcher = Searcher.newWithBuffer(IOUtils.toByteArray(new ClassPathResource("ip2region.xdb").getInputStream())); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + String region = null; + String errorMessage = null; + try { + region = searcher.search(ip); + } catch (Exception e) { + errorMessage = e.getMessage(); + if (errorMessage != null && errorMessage.length() > 256) { + errorMessage = errorMessage.substring(0, 256); + } + e.printStackTrace(); + } + // 输出 region + log.info("归属地为:{}", region); + return region; + } +} diff --git a/src/main/resources/ip2region.xdb b/src/main/resources/ip2region.xdb new file mode 100644 index 0000000..c78b792 Binary files /dev/null and b/src/main/resources/ip2region.xdb differ diff --git a/src/main/resources/mappers/StuUserMapper.xml b/src/main/resources/mappers/StuUserMapper.xml index 2192583..43eb49a 100644 --- a/src/main/resources/mappers/StuUserMapper.xml +++ b/src/main/resources/mappers/StuUserMapper.xml @@ -32,6 +32,9 @@ + + + @@ -97,7 +100,8 @@ consensus_layer_socre, exciting_layer_socre, contract_layer_socre, concept_score, concept_rank, technology_socre, technology_rank, digital_currency_score, digital_currency_rank, invoice_score, supply_chain_finance_score, traceability_and_anti_counterfeiting_score, - ticket_results_score, cross_border_payment_results_score, total_rank, total_score + ticket_results_score, cross_border_payment_results_score, total_rank, total_score, + create_time, del_state, update_time @@ -348,7 +372,7 @@ - + update stu_user @@ -441,6 +465,15 @@ total_score = #{record.totalScore,jdbcType=DECIMAL}, + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + del_state = #{record.delState,jdbcType=INTEGER}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + @@ -477,7 +510,10 @@ ticket_results_score = #{record.ticketResultsScore,jdbcType=DECIMAL}, cross_border_payment_results_score = #{record.crossBorderPaymentResultsScore,jdbcType=DECIMAL}, total_rank = #{record.totalRank,jdbcType=INTEGER}, - total_score = #{record.totalScore,jdbcType=DECIMAL} + total_score = #{record.totalScore,jdbcType=DECIMAL}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + del_state = #{record.delState,jdbcType=INTEGER}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP} @@ -572,6 +608,15 @@ total_score = #{totalScore,jdbcType=DECIMAL}, + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + del_state = #{delState,jdbcType=INTEGER}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + where user_id = #{userId,jdbcType=VARCHAR} @@ -605,10 +650,15 @@ ticket_results_score = #{ticketResultsScore,jdbcType=DECIMAL}, cross_border_payment_results_score = #{crossBorderPaymentResultsScore,jdbcType=DECIMAL}, total_rank = #{totalRank,jdbcType=INTEGER}, - total_score = #{totalScore,jdbcType=DECIMAL} + total_score = #{totalScore,jdbcType=DECIMAL}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + del_state = #{delState,jdbcType=INTEGER}, + update_time = #{updateTime,jdbcType=TIMESTAMP} where user_id = #{userId,jdbcType=VARCHAR} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/TchLoginLogMapper.xml b/src/main/resources/mappers/TchLoginLogMapper.xml new file mode 100644 index 0000000..38435ea --- /dev/null +++ b/src/main/resources/mappers/TchLoginLogMapper.xml @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, student_id, name, login_time_last, exit_time_last, login_duration, online, login_ip, + ip_owner_location, total_login_duration, total_login_days, class_id, user_id, school_id + + + + + delete from tch_login_log + where id = #{id,jdbcType=INTEGER} + + + delete from tch_login_log + + + + + + insert into tch_login_log (id, student_id, name, + login_time_last, exit_time_last, login_duration, + online, login_ip, ip_owner_location, + total_login_duration, total_login_days, class_id, + user_id, school_id) + values (#{id,jdbcType=INTEGER}, #{studentId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{loginTimeLast,jdbcType=TIMESTAMP}, #{exitTimeLast,jdbcType=TIMESTAMP}, #{loginDuration,jdbcType=BIGINT}, + #{online,jdbcType=TINYINT}, #{loginIp,jdbcType=VARCHAR}, #{ipOwnerLocation,jdbcType=VARCHAR}, + #{totalLoginDuration,jdbcType=BIGINT}, #{totalLoginDays,jdbcType=INTEGER}, #{classId,jdbcType=VARCHAR}, + #{userId,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}) + + + insert into tch_login_log + + + id, + + + student_id, + + + name, + + + login_time_last, + + + exit_time_last, + + + login_duration, + + + online, + + + login_ip, + + + ip_owner_location, + + + total_login_duration, + + + total_login_days, + + + class_id, + + + user_id, + + + school_id, + + + + + #{id,jdbcType=INTEGER}, + + + #{studentId,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{loginTimeLast,jdbcType=TIMESTAMP}, + + + #{exitTimeLast,jdbcType=TIMESTAMP}, + + + #{loginDuration,jdbcType=BIGINT}, + + + #{online,jdbcType=TINYINT}, + + + #{loginIp,jdbcType=VARCHAR}, + + + #{ipOwnerLocation,jdbcType=VARCHAR}, + + + #{totalLoginDuration,jdbcType=BIGINT}, + + + #{totalLoginDays,jdbcType=INTEGER}, + + + #{classId,jdbcType=VARCHAR}, + + + #{userId,jdbcType=VARCHAR}, + + + #{schoolId,jdbcType=VARCHAR}, + + + + + + update tch_login_log + + + id = #{record.id,jdbcType=INTEGER}, + + + student_id = #{record.studentId,jdbcType=VARCHAR}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + login_time_last = #{record.loginTimeLast,jdbcType=TIMESTAMP}, + + + exit_time_last = #{record.exitTimeLast,jdbcType=TIMESTAMP}, + + + login_duration = #{record.loginDuration,jdbcType=BIGINT}, + + + online = #{record.online,jdbcType=TINYINT}, + + + login_ip = #{record.loginIp,jdbcType=VARCHAR}, + + + ip_owner_location = #{record.ipOwnerLocation,jdbcType=VARCHAR}, + + + total_login_duration = #{record.totalLoginDuration,jdbcType=BIGINT}, + + + total_login_days = #{record.totalLoginDays,jdbcType=INTEGER}, + + + class_id = #{record.classId,jdbcType=VARCHAR}, + + + user_id = #{record.userId,jdbcType=VARCHAR}, + + + school_id = #{record.schoolId,jdbcType=VARCHAR}, + + + + + + + + update tch_login_log + set id = #{record.id,jdbcType=INTEGER}, + student_id = #{record.studentId,jdbcType=VARCHAR}, + name = #{record.name,jdbcType=VARCHAR}, + login_time_last = #{record.loginTimeLast,jdbcType=TIMESTAMP}, + exit_time_last = #{record.exitTimeLast,jdbcType=TIMESTAMP}, + login_duration = #{record.loginDuration,jdbcType=BIGINT}, + online = #{record.online,jdbcType=TINYINT}, + login_ip = #{record.loginIp,jdbcType=VARCHAR}, + ip_owner_location = #{record.ipOwnerLocation,jdbcType=VARCHAR}, + total_login_duration = #{record.totalLoginDuration,jdbcType=BIGINT}, + total_login_days = #{record.totalLoginDays,jdbcType=INTEGER}, + class_id = #{record.classId,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=VARCHAR}, + school_id = #{record.schoolId,jdbcType=VARCHAR} + + + + + + update tch_login_log + + + student_id = #{studentId,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + login_time_last = #{loginTimeLast,jdbcType=TIMESTAMP}, + + + exit_time_last = #{exitTimeLast,jdbcType=TIMESTAMP}, + + + login_duration = #{loginDuration,jdbcType=BIGINT}, + + + online = #{online,jdbcType=TINYINT}, + + + login_ip = #{loginIp,jdbcType=VARCHAR}, + + + ip_owner_location = #{ipOwnerLocation,jdbcType=VARCHAR}, + + + total_login_duration = #{totalLoginDuration,jdbcType=BIGINT}, + + + total_login_days = #{totalLoginDays,jdbcType=INTEGER}, + + + class_id = #{classId,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=VARCHAR}, + + + school_id = #{schoolId,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tch_login_log + set student_id = #{studentId,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + login_time_last = #{loginTimeLast,jdbcType=TIMESTAMP}, + exit_time_last = #{exitTimeLast,jdbcType=TIMESTAMP}, + login_duration = #{loginDuration,jdbcType=BIGINT}, + online = #{online,jdbcType=TINYINT}, + login_ip = #{loginIp,jdbcType=VARCHAR}, + ip_owner_location = #{ipOwnerLocation,jdbcType=VARCHAR}, + total_login_duration = #{totalLoginDuration,jdbcType=BIGINT}, + total_login_days = #{totalLoginDays,jdbcType=INTEGER}, + class_id = #{classId,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=VARCHAR}, + school_id = #{schoolId,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file