tianyunperfect 3 年 前
コミット
d98762ba62

+ 9 - 0
book-dao/src/main/java/com/book/dao/VO/LoginVO.java

@@ -0,0 +1,9 @@
+package com.book.dao.VO;
+
+import lombok.Data;
+
+@Data
+public class LoginVO {
+    String userName;
+    String password;
+}

+ 310 - 0
book-dao/src/main/java/com/book/dao/cps/entity/Login.java

@@ -0,0 +1,310 @@
+package com.book.dao.cps.entity;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import lombok.Data;
+
+@Data
+public class Login implements Serializable {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column login.id
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column login.user_name
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    private String userName;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column login.password
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    private String password;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public static Login.Builder builder() {
+        return new Login.Builder();
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public static class Builder {
+        /**
+         * This field was generated by MyBatis Generator.
+         * This field corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        private Login obj;
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public Builder() {
+            this.obj = new Login();
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method sets the value of the database column login.id
+         *
+         * @param id the value for login.id
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public Builder id(Integer id) {
+            obj.setId(id);
+            return this;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method sets the value of the database column login.user_name
+         *
+         * @param userName the value for login.user_name
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public Builder userName(String userName) {
+            obj.setUserName(userName);
+            return this;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method sets the value of the database column login.password
+         *
+         * @param password the value for login.password
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public Builder password(String password) {
+            obj.setPassword(password);
+            return this;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public Login build() {
+            return this.obj;
+        }
+    }
+
+    /**
+     * This enum was generated by MyBatis Generator.
+     * This enum corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public enum Column {
+        id("id", "id", "INTEGER", false),
+        userName("user_name", "userName", "VARCHAR", false),
+        password("password", "password", "VARCHAR", false);
+
+        /**
+         * This field was generated by MyBatis Generator.
+         * This field corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        private static final String BEGINNING_DELIMITER = "\"";
+
+        /**
+         * This field was generated by MyBatis Generator.
+         * This field corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        private static final String ENDING_DELIMITER = "\"";
+
+        /**
+         * This field was generated by MyBatis Generator.
+         * This field corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        private final String column;
+
+        /**
+         * This field was generated by MyBatis Generator.
+         * This field corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        private final boolean isColumnNameDelimited;
+
+        /**
+         * This field was generated by MyBatis Generator.
+         * This field corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        private final String javaProperty;
+
+        /**
+         * This field was generated by MyBatis Generator.
+         * This field corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        private final String jdbcType;
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public String value() {
+            return this.column;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public String getValue() {
+            return this.column;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public String getJavaProperty() {
+            return this.javaProperty;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public String getJdbcType() {
+            return this.jdbcType;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
+            this.column = column;
+            this.javaProperty = javaProperty;
+            this.jdbcType = jdbcType;
+            this.isColumnNameDelimited = isColumnNameDelimited;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public String desc() {
+            return this.getEscapedColumnName() + " DESC";
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public String asc() {
+            return this.getEscapedColumnName() + " ASC";
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public static Column[] excludes(Column ... excludes) {
+            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
+            if (excludes != null && excludes.length > 0) {
+                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
+            }
+            return columns.toArray(new Column[]{});
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public static Column[] all() {
+            return Column.values();
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public String getEscapedColumnName() {
+            if (this.isColumnNameDelimited) {
+                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
+            } else {
+                return this.column;
+            }
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public String getAliasedEscapedColumnName() {
+            return this.getEscapedColumnName();
+        }
+    }
+}

+ 164 - 0
book-dao/src/main/java/com/book/dao/cps/mapper/LoginMapper.java

@@ -0,0 +1,164 @@
+package com.book.dao.cps.mapper;
+
+import com.book.dao.cps.entity.Login;
+import com.book.dao.cps.pojo.example.LoginExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface LoginMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    long countByExample(LoginExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int deleteByExample(LoginExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int insert(Login record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int insertSelective(@Param("record") Login record, @Param("selective") Login.Column ... selective);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    Login selectOneByExample(LoginExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    Login selectOneByExampleSelective(@Param("example") LoginExample example, @Param("selective") Login.Column ... selective);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    List<Login> selectByExampleSelective(@Param("example") LoginExample example, @Param("selective") Login.Column ... selective);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    List<Login> selectByExample(LoginExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    Login selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") Login.Column ... selective);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    Login selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int updateByExampleSelective(@Param("record") Login record, @Param("example") LoginExample example, @Param("selective") Login.Column ... selective);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int updateByExample(@Param("record") Login record, @Param("example") LoginExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int updateByPrimaryKeySelective(@Param("record") Login record, @Param("selective") Login.Column ... selective);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int updateByPrimaryKey(Login record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int batchInsert(@Param("list") List<Login> list);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int batchInsertSelective(@Param("list") List<Login> list, @Param("selective") Login.Column ... selective);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int upsert(Login record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    int upsertSelective(@Param("record") Login record, @Param("selective") Login.Column ... selective);
+}

+ 851 - 0
book-dao/src/main/java/com/book/dao/cps/pojo/example/LoginExample.java

@@ -0,0 +1,851 @@
+package com.book.dao.cps.pojo.example;
+
+import com.book.dao.cps.entity.Login;
+import java.util.ArrayList;
+import java.util.List;
+
+public class LoginExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    protected Integer offset;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    protected Integer rows;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public LoginExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public LoginExample orderBy(String orderByClause) {
+        this.setOrderByClause(orderByClause);
+        return this;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public LoginExample orderBy(String ... orderByClauses) {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < orderByClauses.length; i++) {
+            sb.append(orderByClauses[i]);
+            if (i < orderByClauses.length - 1) {
+                sb.append(" , ");
+            }
+        }
+        this.setOrderByClause(sb.toString());
+        return this;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria(this);
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+        rows = null;
+        offset = null;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public void setOffset(Integer offset) {
+        this.offset = offset;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public Integer getOffset() {
+        return this.offset;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public void setRows(Integer rows) {
+        this.rows = rows;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public Integer getRows() {
+        return this.rows;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public LoginExample limit(Integer rows) {
+        this.rows = rows;
+        return this;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public LoginExample limit(Integer offset, Integer rows) {
+        this.offset = offset;
+        this.rows = rows;
+        return this;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public LoginExample page(Integer page, Integer pageSize) {
+        this.offset = page * pageSize;
+        this.rows = pageSize;
+        return this;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public static Criteria newAndCreateCriteria() {
+        LoginExample example = new LoginExample();
+        return example.createCriteria();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public LoginExample when(boolean condition, IExampleWhen then) {
+        if (condition) {
+            then.example(this);
+        }
+        return this;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    public LoginExample when(boolean condition, IExampleWhen then, IExampleWhen otherwise) {
+        if (condition) {
+            then.example(this);
+        } else {
+            otherwise.example(this);
+        }
+        return this;
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> 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 andIdEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Integer value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Integer value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanColumn(Login.Column column) {
+            addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Integer value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanColumn(Login.Column column) {
+            addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Integer> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Integer> 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 andUserNameIsNull() {
+            addCriterion("user_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameIsNotNull() {
+            addCriterion("user_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameEqualTo(String value) {
+            addCriterion("user_name =", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("user_name = ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameNotEqualTo(String value) {
+            addCriterion("user_name <>", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameNotEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("user_name <> ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameGreaterThan(String value) {
+            addCriterion("user_name >", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameGreaterThanColumn(Login.Column column) {
+            addCriterion(new StringBuilder("user_name > ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameGreaterThanOrEqualTo(String value) {
+            addCriterion("user_name >=", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameGreaterThanOrEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("user_name >= ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameLessThan(String value) {
+            addCriterion("user_name <", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameLessThanColumn(Login.Column column) {
+            addCriterion(new StringBuilder("user_name < ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameLessThanOrEqualTo(String value) {
+            addCriterion("user_name <=", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameLessThanOrEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("user_name <= ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameLike(String value) {
+            addCriterion("user_name like", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameNotLike(String value) {
+            addCriterion("user_name not like", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameIn(List<String> values) {
+            addCriterion("user_name in", values, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameNotIn(List<String> values) {
+            addCriterion("user_name not in", values, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameBetween(String value1, String value2) {
+            addCriterion("user_name between", value1, value2, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameNotBetween(String value1, String value2) {
+            addCriterion("user_name not between", value1, value2, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordIsNull() {
+            addCriterion("password is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordIsNotNull() {
+            addCriterion("password is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordEqualTo(String value) {
+            addCriterion("password =", value, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("password = ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordNotEqualTo(String value) {
+            addCriterion("password <>", value, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordNotEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("password <> ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordGreaterThan(String value) {
+            addCriterion("password >", value, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordGreaterThanColumn(Login.Column column) {
+            addCriterion(new StringBuilder("password > ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordGreaterThanOrEqualTo(String value) {
+            addCriterion("password >=", value, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordGreaterThanOrEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("password >= ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordLessThan(String value) {
+            addCriterion("password <", value, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordLessThanColumn(Login.Column column) {
+            addCriterion(new StringBuilder("password < ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordLessThanOrEqualTo(String value) {
+            addCriterion("password <=", value, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordLessThanOrEqualToColumn(Login.Column column) {
+            addCriterion(new StringBuilder("password <= ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordLike(String value) {
+            addCriterion("password like", value, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordNotLike(String value) {
+            addCriterion("password not like", value, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordIn(List<String> values) {
+            addCriterion("password in", values, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordNotIn(List<String> values) {
+            addCriterion("password not in", values, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordBetween(String value1, String value2) {
+            addCriterion("password between", value1, value2, "password");
+            return (Criteria) this;
+        }
+
+        public Criteria andPasswordNotBetween(String value1, String value2) {
+            addCriterion("password not between", value1, value2, "password");
+            return (Criteria) this;
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table login
+     *
+     * @mbg.generated do_not_delete_during_merge Thu Sep 02 23:22:53 CST 2021
+     */
+    public static class Criteria extends GeneratedCriteria {
+        /**
+         * This field was generated by MyBatis Generator.
+         * This field corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        private LoginExample example;
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        protected Criteria(LoginExample example) {
+            super();
+            this.example = example;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public LoginExample example() {
+            return this.example;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        @Deprecated
+        public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
+            if (ifAdd) {
+                add.add(this);
+            }
+            return this;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public Criteria when(boolean condition, ICriteriaWhen then) {
+            if (condition) {
+                then.criteria(this);
+            }
+            return this;
+        }
+
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        public Criteria when(boolean condition, ICriteriaWhen then, ICriteriaWhen otherwise) {
+            if (condition) {
+                then.criteria(this);
+            } else {
+                otherwise.criteria(this);
+            }
+            return this;
+        }
+
+        @Deprecated
+        public interface ICriteriaAdd {
+            /**
+             * This method was generated by MyBatis Generator.
+             * This method corresponds to the database table login
+             *
+             * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+             */
+            Criteria add(Criteria add);
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table login
+     *
+     * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+     */
+    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);
+        }
+    }
+
+    public interface ICriteriaWhen {
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        void criteria(Criteria criteria);
+    }
+
+    public interface IExampleWhen {
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method corresponds to the database table login
+         *
+         * @mbg.generated Thu Sep 02 23:22:53 CST 2021
+         */
+        void example(com.book.dao.cps.pojo.example.LoginExample example);
+    }
+}

+ 532 - 0
book-dao/src/main/resources/mapper/cps/LoginMapper.xml

@@ -0,0 +1,532 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.book.dao.cps.mapper.LoginMapper">
+  <resultMap id="BaseResultMap" type="com.book.dao.cps.entity.Login">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="user_name" jdbcType="VARCHAR" property="userName" />
+    <result column="password" jdbcType="VARCHAR" property="password" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    id, user_name, password
+  </sql>
+  <select id="selectByExample" parameterType="com.book.dao.cps.pojo.example.LoginExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from login
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="rows != null">
+      <if test="offset != null">
+        limit ${offset}, ${rows}
+      </if>
+      <if test="offset == null">
+        limit ${rows}
+      </if>
+    </if>
+  </select>
+  <select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    select
+    <if test="example != null and example.distinct">
+      distinct
+    </if>
+    <choose>
+      <when test="selective != null and selective.length > 0">
+        <foreach collection="selective" item="column" separator=",">
+          ${column.aliasedEscapedColumnName}
+        </foreach>
+      </when>
+      <otherwise>
+        <include refid="Base_Column_List" />
+      </otherwise>
+    </choose>
+    from login
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+    <if test="example != null and example.orderByClause != null">
+      order by ${example.orderByClause}
+    </if>
+    <if test="example != null and example.rows != null">
+      <if test="example.offset != null">
+        limit ${example.offset}, ${example.rows}
+      </if>
+      <if test="example.offset == null">
+        limit ${example.rows}
+      </if>
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from login
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    select
+    <choose>
+      <when test="selective != null and selective.length > 0">
+        <foreach collection="selective" item="column" separator=",">
+          ${column.aliasedEscapedColumnName}
+        </foreach>
+      </when>
+      <otherwise>
+        <include refid="Base_Column_List" />
+      </otherwise>
+    </choose>
+    from login
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    delete from login
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.book.dao.cps.pojo.example.LoginExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    delete from login
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.book.dao.cps.entity.Login">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    insert into login (id, user_name, password
+      )
+    values (#{id,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    insert into login
+    <choose>
+      <when test="selective != null and selective.length > 0">
+        <foreach close=")" collection="selective" item="column" open="(" separator=",">
+          ${column.escapedColumnName}
+        </foreach>
+      </when>
+      <otherwise>
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+          <if test="record.id != null">
+            id,
+          </if>
+          <if test="record.userName != null">
+            user_name,
+          </if>
+          <if test="record.password != null">
+            password,
+          </if>
+        </trim>
+        <trim prefix="(" suffix=")" suffixOverrides="," />
+      </otherwise>
+    </choose>
+    values
+    <choose>
+      <when test="selective != null and selective.length > 0">
+        <foreach close=")" collection="selective" item="column" open="(" separator=",">
+          #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
+        </foreach>
+      </when>
+      <otherwise>
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+          <if test="record.id != null">
+            #{record.id,jdbcType=INTEGER},
+          </if>
+          <if test="record.userName != null">
+            #{record.userName,jdbcType=VARCHAR},
+          </if>
+          <if test="record.password != null">
+            #{record.password,jdbcType=VARCHAR},
+          </if>
+        </trim>
+      </otherwise>
+    </choose>
+  </insert>
+  <select id="countByExample" parameterType="com.book.dao.cps.pojo.example.LoginExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    select count(*) from login
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    update login
+    SET
+    <choose>
+      <when test="selective != null and selective.length > 0">
+        <foreach collection="selective" item="column" separator=",">
+          ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
+        </foreach>
+      </when>
+      <otherwise>
+        <trim suffixOverrides=",">
+          <if test="record.id != null">
+            id = #{record.id,jdbcType=INTEGER},
+          </if>
+          <if test="record.userName != null">
+            user_name = #{record.userName,jdbcType=VARCHAR},
+          </if>
+          <if test="record.password != null">
+            password = #{record.password,jdbcType=VARCHAR},
+          </if>
+        </trim>
+      </otherwise>
+    </choose>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    update login
+    set id = #{record.id,jdbcType=INTEGER},
+      user_name = #{record.userName,jdbcType=VARCHAR},
+      password = #{record.password,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    update login
+    SET
+    <choose>
+      <when test="selective != null and selective.length > 0">
+        <foreach collection="selective" item="column" separator=",">
+          ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
+        </foreach>
+      </when>
+      <otherwise>
+        <trim suffixOverrides=",">
+          <if test="record.userName != null">
+            user_name = #{record.userName,jdbcType=VARCHAR},
+          </if>
+          <if test="record.password != null">
+            password = #{record.password,jdbcType=VARCHAR},
+          </if>
+        </trim>
+      </otherwise>
+    </choose>
+    where id = #{record.id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.book.dao.cps.entity.Login">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    update login
+    set user_name = #{userName,jdbcType=VARCHAR},
+      password = #{password,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <select id="selectOneByExample" parameterType="com.book.dao.cps.pojo.example.LoginExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    select
+    <include refid="Base_Column_List" />
+    from login
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    limit 1
+  </select>
+  <select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    select
+    <choose>
+      <when test="selective != null and selective.length > 0">
+        <foreach collection="selective" item="column" separator=",">
+          ${column.aliasedEscapedColumnName}
+        </foreach>
+      </when>
+      <otherwise>
+        <include refid="Base_Column_List" />
+      </otherwise>
+    </choose>
+    from login
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+    <if test="example != null and example.orderByClause != null">
+      order by ${example.orderByClause}
+    </if>
+    limit 1
+  </select>
+  <insert id="batchInsert" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    insert into login
+    (id, user_name, password)
+    values
+    <foreach collection="list" item="item" separator=",">
+      (#{item.id,jdbcType=INTEGER}, #{item.userName,jdbcType=VARCHAR}, #{item.password,jdbcType=VARCHAR}
+        )
+    </foreach>
+  </insert>
+  <insert id="batchInsertSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    insert into login (
+    <foreach collection="selective" item="column" separator=",">
+      ${column.escapedColumnName}
+    </foreach>
+    )
+    values
+    <foreach collection="list" item="item" separator=",">
+      (
+      <foreach collection="selective" item="column" separator=",">
+        <if test="'id'.toString() == column.value">
+          #{item.id,jdbcType=INTEGER}
+        </if>
+        <if test="'user_name'.toString() == column.value">
+          #{item.userName,jdbcType=VARCHAR}
+        </if>
+        <if test="'password'.toString() == column.value">
+          #{item.password,jdbcType=VARCHAR}
+        </if>
+      </foreach>
+      )
+    </foreach>
+  </insert>
+  <insert id="upsertSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    insert into login
+    <choose>
+      <when test="selective != null and selective.length > 0">
+        <foreach close=")" collection="selective" item="column" open="(" separator=",">
+          ${column.escapedColumnName}
+        </foreach>
+      </when>
+      <otherwise>
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+          <if test="record.id != null">
+            id,
+          </if>
+          <if test="record.userName != null">
+            user_name,
+          </if>
+          <if test="record.password != null">
+            password,
+          </if>
+        </trim>
+        <trim prefix="(" suffix=")" suffixOverrides="," />
+      </otherwise>
+    </choose>
+    values
+    <choose>
+      <when test="selective != null and selective.length > 0">
+        <foreach close=")" collection="selective" item="column" open="(" separator=",">
+          #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
+        </foreach>
+      </when>
+      <otherwise>
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+          <if test="record.id != null">
+            #{record.id,jdbcType=INTEGER},
+          </if>
+          <if test="record.userName != null">
+            #{record.userName,jdbcType=VARCHAR},
+          </if>
+          <if test="record.password != null">
+            #{record.password,jdbcType=VARCHAR},
+          </if>
+        </trim>
+      </otherwise>
+    </choose>
+    on duplicate key update 
+    <choose>
+      <when test="selective != null and selective.length > 0">
+        <foreach collection="selective" item="column" separator=",">
+          ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
+        </foreach>
+      </when>
+      <otherwise>
+        <trim suffixOverrides=",">
+          <if test="record.id != null">
+            id = #{record.id,jdbcType=INTEGER},
+          </if>
+          <if test="record.userName != null">
+            user_name = #{record.userName,jdbcType=VARCHAR},
+          </if>
+          <if test="record.password != null">
+            password = #{record.password,jdbcType=VARCHAR},
+          </if>
+        </trim>
+      </otherwise>
+    </choose>
+  </insert>
+  <insert id="upsert" parameterType="com.book.dao.cps.entity.Login">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Sep 02 23:22:53 CST 2021.
+    -->
+    insert into login
+    (id, user_name, password)
+    values
+    (#{id,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}
+      )
+    on duplicate key update 
+    id = #{id,jdbcType=INTEGER}, 
+    user_name = #{userName,jdbcType=VARCHAR}, 
+    password = #{password,jdbcType=VARCHAR}
+  </insert>
+</mapper>

+ 2 - 1
book-dao/src/main/resources/mybatis-generator.xml

@@ -129,7 +129,8 @@
 <!--        <table tableName="bookshelf_recommand"></table>-->
 <!--        <table tableName="smart_recommand"></table>-->
 <!--        <table tableName="upload_book"></table>-->
-        <table tableName="edit_book"></table>
+<!--        <table tableName="edit_book"></table>-->
+        <table tableName="login"></table>
 <!--        <table tableName="goods"></table>-->
 <!--        <table tableName="user_read_config"></table>-->
 

+ 21 - 6
book-server/src/main/java/com/book/server/controller/BookController.java

@@ -17,6 +17,7 @@ import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpSession;
 import java.io.IOException;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
@@ -184,6 +185,14 @@ public class BookController extends BaseController {
     @Autowired
     private CacheService cacheService;
 
+    private Boolean checkLogin(HttpSession session) {
+        Object login = session.getAttribute("login");
+        if (login != null && (Boolean) login) {
+            return true;
+        }
+        return false;
+    }
+
     /**
      * 自定义书籍上传
      *
@@ -193,7 +202,9 @@ public class BookController extends BaseController {
      * @throws IOException
      */
     @PostMapping("/upload-8F80F0A4-E084-44C6-8659-61612C9D9D44")
-    public Result uploadFile(@RequestParam("file") MultipartFile file, Long bookId) throws IOException {
+    public Result uploadFile(@RequestParam("file") MultipartFile file, Long bookId, HttpSession session) throws IOException {
+
+
         if (file.isEmpty() || bookId == null || bookId < 100_0000) {
             return Result.failure(ResultCode.PARAMERROR);
         }
@@ -208,11 +219,13 @@ public class BookController extends BaseController {
 
     /**
      * 后台-删除上传的书籍
+     *
      * @param id
      * @return
      */
     @GetMapping("deleteUpload-8F80F0A4-E084-44C6-8659-61612C9D9D44")
-    public Result deleteUploadFile(Long id) {
+    public Result deleteUploadFile(Long id, HttpSession session) {
+
         return Result.success(bookService.deleteUploadFile(id));
     }
 
@@ -223,7 +236,8 @@ public class BookController extends BaseController {
      * @return
      */
     @PostMapping("/content-05863069-1AE0-435C-9283-2515A4A31BF7")
-    public Result<BookContent> getBookContentByChapter2(@RequestBody BookContentVO bookContentVO) {
+    public Result<BookContent> getBookContentByChapter2(@RequestBody BookContentVO bookContentVO, HttpSession session) {
+
         return bookService.getContentByContentId2(bookContentVO);
     }
 
@@ -234,7 +248,8 @@ public class BookController extends BaseController {
      * @return
      */
     @PostMapping("/updateContent-584CBBC1-DBD9-47A9-AAF1-EBA684B82B55")
-    public Result updateBookContent(@RequestBody BookContentVO bookContentVO) {
+    public Result updateBookContent(@RequestBody BookContentVO bookContentVO, HttpSession session) {
+
         return Result.byObject(bookService.updateBookContent(bookContentVO));
     }
 
@@ -244,7 +259,7 @@ public class BookController extends BaseController {
      * @return
      */
     @GetMapping("/getRecommendId-584CBBC1-DBD9-47A9-AAF1-EBC684B82B55")
-    public Result getRecommendId() {
+    public Result getRecommendId(HttpSession session) {
         return Result.byObject(bookService.getRecommendId());
     }
 
@@ -257,7 +272,7 @@ public class BookController extends BaseController {
      * @return
      */
     @GetMapping("/updateBlockCache-8AA34230-157C-4EF6-98CE-0D928B3DE9EF")
-    public Result updateBlockCache() {
+    public Result updateBlockCache(HttpSession session) {
         blockCacheGuava.clearCache();
         return Result.success();
     }

+ 35 - 0
book-server/src/main/java/com/book/server/controller/LoginController.java

@@ -0,0 +1,35 @@
+package com.book.server.controller;
+
+import com.book.dao.VO.LoginVO;
+import com.book.server.common.entity.Result;
+import com.book.server.service.LoginService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpSession;
+
+/**
+ * 登录
+ */
+@RestController
+@Slf4j
+@RequestMapping("/api/login")
+public class LoginController extends BaseController {
+
+    @Autowired
+    private LoginService loginService;
+
+    @PostMapping("/login")
+    public Result login(@RequestBody LoginVO loginVO, HttpSession session) {
+        boolean login = loginService.login(loginVO);
+        if (login) {
+            session.setAttribute("login", true);
+            return Result.success();
+        } else {
+            return Result.failure();
+        }
+    }
+
+}

+ 8 - 0
book-server/src/main/java/com/book/server/service/LoginService.java

@@ -0,0 +1,8 @@
+package com.book.server.service;
+
+import com.book.dao.VO.LoginVO;
+
+public interface LoginService {
+
+    boolean login(LoginVO loginVO);
+}

+ 25 - 0
book-server/src/main/java/com/book/server/service/impl/LoginServiceImpl.java

@@ -0,0 +1,25 @@
+package com.book.server.service.impl;
+
+import com.book.dao.VO.LoginVO;
+import com.book.dao.cps.entity.Login;
+import com.book.dao.cps.mapper.LoginMapper;
+import com.book.dao.cps.pojo.example.LoginExample;
+import com.book.server.service.LoginService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class LoginServiceImpl implements LoginService {
+    @Autowired
+    private LoginMapper loginMapper;
+
+    @Override
+    public boolean login(LoginVO loginVO) {
+        Login login = loginMapper.selectOneByExample(LoginExample.newAndCreateCriteria()
+                .andUserNameEqualTo(loginVO.getUserName())
+                .andPasswordEqualTo(loginVO.getPassword())
+                .example()
+        );
+        return login != null;
+    }
+}