From ae4358a5a6420bc86c07a1c923ccba1b6e24b244 Mon Sep 17 00:00:00 2001 From: lwy Date: Fri, 5 May 2023 18:35:52 +0800 Subject: [PATCH] add file --- .../read_statistics/dao/DeptMapper.java | 20 ++++++++ .../read_statistics/dao/DeptMapper.xml | 12 +++++ .../read_statistics/dao/IntegralMapper.java | 18 ++++++++ .../read_statistics/dao/IntegralMapper.xml | 40 ++++++++++++++++ .../liangwy/read_statistics/dao/KsMapper.java | 17 +++++++ .../liangwy/read_statistics/dao/KsMapper.xml | 13 ++++++ .../read_statistics/dao/ScanMapper.java | 17 +++++++ .../read_statistics/dao/ScanMapper.xml | 14 ++++++ .../read_statistics/dao/UserMapper.java | 23 ++++++++++ .../read_statistics/dao/UserMapper.xml | 18 ++++++++ .../liangwy/read_statistics/dao/WbMapper.java | 17 +++++++ .../liangwy/read_statistics/dao/WbMapper.xml | 14 ++++++ .../liangwy/read_statistics/pojo/Dept.java | 11 +++++ .../read_statistics/pojo/Integral.java | 46 +++++++++++++++++++ .../top/liangwy/read_statistics/pojo/Ks.java | 23 ++++++++++ .../pojo/Result/ResultMsg.java | 20 ++++++++ .../read_statistics/pojo/Result/UserScan.java | 13 ++++++ .../pojo/Result/UserScore.java | 17 +++++++ .../liangwy/read_statistics/pojo/Scan.java | 23 ++++++++++ .../liangwy/read_statistics/pojo/User.java | 32 +++++++++++++ .../top/liangwy/read_statistics/pojo/Wb.java | 20 ++++++++ .../read_statistics/utils/MybatisUtils.java | 32 +++++++++++++ 22 files changed, 460 insertions(+) create mode 100644 src/main/java/top/liangwy/read_statistics/dao/DeptMapper.java create mode 100644 src/main/java/top/liangwy/read_statistics/dao/DeptMapper.xml create mode 100644 src/main/java/top/liangwy/read_statistics/dao/IntegralMapper.java create mode 100644 src/main/java/top/liangwy/read_statistics/dao/IntegralMapper.xml create mode 100644 src/main/java/top/liangwy/read_statistics/dao/KsMapper.java create mode 100644 src/main/java/top/liangwy/read_statistics/dao/KsMapper.xml create mode 100644 src/main/java/top/liangwy/read_statistics/dao/ScanMapper.java create mode 100644 src/main/java/top/liangwy/read_statistics/dao/ScanMapper.xml create mode 100644 src/main/java/top/liangwy/read_statistics/dao/UserMapper.java create mode 100644 src/main/java/top/liangwy/read_statistics/dao/UserMapper.xml create mode 100644 src/main/java/top/liangwy/read_statistics/dao/WbMapper.java create mode 100644 src/main/java/top/liangwy/read_statistics/dao/WbMapper.xml create mode 100644 src/main/java/top/liangwy/read_statistics/pojo/Dept.java create mode 100644 src/main/java/top/liangwy/read_statistics/pojo/Integral.java create mode 100644 src/main/java/top/liangwy/read_statistics/pojo/Ks.java create mode 100644 src/main/java/top/liangwy/read_statistics/pojo/Result/ResultMsg.java create mode 100644 src/main/java/top/liangwy/read_statistics/pojo/Result/UserScan.java create mode 100644 src/main/java/top/liangwy/read_statistics/pojo/Result/UserScore.java create mode 100644 src/main/java/top/liangwy/read_statistics/pojo/Scan.java create mode 100644 src/main/java/top/liangwy/read_statistics/pojo/User.java create mode 100644 src/main/java/top/liangwy/read_statistics/pojo/Wb.java create mode 100644 src/main/java/top/liangwy/read_statistics/utils/MybatisUtils.java diff --git a/src/main/java/top/liangwy/read_statistics/dao/DeptMapper.java b/src/main/java/top/liangwy/read_statistics/dao/DeptMapper.java new file mode 100644 index 0000000..b055f98 --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/DeptMapper.java @@ -0,0 +1,20 @@ +package top.liangwy.read_statistics.dao; + +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; +import top.liangwy.read_statistics.pojo.Dept; + +import java.util.List; + +/** + * @author lwy + */ +@Mapper +@Repository +public interface DeptMapper { + + String getDeptName(Integer deptId); + + List getAllDeptName(); + +} diff --git a/src/main/java/top/liangwy/read_statistics/dao/DeptMapper.xml b/src/main/java/top/liangwy/read_statistics/dao/DeptMapper.xml new file mode 100644 index 0000000..2686e14 --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/DeptMapper.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/top/liangwy/read_statistics/dao/IntegralMapper.java b/src/main/java/top/liangwy/read_statistics/dao/IntegralMapper.java new file mode 100644 index 0000000..0c9f159 --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/IntegralMapper.java @@ -0,0 +1,18 @@ +package top.liangwy.read_statistics.dao; + +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; +import top.liangwy.read_statistics.pojo.Integral; + +/** + * @author lwy + */ +@Mapper +@Repository +public interface IntegralMapper { + Integral getTodayIntegral(Integer id); + Integral getYesterdayIntegral(Integer id); + Boolean addUserInteralNum(Integral integral); + Boolean userInteralNumAdd30(Integral integral); + Integral getYesterdayYesterdayIntegral(Integer id); +} diff --git a/src/main/java/top/liangwy/read_statistics/dao/IntegralMapper.xml b/src/main/java/top/liangwy/read_statistics/dao/IntegralMapper.xml new file mode 100644 index 0000000..098142e --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/IntegralMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + insert into integral (userId, integralNum, really) + values (#{userId}, #{integralNum}, 0) + + + + insert into integral (userId, integralNum, really) + values (#{userId}, #{integralNum}, #{really}) + + \ No newline at end of file diff --git a/src/main/java/top/liangwy/read_statistics/dao/KsMapper.java b/src/main/java/top/liangwy/read_statistics/dao/KsMapper.java new file mode 100644 index 0000000..1bf3e1e --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/KsMapper.java @@ -0,0 +1,17 @@ +package top.liangwy.read_statistics.dao; + +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +/** + * @author lwy + */ +@Mapper +@Repository +public interface KsMapper { + + String getUserKsList(); + + int setUserKsList(String userKsList); + +} diff --git a/src/main/java/top/liangwy/read_statistics/dao/KsMapper.xml b/src/main/java/top/liangwy/read_statistics/dao/KsMapper.xml new file mode 100644 index 0000000..d100bad --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/KsMapper.xml @@ -0,0 +1,13 @@ + + + + + + insert into ks (userKsList) values (#{userKsList}) + + + \ No newline at end of file diff --git a/src/main/java/top/liangwy/read_statistics/dao/ScanMapper.java b/src/main/java/top/liangwy/read_statistics/dao/ScanMapper.java new file mode 100644 index 0000000..9ca680b --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/ScanMapper.java @@ -0,0 +1,17 @@ +package top.liangwy.read_statistics.dao; + +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +/** + * @author lwy + */ +@Mapper +@Repository +public interface ScanMapper { + + String getUserScanList(); + + int setUserScanList(String userScanList); + +} diff --git a/src/main/java/top/liangwy/read_statistics/dao/ScanMapper.xml b/src/main/java/top/liangwy/read_statistics/dao/ScanMapper.xml new file mode 100644 index 0000000..357546b --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/ScanMapper.xml @@ -0,0 +1,14 @@ + + + + + + insert into scan (userScanList) values (#{userScanList}) + + + \ No newline at end of file diff --git a/src/main/java/top/liangwy/read_statistics/dao/UserMapper.java b/src/main/java/top/liangwy/read_statistics/dao/UserMapper.java new file mode 100644 index 0000000..d9a61db --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/UserMapper.java @@ -0,0 +1,23 @@ +package top.liangwy.read_statistics.dao; + +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; +import top.liangwy.read_statistics.pojo.User; +import java.util.List; + +/** + * @author lwy + */ +@Mapper +@Repository +public interface UserMapper { + List getUserList(); + + String getUserIdByTelephone(String telephone); + + List getUserTelephoneByDeptName(String deptName); + + List getUserByDeptId(Integer deptId); + + List getUserTelphone(); +} diff --git a/src/main/java/top/liangwy/read_statistics/dao/UserMapper.xml b/src/main/java/top/liangwy/read_statistics/dao/UserMapper.xml new file mode 100644 index 0000000..e045c6c --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/UserMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/java/top/liangwy/read_statistics/dao/WbMapper.java b/src/main/java/top/liangwy/read_statistics/dao/WbMapper.java new file mode 100644 index 0000000..31c0319 --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/WbMapper.java @@ -0,0 +1,17 @@ +package top.liangwy.read_statistics.dao; + +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +/** + * @author lwy + */ +@Mapper +@Repository +public interface WbMapper { + + String getWbUserScanList(); + + int setWbUserScanList(String wbUserScanList); + +} diff --git a/src/main/java/top/liangwy/read_statistics/dao/WbMapper.xml b/src/main/java/top/liangwy/read_statistics/dao/WbMapper.xml new file mode 100644 index 0000000..7ffa359 --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/dao/WbMapper.xml @@ -0,0 +1,14 @@ + + + + + + insert into wb (wbUserScanList) values (#{wbUserScanList}) + + + \ No newline at end of file diff --git a/src/main/java/top/liangwy/read_statistics/pojo/Dept.java b/src/main/java/top/liangwy/read_statistics/pojo/Dept.java new file mode 100644 index 0000000..87bda92 --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/pojo/Dept.java @@ -0,0 +1,11 @@ +package top.liangwy.read_statistics.pojo; + +import lombok.Data; + +@Data +public class Dept { + private Integer deptId; + private String deptName; + private Integer deleted; + private Integer order; +} diff --git a/src/main/java/top/liangwy/read_statistics/pojo/Integral.java b/src/main/java/top/liangwy/read_statistics/pojo/Integral.java new file mode 100644 index 0000000..e461fad --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/pojo/Integral.java @@ -0,0 +1,46 @@ +package top.liangwy.read_statistics.pojo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +@Data +public class Integral { + + /** + * 积分表id + */ + private Integer integralId; + + /** + * 用户id + */ + private Integer userId; + + /** + * 用户积分 + */ + private Integer integralNum; + + /** + * 积分是否真实 + */ + private Integer really; + + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date createTime; + + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date updateTime; + +} diff --git a/src/main/java/top/liangwy/read_statistics/pojo/Ks.java b/src/main/java/top/liangwy/read_statistics/pojo/Ks.java new file mode 100644 index 0000000..76bb36e --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/pojo/Ks.java @@ -0,0 +1,23 @@ +package top.liangwy.read_statistics.pojo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author lwy + */ +@Data +public class Ks { + private Integer id; + private String userKsList; + + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date createTime; +} diff --git a/src/main/java/top/liangwy/read_statistics/pojo/Result/ResultMsg.java b/src/main/java/top/liangwy/read_statistics/pojo/Result/ResultMsg.java new file mode 100644 index 0000000..dc71ec2 --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/pojo/Result/ResultMsg.java @@ -0,0 +1,20 @@ +package top.liangwy.read_statistics.pojo.Result; + +import lombok.Data; + +@Data +public class ResultMsg { + //错误信息 + private String msg; + //状态 + private String status; + //返回数据,不需要的时候为null即可 + private Object data; + + public ResultMsg(String msg, String status, Object data) { + this.msg = msg; + this.status = status; + this.data = data; + } + +} diff --git a/src/main/java/top/liangwy/read_statistics/pojo/Result/UserScan.java b/src/main/java/top/liangwy/read_statistics/pojo/Result/UserScan.java new file mode 100644 index 0000000..851e2cd --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/pojo/Result/UserScan.java @@ -0,0 +1,13 @@ +package top.liangwy.read_statistics.pojo.Result; + +import lombok.Data; + +/** + * @author lwy + */ +@Data +public class UserScan { + private String userName; + private String ksNickName; + private String scanStatus; +} diff --git a/src/main/java/top/liangwy/read_statistics/pojo/Result/UserScore.java b/src/main/java/top/liangwy/read_statistics/pojo/Result/UserScore.java new file mode 100644 index 0000000..e95c66b --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/pojo/Result/UserScore.java @@ -0,0 +1,17 @@ +package top.liangwy.read_statistics.pojo.Result; + +import lombok.Data; + +/** + * @author lwy + */ + +@Data +public class UserScore { + private Integer userId; + private String userName; + private Integer todayScore; + private Integer yesterdayScore; +// private Integer addScore; + +} diff --git a/src/main/java/top/liangwy/read_statistics/pojo/Scan.java b/src/main/java/top/liangwy/read_statistics/pojo/Scan.java new file mode 100644 index 0000000..ddef8bc --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/pojo/Scan.java @@ -0,0 +1,23 @@ +package top.liangwy.read_statistics.pojo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author lwy + */ +@Data +public class Scan { + private Integer id; + private String userScanList; + + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss", + timezone = "GMT+8" + ) + private Date createTime; +} diff --git a/src/main/java/top/liangwy/read_statistics/pojo/User.java b/src/main/java/top/liangwy/read_statistics/pojo/User.java new file mode 100644 index 0000000..798ad07 --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/pojo/User.java @@ -0,0 +1,32 @@ +package top.liangwy.read_statistics.pojo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author lwy + */ +@Data +public class User { + private Integer userId; + private String userName; + private Integer deptId; + private String telephone; + private String ksNickName; + private String wbNickName; + private Integer deleted; + private Integer order; + + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updateTime; + +} \ No newline at end of file diff --git a/src/main/java/top/liangwy/read_statistics/pojo/Wb.java b/src/main/java/top/liangwy/read_statistics/pojo/Wb.java new file mode 100644 index 0000000..bbce2e1 --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/pojo/Wb.java @@ -0,0 +1,20 @@ +package top.liangwy.read_statistics.pojo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author lwy + */ +@Data +public class Wb { + private Integer id; + private String wbUserScanList; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; +} diff --git a/src/main/java/top/liangwy/read_statistics/utils/MybatisUtils.java b/src/main/java/top/liangwy/read_statistics/utils/MybatisUtils.java new file mode 100644 index 0000000..4a849e4 --- /dev/null +++ b/src/main/java/top/liangwy/read_statistics/utils/MybatisUtils.java @@ -0,0 +1,32 @@ +package top.liangwy.read_statistics.utils; + +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; +import org.apache.ibatis.session.SqlSessionFactoryBuilder; + +import java.io.IOException; +import java.io.InputStream; + +/** + * @author lwy + */ +public class MybatisUtils { + + private static SqlSessionFactory sqlSessionFactory; + + static { + try { + String resource = "mybatis-config.xml"; + InputStream inputStream = Resources.getResourceAsStream(resource); + sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); + } catch (IOException e) { + e.printStackTrace(); + } + + } + + public static SqlSession getSqlSession() { + return sqlSessionFactory.openSession(); + } +}