Просмотр исходного кода

签到提醒
未支付提醒
继续阅读提醒
订单分成

lijilei 3 лет назад
Родитель
Сommit
d467211120
29 измененных файлов с 2322 добавлено и 1400 удалено
  1. 19 0
      book-dao/src/main/java/com/book/dao/cps/mapper/AdminExtendMapper.java
  2. 3 0
      book-dao/src/main/java/com/book/dao/cps/mapper/OrdersMapper.java
  3. 106 0
      book-dao/src/main/java/com/book/dao/cps/pojo/AdminExtend.java
  4. 2 0
      book-dao/src/main/java/com/book/dao/cpsshard/mapper/SignMapper.java
  5. 2 0
      book-dao/src/main/java/com/book/dao/cpsshard/mapper/UserRecentlyReadMapper.java
  6. 253 0
      book-dao/src/main/resources/mapper/cps/AdminExtendMapper.xml
  7. 4 0
      book-dao/src/main/resources/mapper/cps/OrdersMapper.xml
  8. 616 602
      book-dao/src/main/resources/mapper/cpsshard/SignMapper.xml
  9. 736 719
      book-dao/src/main/resources/mapper/cpsshard/UserRecentlyReadMapper.xml
  10. 2 3
      book-push/src/main/java/com/book/push/handler/MenuHandler.java
  11. 4 0
      book-push/src/main/java/com/book/push/service/dao/BookService.java
  12. 16 0
      book-push/src/main/java/com/book/push/service/dao/OrdersService.java
  13. 17 0
      book-push/src/main/java/com/book/push/service/dao/SignService.java
  14. 19 0
      book-push/src/main/java/com/book/push/service/dao/UserRecentReadService.java
  15. 1 0
      book-push/src/main/java/com/book/push/service/dao/UserService.java
  16. 14 1
      book-push/src/main/java/com/book/push/service/dao/impl/BookServiceImpl.java
  17. 26 0
      book-push/src/main/java/com/book/push/service/dao/impl/OrdersServiceImpl.java
  18. 26 0
      book-push/src/main/java/com/book/push/service/dao/impl/SignServiceImpl.java
  19. 35 0
      book-push/src/main/java/com/book/push/service/dao/impl/UserRecentReadServiceImpl.java
  20. 54 1
      book-push/src/main/java/com/book/push/service/dao/impl/UserServiceImpl.java
  21. 78 0
      book-push/src/main/java/com/book/push/task/NoPayTask.java
  22. 69 0
      book-push/src/main/java/com/book/push/task/NoSignTask.java
  23. 71 0
      book-push/src/main/java/com/book/push/task/RecentReadTask.java
  24. 108 37
      book-push/src/main/resources/application-pro.yml
  25. 12 12
      book-push/src/main/resources/application-test.yml
  26. 1 1
      book-push/src/main/resources/application.yml
  27. 1 0
      book-server/src/main/java/com/book/server/service/BookService.java
  28. 1 0
      book-server/src/main/java/com/book/server/service/impl/BookServiceImpl.java
  29. 26 24
      book-server/src/main/java/com/book/server/service/impl/WxPayServiceImpl.java

+ 19 - 0
book-dao/src/main/java/com/book/dao/cps/mapper/AdminExtendMapper.java

@@ -0,0 +1,19 @@
+package com.book.dao.cps.mapper;
+
+import com.book.dao.cps.pojo.AdminExtend;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface AdminExtendMapper {
+    int deleteByPrimaryKey(Integer adminId);
+
+    int insert(AdminExtend record);
+
+    int insertSelective(AdminExtend record);
+
+    AdminExtend selectByPrimaryKey(Integer adminId);
+
+    int updateByPrimaryKeySelective(AdminExtend record);
+
+    int updateByPrimaryKey(AdminExtend record);
+}

+ 3 - 0
book-dao/src/main/java/com/book/dao/cps/mapper/OrdersMapper.java

@@ -4,6 +4,8 @@ import com.book.dao.cps.pojo.Orders;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 @Repository
 public interface OrdersMapper {
     int deleteByPrimaryKey(Integer id);
@@ -22,4 +24,5 @@ public interface OrdersMapper {
     Orders selectByOutTradeNo(@Param("out_trade_no") String outTradeNo);
 
 
+    List<Orders> selectNoPayOrderBetweenCreate(@Param("from") Integer from, @Param("to")Integer to);
 }

+ 106 - 0
book-dao/src/main/java/com/book/dao/cps/pojo/AdminExtend.java

@@ -0,0 +1,106 @@
+package com.book.dao.cps.pojo;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import lombok.Data;
+
+/**
+ * admin_extend
+ * @author 
+ */
+@Data
+public class AdminExtend implements Serializable {
+    /**
+     * 渠道商/代理商ID
+     */
+    private Integer adminId;
+
+    /**
+     * 是否有配号权限:0=没有,1=有
+     */
+    private Object canDistribute;
+
+    /**
+     * 收益分成比例[2位小数]
+     */
+    private BigDecimal benefit;
+
+    /**
+     * 开户人[超管id]
+     */
+    private Integer createBy;
+
+    /**
+     * 收款方式:1=银行卡对公,2=银行卡对私,3=微信,4=支付宝
+     */
+    private Object payMethod;
+
+    /**
+     * 付款方id
+     */
+    private Integer payerid;
+
+    /**
+     * 收款人
+     */
+    private String cardHolder;
+
+    /**
+     * 收款账号
+     */
+    private String cardNum;
+
+    /**
+     * 收款开户银行
+     */
+    private String cardBank;
+
+    /**
+     * 身份证号码
+     */
+    private String idcardNo;
+
+    /**
+     * 配号状态:0=关闭,1=开启
+     */
+    private Object distribute;
+
+    /**
+     * 赏金开启状态:0=未开启,1=已开启
+     */
+    private Object rewardState;
+
+    /**
+     * 身份证是否必填:0=否,1=是
+     */
+    private Object isIdcard;
+
+    /**
+     * 赏金比例
+     */
+    private BigDecimal rewardBenefit;
+
+    /**
+     * 创建时间
+     */
+    private Integer createtime;
+
+    /**
+     * 更新时间
+     */
+    private Integer updatetime;
+
+    /**
+     * 邀请人ID
+     */
+    private Integer inviteId;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    private BigDecimal benefitApp;
+
+    private static final long serialVersionUID = 1L;
+}

+ 2 - 0
book-dao/src/main/java/com/book/dao/cpsshard/mapper/SignMapper.java

@@ -161,4 +161,6 @@ public interface SignMapper {
      * @mbg.generated Sun Aug 22 13:51:10 CST 2021
      */
     int upsertSelective(@Param("record") Sign record, @Param("selective") Sign.Column ... selective);
+
+    List<Sign> selectAllUserLastSign(Integer from, Integer to);
 }

+ 2 - 0
book-dao/src/main/java/com/book/dao/cpsshard/mapper/UserRecentlyReadMapper.java

@@ -161,4 +161,6 @@ public interface UserRecentlyReadMapper {
      * @mbg.generated Sun Aug 22 13:51:10 CST 2021
      */
     int upsertSelective(@Param("record") UserRecentlyRead record, @Param("selective") UserRecentlyRead.Column ... selective);
+
+    List<UserRecentlyRead> selectLastGroupByUserId(Integer from,Integer to);
 }

+ 253 - 0
book-dao/src/main/resources/mapper/cps/AdminExtendMapper.xml

@@ -0,0 +1,253 @@
+<?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.AdminExtendMapper">
+  <resultMap id="BaseResultMap" type="com.book.dao.cps.pojo.AdminExtend">
+    <id column="admin_id" jdbcType="INTEGER" property="adminId" />
+    <result column="can_distribute" jdbcType="OTHER" property="canDistribute" />
+    <result column="benefit" jdbcType="DECIMAL" property="benefit" />
+    <result column="create_by" jdbcType="INTEGER" property="createBy" />
+    <result column="pay_method" jdbcType="OTHER" property="payMethod" />
+    <result column="payerid" jdbcType="INTEGER" property="payerid" />
+    <result column="card_holder" jdbcType="VARCHAR" property="cardHolder" />
+    <result column="card_num" jdbcType="VARCHAR" property="cardNum" />
+    <result column="card_bank" jdbcType="VARCHAR" property="cardBank" />
+    <result column="idcard_no" jdbcType="VARCHAR" property="idcardNo" />
+    <result column="distribute" jdbcType="OTHER" property="distribute" />
+    <result column="reward_state" jdbcType="OTHER" property="rewardState" />
+    <result column="is_idcard" jdbcType="OTHER" property="isIdcard" />
+    <result column="reward_benefit" jdbcType="DECIMAL" property="rewardBenefit" />
+    <result column="createtime" jdbcType="INTEGER" property="createtime" />
+    <result column="updatetime" jdbcType="INTEGER" property="updatetime" />
+    <result column="invite_id" jdbcType="INTEGER" property="inviteId" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="benefit_app" jdbcType="DECIMAL" property="benefitApp" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    admin_id, can_distribute, benefit, create_by, pay_method, payerid, card_holder, card_num, 
+    card_bank, idcard_no, distribute, reward_state, is_idcard, reward_benefit, createtime, 
+    updatetime, invite_id, remark, benefit_app
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from admin_extend
+    where admin_id = #{adminId,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from admin_extend
+    where admin_id = #{adminId,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" keyColumn="admin_id" keyProperty="adminId" parameterType="com.book.dao.cps.pojo.AdminExtend" useGeneratedKeys="true">
+    insert into admin_extend (can_distribute, benefit, create_by, 
+      pay_method, payerid, card_holder, 
+      card_num, card_bank, idcard_no, 
+      distribute, reward_state, is_idcard, 
+      reward_benefit, createtime, updatetime, 
+      invite_id, remark, benefit_app
+      )
+    values (#{canDistribute,jdbcType=OTHER}, #{benefit,jdbcType=DECIMAL}, #{createBy,jdbcType=INTEGER}, 
+      #{payMethod,jdbcType=OTHER}, #{payerid,jdbcType=INTEGER}, #{cardHolder,jdbcType=VARCHAR}, 
+      #{cardNum,jdbcType=VARCHAR}, #{cardBank,jdbcType=VARCHAR}, #{idcardNo,jdbcType=VARCHAR}, 
+      #{distribute,jdbcType=OTHER}, #{rewardState,jdbcType=OTHER}, #{isIdcard,jdbcType=OTHER}, 
+      #{rewardBenefit,jdbcType=DECIMAL}, #{createtime,jdbcType=INTEGER}, #{updatetime,jdbcType=INTEGER}, 
+      #{inviteId,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{benefitApp,jdbcType=DECIMAL}
+      )
+  </insert>
+  <insert id="insertSelective" keyColumn="admin_id" keyProperty="adminId" parameterType="com.book.dao.cps.pojo.AdminExtend" useGeneratedKeys="true">
+    insert into admin_extend
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="canDistribute != null">
+        can_distribute,
+      </if>
+      <if test="benefit != null">
+        benefit,
+      </if>
+      <if test="createBy != null">
+        create_by,
+      </if>
+      <if test="payMethod != null">
+        pay_method,
+      </if>
+      <if test="payerid != null">
+        payerid,
+      </if>
+      <if test="cardHolder != null">
+        card_holder,
+      </if>
+      <if test="cardNum != null">
+        card_num,
+      </if>
+      <if test="cardBank != null">
+        card_bank,
+      </if>
+      <if test="idcardNo != null">
+        idcard_no,
+      </if>
+      <if test="distribute != null">
+        distribute,
+      </if>
+      <if test="rewardState != null">
+        reward_state,
+      </if>
+      <if test="isIdcard != null">
+        is_idcard,
+      </if>
+      <if test="rewardBenefit != null">
+        reward_benefit,
+      </if>
+      <if test="createtime != null">
+        createtime,
+      </if>
+      <if test="updatetime != null">
+        updatetime,
+      </if>
+      <if test="inviteId != null">
+        invite_id,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="benefitApp != null">
+        benefit_app,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="canDistribute != null">
+        #{canDistribute,jdbcType=OTHER},
+      </if>
+      <if test="benefit != null">
+        #{benefit,jdbcType=DECIMAL},
+      </if>
+      <if test="createBy != null">
+        #{createBy,jdbcType=INTEGER},
+      </if>
+      <if test="payMethod != null">
+        #{payMethod,jdbcType=OTHER},
+      </if>
+      <if test="payerid != null">
+        #{payerid,jdbcType=INTEGER},
+      </if>
+      <if test="cardHolder != null">
+        #{cardHolder,jdbcType=VARCHAR},
+      </if>
+      <if test="cardNum != null">
+        #{cardNum,jdbcType=VARCHAR},
+      </if>
+      <if test="cardBank != null">
+        #{cardBank,jdbcType=VARCHAR},
+      </if>
+      <if test="idcardNo != null">
+        #{idcardNo,jdbcType=VARCHAR},
+      </if>
+      <if test="distribute != null">
+        #{distribute,jdbcType=OTHER},
+      </if>
+      <if test="rewardState != null">
+        #{rewardState,jdbcType=OTHER},
+      </if>
+      <if test="isIdcard != null">
+        #{isIdcard,jdbcType=OTHER},
+      </if>
+      <if test="rewardBenefit != null">
+        #{rewardBenefit,jdbcType=DECIMAL},
+      </if>
+      <if test="createtime != null">
+        #{createtime,jdbcType=INTEGER},
+      </if>
+      <if test="updatetime != null">
+        #{updatetime,jdbcType=INTEGER},
+      </if>
+      <if test="inviteId != null">
+        #{inviteId,jdbcType=INTEGER},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="benefitApp != null">
+        #{benefitApp,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.book.dao.cps.pojo.AdminExtend">
+    update admin_extend
+    <set>
+      <if test="canDistribute != null">
+        can_distribute = #{canDistribute,jdbcType=OTHER},
+      </if>
+      <if test="benefit != null">
+        benefit = #{benefit,jdbcType=DECIMAL},
+      </if>
+      <if test="createBy != null">
+        create_by = #{createBy,jdbcType=INTEGER},
+      </if>
+      <if test="payMethod != null">
+        pay_method = #{payMethod,jdbcType=OTHER},
+      </if>
+      <if test="payerid != null">
+        payerid = #{payerid,jdbcType=INTEGER},
+      </if>
+      <if test="cardHolder != null">
+        card_holder = #{cardHolder,jdbcType=VARCHAR},
+      </if>
+      <if test="cardNum != null">
+        card_num = #{cardNum,jdbcType=VARCHAR},
+      </if>
+      <if test="cardBank != null">
+        card_bank = #{cardBank,jdbcType=VARCHAR},
+      </if>
+      <if test="idcardNo != null">
+        idcard_no = #{idcardNo,jdbcType=VARCHAR},
+      </if>
+      <if test="distribute != null">
+        distribute = #{distribute,jdbcType=OTHER},
+      </if>
+      <if test="rewardState != null">
+        reward_state = #{rewardState,jdbcType=OTHER},
+      </if>
+      <if test="isIdcard != null">
+        is_idcard = #{isIdcard,jdbcType=OTHER},
+      </if>
+      <if test="rewardBenefit != null">
+        reward_benefit = #{rewardBenefit,jdbcType=DECIMAL},
+      </if>
+      <if test="createtime != null">
+        createtime = #{createtime,jdbcType=INTEGER},
+      </if>
+      <if test="updatetime != null">
+        updatetime = #{updatetime,jdbcType=INTEGER},
+      </if>
+      <if test="inviteId != null">
+        invite_id = #{inviteId,jdbcType=INTEGER},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="benefitApp != null">
+        benefit_app = #{benefitApp,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where admin_id = #{adminId,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.book.dao.cps.pojo.AdminExtend">
+    update admin_extend
+    set can_distribute = #{canDistribute,jdbcType=OTHER},
+      benefit = #{benefit,jdbcType=DECIMAL},
+      create_by = #{createBy,jdbcType=INTEGER},
+      pay_method = #{payMethod,jdbcType=OTHER},
+      payerid = #{payerid,jdbcType=INTEGER},
+      card_holder = #{cardHolder,jdbcType=VARCHAR},
+      card_num = #{cardNum,jdbcType=VARCHAR},
+      card_bank = #{cardBank,jdbcType=VARCHAR},
+      idcard_no = #{idcardNo,jdbcType=VARCHAR},
+      distribute = #{distribute,jdbcType=OTHER},
+      reward_state = #{rewardState,jdbcType=OTHER},
+      is_idcard = #{isIdcard,jdbcType=OTHER},
+      reward_benefit = #{rewardBenefit,jdbcType=DECIMAL},
+      createtime = #{createtime,jdbcType=INTEGER},
+      updatetime = #{updatetime,jdbcType=INTEGER},
+      invite_id = #{inviteId,jdbcType=INTEGER},
+      remark = #{remark,jdbcType=VARCHAR},
+      benefit_app = #{benefitApp,jdbcType=DECIMAL}
+    where admin_id = #{adminId,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 4 - 0
book-dao/src/main/resources/mapper/cps/OrdersMapper.xml

@@ -64,6 +64,10 @@
   <select id="selectByOutTradeNo" resultMap="BaseResultMap">
     SELECT * FROM test_cps.orders where   out_trade_no = #{out_trade_no,jdbcType=VARCHAR}
 
+  </select>
+  <select id="selectNoPayOrderBetweenCreate" resultMap="BaseResultMap">
+     SELECT user_id,admin_id,book_id,createtime from test_cps.orders where createtime between #{from} and #{to} and state= 0;
+
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from orders

+ 616 - 602
book-dao/src/main/resources/mapper/cpsshard/SignMapper.xml

@@ -1,619 +1,633 @@
 <?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.cpsshard.mapper.SignMapper">
-  <resultMap id="BaseResultMap" type="com.book.dao.cpsshard.entity.Sign">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="uid" jdbcType="INTEGER" property="uid" />
-    <result column="kandian" jdbcType="INTEGER" property="kandian" />
-    <result column="days" jdbcType="TINYINT" property="days" />
-    <result column="createdate" jdbcType="INTEGER" property="createdate" />
-    <result column="createtime" jdbcType="INTEGER" property="createtime" />
-  </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 Sun Aug 22 13:51:10 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>
+    <resultMap id="BaseResultMap" type="com.book.dao.cpsshard.entity.Sign">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        <id column="id" jdbcType="INTEGER" property="id"/>
+        <result column="uid" jdbcType="INTEGER" property="uid"/>
+        <result column="kandian" jdbcType="INTEGER" property="kandian"/>
+        <result column="days" jdbcType="TINYINT" property="days"/>
+        <result column="createdate" jdbcType="INTEGER" property="createdate"/>
+        <result column="createtime" jdbcType="INTEGER" property="createtime"/>
+    </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 Sun Aug 22 13:51:10 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>
-          </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 Sun Aug 22 13:51:10 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>
+        </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 Sun Aug 22 13:51:10 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>
-          </trim>
+        </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        id, uid, kandian, days, createdate, createtime
+    </sql>
+    <select id="selectByExample" parameterType="com.book.dao.cpsshard.pojo.example.SignExample"
+            resultMap="BaseResultMap">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select
+        <if test="distinct">
+            distinct
         </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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    id, uid, kandian, days, createdate, createtime
-  </sql>
-  <select id="selectByExample" parameterType="com.book.dao.cpsshard.pojo.example.SignExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from sign
-    <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 Sun Aug 22 13:51:10 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 sign
-    <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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select 
-    <include refid="Base_Column_List" />
-    from sign
-    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 Sun Aug 22 13:51:10 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 sign
-    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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    delete from sign
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.book.dao.cpsshard.pojo.example.SignExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    delete from sign
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.book.dao.cpsshard.entity.Sign">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into sign (id, uid, kandian, 
-      days, createdate, createtime
-      )
-    values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{kandian,jdbcType=INTEGER}, 
-      #{days,jdbcType=TINYINT}, #{createdate,jdbcType=INTEGER}, #{createtime,jdbcType=INTEGER}
-      )
-  </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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into sign
-    <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.uid != null">
-            uid,
-          </if>
-          <if test="record.kandian != null">
-            kandian,
-          </if>
-          <if test="record.days != null">
-            days,
-          </if>
-          <if test="record.createdate != null">
-            createdate,
-          </if>
-          <if test="record.createtime != null">
-            createtime,
-          </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.uid != null">
-            #{record.uid,jdbcType=INTEGER},
-          </if>
-          <if test="record.kandian != null">
-            #{record.kandian,jdbcType=INTEGER},
-          </if>
-          <if test="record.days != null">
-            #{record.days,jdbcType=TINYINT},
-          </if>
-          <if test="record.createdate != null">
-            #{record.createdate,jdbcType=INTEGER},
-          </if>
-          <if test="record.createtime != null">
-            #{record.createtime,jdbcType=INTEGER},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-  </insert>
-  <select id="countByExample" parameterType="com.book.dao.cpsshard.pojo.example.SignExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select count(*) from sign
-    <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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    update sign
-    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.uid != null">
-            uid = #{record.uid,jdbcType=INTEGER},
-          </if>
-          <if test="record.kandian != null">
-            kandian = #{record.kandian,jdbcType=INTEGER},
-          </if>
-          <if test="record.days != null">
-            days = #{record.days,jdbcType=TINYINT},
-          </if>
-          <if test="record.createdate != null">
-            createdate = #{record.createdate,jdbcType=INTEGER},
-          </if>
-          <if test="record.createtime != null">
-            createtime = #{record.createtime,jdbcType=INTEGER},
-          </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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    update sign
-    set id = #{record.id,jdbcType=INTEGER},
-      uid = #{record.uid,jdbcType=INTEGER},
-      kandian = #{record.kandian,jdbcType=INTEGER},
-      days = #{record.days,jdbcType=TINYINT},
-      createdate = #{record.createdate,jdbcType=INTEGER},
-      createtime = #{record.createtime,jdbcType=INTEGER}
-    <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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    update sign
-    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.uid != null">
-            uid = #{record.uid,jdbcType=INTEGER},
-          </if>
-          <if test="record.kandian != null">
-            kandian = #{record.kandian,jdbcType=INTEGER},
-          </if>
-          <if test="record.days != null">
-            days = #{record.days,jdbcType=TINYINT},
-          </if>
-          <if test="record.createdate != null">
-            createdate = #{record.createdate,jdbcType=INTEGER},
-          </if>
-          <if test="record.createtime != null">
-            createtime = #{record.createtime,jdbcType=INTEGER},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-    where id = #{record.id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.book.dao.cpsshard.entity.Sign">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    update sign
-    set uid = #{uid,jdbcType=INTEGER},
-      kandian = #{kandian,jdbcType=INTEGER},
-      days = #{days,jdbcType=TINYINT},
-      createdate = #{createdate,jdbcType=INTEGER},
-      createtime = #{createtime,jdbcType=INTEGER}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <select id="selectOneByExample" parameterType="com.book.dao.cpsshard.pojo.example.SignExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select
-    <include refid="Base_Column_List" />
-    from sign
-    <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 Sun Aug 22 13:51:10 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 sign
-    <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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into sign
-    (id, uid, kandian, days, createdate, createtime)
-    values
-    <foreach collection="list" item="item" separator=",">
-      (#{item.id,jdbcType=INTEGER}, #{item.uid,jdbcType=INTEGER}, #{item.kandian,jdbcType=INTEGER}, 
-        #{item.days,jdbcType=TINYINT}, #{item.createdate,jdbcType=INTEGER}, #{item.createtime,jdbcType=INTEGER}
+        <include refid="Base_Column_List"/>
+        from sign
+        <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 Sun Aug 22 13:51:10 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 sign
+        <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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select
+        <include refid="Base_Column_List"/>
+        from sign
+        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 Sun Aug 22 13:51:10 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 sign
+        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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        delete from sign
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <delete id="deleteByExample" parameterType="com.book.dao.cpsshard.pojo.example.SignExample">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        delete from sign
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause"/>
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.book.dao.cpsshard.entity.Sign">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into sign (id, uid, kandian,
+        days, createdate, createtime
         )
-    </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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into sign (
-    <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}
+        values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{kandian,jdbcType=INTEGER},
+        #{days,jdbcType=TINYINT}, #{createdate,jdbcType=INTEGER}, #{createtime,jdbcType=INTEGER}
+        )
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into sign
+        <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.uid != null">
+                        uid,
+                    </if>
+                    <if test="record.kandian != null">
+                        kandian,
+                    </if>
+                    <if test="record.days != null">
+                        days,
+                    </if>
+                    <if test="record.createdate != null">
+                        createdate,
+                    </if>
+                    <if test="record.createtime != null">
+                        createtime,
+                    </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.uid != null">
+                        #{record.uid,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.kandian != null">
+                        #{record.kandian,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.days != null">
+                        #{record.days,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.createdate != null">
+                        #{record.createdate,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.createtime != null">
+                        #{record.createtime,jdbcType=INTEGER},
+                    </if>
+                </trim>
+            </otherwise>
+        </choose>
+    </insert>
+    <select id="countByExample" parameterType="com.book.dao.cpsshard.pojo.example.SignExample"
+            resultType="java.lang.Long">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select count(*) from sign
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause"/>
         </if>
-        <if test="'uid'.toString() == column.value">
-          #{item.uid,jdbcType=INTEGER}
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        update sign
+        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.uid != null">
+                        uid = #{record.uid,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.kandian != null">
+                        kandian = #{record.kandian,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.days != null">
+                        days = #{record.days,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.createdate != null">
+                        createdate = #{record.createdate,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.createtime != null">
+                        createtime = #{record.createtime,jdbcType=INTEGER},
+                    </if>
+                </trim>
+            </otherwise>
+        </choose>
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause"/>
         </if>
-        <if test="'kandian'.toString() == column.value">
-          #{item.kandian,jdbcType=INTEGER}
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        update sign
+        set id = #{record.id,jdbcType=INTEGER},
+        uid = #{record.uid,jdbcType=INTEGER},
+        kandian = #{record.kandian,jdbcType=INTEGER},
+        days = #{record.days,jdbcType=TINYINT},
+        createdate = #{record.createdate,jdbcType=INTEGER},
+        createtime = #{record.createtime,jdbcType=INTEGER}
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause"/>
         </if>
-        <if test="'days'.toString() == column.value">
-          #{item.days,jdbcType=TINYINT}
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        update sign
+        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.uid != null">
+                        uid = #{record.uid,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.kandian != null">
+                        kandian = #{record.kandian,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.days != null">
+                        days = #{record.days,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.createdate != null">
+                        createdate = #{record.createdate,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.createtime != null">
+                        createtime = #{record.createtime,jdbcType=INTEGER},
+                    </if>
+                </trim>
+            </otherwise>
+        </choose>
+        where id = #{record.id,jdbcType=INTEGER}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.book.dao.cpsshard.entity.Sign">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        update sign
+        set uid = #{uid,jdbcType=INTEGER},
+        kandian = #{kandian,jdbcType=INTEGER},
+        days = #{days,jdbcType=TINYINT},
+        createdate = #{createdate,jdbcType=INTEGER},
+        createtime = #{createtime,jdbcType=INTEGER}
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="selectOneByExample" parameterType="com.book.dao.cpsshard.pojo.example.SignExample"
+            resultMap="BaseResultMap">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select
+        <include refid="Base_Column_List"/>
+        from sign
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause"/>
         </if>
-        <if test="'createdate'.toString() == column.value">
-          #{item.createdate,jdbcType=INTEGER}
+        <if test="orderByClause != null">
+            order by ${orderByClause}
         </if>
-        <if test="'createtime'.toString() == column.value">
-          #{item.createtime,jdbcType=INTEGER}
+        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 Sun Aug 22 13:51:10 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 sign
+        <if test="example != null">
+            <include refid="Update_By_Example_Where_Clause"/>
         </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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into sign
-    <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.uid != null">
-            uid,
-          </if>
-          <if test="record.kandian != null">
-            kandian,
-          </if>
-          <if test="record.days != null">
-            days,
-          </if>
-          <if test="record.createdate != null">
-            createdate,
-          </if>
-          <if test="record.createtime != null">
-            createtime,
-          </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}}
+        <if test="example != null and example.orderByClause != null">
+            order by ${example.orderByClause}
+        </if>
+        limit 1
+    </select>
+    <select id="selectAllUserLastSign" resultMap="BaseResultMap">
+        select a.*
+        from sign a,
+             (select uid, max(createtime) createtime
+              from sign where createtime between #{from} and #{to}
+              group by uid ) b
+        where a.uid = b.uid
+          and a.createtime = b.createtime
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into sign
+        (id, uid, kandian, days, createdate, createtime)
+        values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.id,jdbcType=INTEGER}, #{item.uid,jdbcType=INTEGER}, #{item.kandian,jdbcType=INTEGER},
+            #{item.days,jdbcType=TINYINT}, #{item.createdate,jdbcType=INTEGER}, #{item.createtime,jdbcType=INTEGER}
+            )
         </foreach>
-      </when>
-      <otherwise>
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-          <if test="record.id != null">
-            #{record.id,jdbcType=INTEGER},
-          </if>
-          <if test="record.uid != null">
-            #{record.uid,jdbcType=INTEGER},
-          </if>
-          <if test="record.kandian != null">
-            #{record.kandian,jdbcType=INTEGER},
-          </if>
-          <if test="record.days != null">
-            #{record.days,jdbcType=TINYINT},
-          </if>
-          <if test="record.createdate != null">
-            #{record.createdate,jdbcType=INTEGER},
-          </if>
-          <if test="record.createtime != null">
-            #{record.createtime,jdbcType=INTEGER},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-    on duplicate key update 
-    <choose>
-      <when test="selective != null and selective.length > 0">
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into sign (
         <foreach collection="selective" item="column" separator=",">
-          ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
+            ${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="'uid'.toString() == column.value">
+                    #{item.uid,jdbcType=INTEGER}
+                </if>
+                <if test="'kandian'.toString() == column.value">
+                    #{item.kandian,jdbcType=INTEGER}
+                </if>
+                <if test="'days'.toString() == column.value">
+                    #{item.days,jdbcType=TINYINT}
+                </if>
+                <if test="'createdate'.toString() == column.value">
+                    #{item.createdate,jdbcType=INTEGER}
+                </if>
+                <if test="'createtime'.toString() == column.value">
+                    #{item.createtime,jdbcType=INTEGER}
+                </if>
+            </foreach>
+            )
         </foreach>
-      </when>
-      <otherwise>
-        <trim suffixOverrides=",">
-          <if test="record.id != null">
-            id = #{record.id,jdbcType=INTEGER},
-          </if>
-          <if test="record.uid != null">
-            uid = #{record.uid,jdbcType=INTEGER},
-          </if>
-          <if test="record.kandian != null">
-            kandian = #{record.kandian,jdbcType=INTEGER},
-          </if>
-          <if test="record.days != null">
-            days = #{record.days,jdbcType=TINYINT},
-          </if>
-          <if test="record.createdate != null">
-            createdate = #{record.createdate,jdbcType=INTEGER},
-          </if>
-          <if test="record.createtime != null">
-            createtime = #{record.createtime,jdbcType=INTEGER},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-  </insert>
-  <insert id="upsert" parameterType="com.book.dao.cpsshard.entity.Sign">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into sign
-    (id, uid, kandian, days, createdate, createtime)
-    values
-    (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{kandian,jdbcType=INTEGER}, #{days,jdbcType=TINYINT}, 
-      #{createdate,jdbcType=INTEGER}, #{createtime,jdbcType=INTEGER})
-    on duplicate key update 
-    id = #{id,jdbcType=INTEGER}, 
-    uid = #{uid,jdbcType=INTEGER}, 
-    kandian = #{kandian,jdbcType=INTEGER}, 
-    days = #{days,jdbcType=TINYINT}, 
-    createdate = #{createdate,jdbcType=INTEGER}, 
-    createtime = #{createtime,jdbcType=INTEGER}
-  </insert>
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into sign
+        <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.uid != null">
+                        uid,
+                    </if>
+                    <if test="record.kandian != null">
+                        kandian,
+                    </if>
+                    <if test="record.days != null">
+                        days,
+                    </if>
+                    <if test="record.createdate != null">
+                        createdate,
+                    </if>
+                    <if test="record.createtime != null">
+                        createtime,
+                    </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.uid != null">
+                        #{record.uid,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.kandian != null">
+                        #{record.kandian,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.days != null">
+                        #{record.days,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.createdate != null">
+                        #{record.createdate,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.createtime != null">
+                        #{record.createtime,jdbcType=INTEGER},
+                    </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.uid != null">
+                        uid = #{record.uid,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.kandian != null">
+                        kandian = #{record.kandian,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.days != null">
+                        days = #{record.days,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.createdate != null">
+                        createdate = #{record.createdate,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.createtime != null">
+                        createtime = #{record.createtime,jdbcType=INTEGER},
+                    </if>
+                </trim>
+            </otherwise>
+        </choose>
+    </insert>
+    <insert id="upsert" parameterType="com.book.dao.cpsshard.entity.Sign">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into sign
+        (id, uid, kandian, days, createdate, createtime)
+        values
+        (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{kandian,jdbcType=INTEGER}, #{days,jdbcType=TINYINT},
+        #{createdate,jdbcType=INTEGER}, #{createtime,jdbcType=INTEGER})
+        on duplicate key update
+        id = #{id,jdbcType=INTEGER},
+        uid = #{uid,jdbcType=INTEGER},
+        kandian = #{kandian,jdbcType=INTEGER},
+        days = #{days,jdbcType=TINYINT},
+        createdate = #{createdate,jdbcType=INTEGER},
+        createtime = #{createtime,jdbcType=INTEGER}
+    </insert>
 </mapper>

+ 736 - 719
book-dao/src/main/resources/mapper/cpsshard/UserRecentlyReadMapper.xml

@@ -1,739 +1,756 @@
 <?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.cpsshard.mapper.UserRecentlyReadMapper">
-  <resultMap id="BaseResultMap" type="com.book.dao.cpsshard.entity.UserRecentlyRead">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="user_id" jdbcType="BIGINT" property="userId" />
-    <result column="book_id" jdbcType="BIGINT" property="bookId" />
-    <result column="chapter_id" jdbcType="BIGINT" property="chapterId" />
-    <result column="chapter_name" jdbcType="VARCHAR" property="chapterName" />
-    <result column="flag" jdbcType="TINYINT" property="flag" />
-    <result column="createtime" jdbcType="INTEGER" property="createtime" />
-    <result column="updatetime" jdbcType="INTEGER" property="updatetime" />
-    <result column="book_shelf_add" jdbcType="TINYINT" property="bookShelfAdd" />
-    <result column="book_shelf_flag" jdbcType="TINYINT" property="bookShelfFlag" />
-  </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 Sun Aug 22 13:51:10 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>
+    <resultMap id="BaseResultMap" type="com.book.dao.cpsshard.entity.UserRecentlyRead">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        <id column="id" jdbcType="INTEGER" property="id"/>
+        <result column="user_id" jdbcType="BIGINT" property="userId"/>
+        <result column="book_id" jdbcType="BIGINT" property="bookId"/>
+        <result column="chapter_id" jdbcType="BIGINT" property="chapterId"/>
+        <result column="chapter_name" jdbcType="VARCHAR" property="chapterName"/>
+        <result column="flag" jdbcType="TINYINT" property="flag"/>
+        <result column="createtime" jdbcType="INTEGER" property="createtime"/>
+        <result column="updatetime" jdbcType="INTEGER" property="updatetime"/>
+        <result column="book_shelf_add" jdbcType="TINYINT" property="bookShelfAdd"/>
+        <result column="book_shelf_flag" jdbcType="TINYINT" property="bookShelfFlag"/>
+    </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 Sun Aug 22 13:51:10 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>
-          </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 Sun Aug 22 13:51:10 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>
+        </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 Sun Aug 22 13:51:10 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>
-          </trim>
+        </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add,
+        book_shelf_flag
+    </sql>
+    <select id="selectByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample"
+            resultMap="BaseResultMap">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select
+        <if test="distinct">
+            distinct
         </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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add, 
-    book_shelf_flag
-  </sql>
-  <select id="selectByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from user_recently_read
-    <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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select
-    <if test="example != null and example.distinct">
-      distinct
-    </if>
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.aliasedEscapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <include refid="Base_Column_List" />
-      </otherwise>
-    </choose>
-    from user_recently_read
-    <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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select 
-    <include refid="Base_Column_List" />
-    from user_recently_read
-    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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.aliasedEscapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <include refid="Base_Column_List" />
-      </otherwise>
-    </choose>
-    from user_recently_read
-    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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    delete from user_recently_read
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    delete from user_recently_read
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into user_recently_read (id, user_id, book_id, 
-      chapter_id, chapter_name, flag, 
-      createtime, updatetime, book_shelf_add, 
-      book_shelf_flag)
-    values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT}, 
-      #{chapterId,jdbcType=BIGINT}, #{chapterName,jdbcType=VARCHAR}, #{flag,jdbcType=TINYINT}, 
-      #{createtime,jdbcType=INTEGER}, #{updatetime,jdbcType=INTEGER}, #{bookShelfAdd,jdbcType=TINYINT}, 
-      #{bookShelfFlag,jdbcType=TINYINT})
-  </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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into user_recently_read
-    <choose>
-      <when test="selective != null and selective.length &gt; 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.userId != null">
-            user_id,
-          </if>
-          <if test="record.bookId != null">
-            book_id,
-          </if>
-          <if test="record.chapterId != null">
-            chapter_id,
-          </if>
-          <if test="record.chapterName != null">
-            chapter_name,
-          </if>
-          <if test="record.flag != null">
-            flag,
-          </if>
-          <if test="record.createtime != null">
-            createtime,
-          </if>
-          <if test="record.updatetime != null">
-            updatetime,
-          </if>
-          <if test="record.bookShelfAdd != null">
-            book_shelf_add,
-          </if>
-          <if test="record.bookShelfFlag != null">
-            book_shelf_flag,
-          </if>
-        </trim>
-        <trim prefix="(" suffix=")" suffixOverrides="," />
-      </otherwise>
-    </choose>
-    values
-    <choose>
-      <when test="selective != null and selective.length &gt; 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.userId != null">
-            #{record.userId,jdbcType=BIGINT},
-          </if>
-          <if test="record.bookId != null">
-            #{record.bookId,jdbcType=BIGINT},
-          </if>
-          <if test="record.chapterId != null">
-            #{record.chapterId,jdbcType=BIGINT},
-          </if>
-          <if test="record.chapterName != null">
-            #{record.chapterName,jdbcType=VARCHAR},
-          </if>
-          <if test="record.flag != null">
-            #{record.flag,jdbcType=TINYINT},
-          </if>
-          <if test="record.createtime != null">
-            #{record.createtime,jdbcType=INTEGER},
-          </if>
-          <if test="record.updatetime != null">
-            #{record.updatetime,jdbcType=INTEGER},
-          </if>
-          <if test="record.bookShelfAdd != null">
-            #{record.bookShelfAdd,jdbcType=TINYINT},
-          </if>
-          <if test="record.bookShelfFlag != null">
-            #{record.bookShelfFlag,jdbcType=TINYINT},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-  </insert>
-  <select id="countByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select count(*) from user_recently_read
-    <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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    update user_recently_read
-    SET
-    <choose>
-      <when test="selective != null and selective.length &gt; 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.userId != null">
-            user_id = #{record.userId,jdbcType=BIGINT},
-          </if>
-          <if test="record.bookId != null">
-            book_id = #{record.bookId,jdbcType=BIGINT},
-          </if>
-          <if test="record.chapterId != null">
-            chapter_id = #{record.chapterId,jdbcType=BIGINT},
-          </if>
-          <if test="record.chapterName != null">
-            chapter_name = #{record.chapterName,jdbcType=VARCHAR},
-          </if>
-          <if test="record.flag != null">
-            flag = #{record.flag,jdbcType=TINYINT},
-          </if>
-          <if test="record.createtime != null">
-            createtime = #{record.createtime,jdbcType=INTEGER},
-          </if>
-          <if test="record.updatetime != null">
-            updatetime = #{record.updatetime,jdbcType=INTEGER},
-          </if>
-          <if test="record.bookShelfAdd != null">
-            book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
-          </if>
-          <if test="record.bookShelfFlag != null">
-            book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
-          </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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    update user_recently_read
-    set id = #{record.id,jdbcType=INTEGER},
-      user_id = #{record.userId,jdbcType=BIGINT},
-      book_id = #{record.bookId,jdbcType=BIGINT},
-      chapter_id = #{record.chapterId,jdbcType=BIGINT},
-      chapter_name = #{record.chapterName,jdbcType=VARCHAR},
-      flag = #{record.flag,jdbcType=TINYINT},
-      createtime = #{record.createtime,jdbcType=INTEGER},
-      updatetime = #{record.updatetime,jdbcType=INTEGER},
-      book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
-      book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT}
-    <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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    update user_recently_read
-    SET
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
-        </foreach>
-      </when>
-      <otherwise>
-        <trim suffixOverrides=",">
-          <if test="record.userId != null">
-            user_id = #{record.userId,jdbcType=BIGINT},
-          </if>
-          <if test="record.bookId != null">
-            book_id = #{record.bookId,jdbcType=BIGINT},
-          </if>
-          <if test="record.chapterId != null">
-            chapter_id = #{record.chapterId,jdbcType=BIGINT},
-          </if>
-          <if test="record.chapterName != null">
-            chapter_name = #{record.chapterName,jdbcType=VARCHAR},
-          </if>
-          <if test="record.flag != null">
-            flag = #{record.flag,jdbcType=TINYINT},
-          </if>
-          <if test="record.createtime != null">
-            createtime = #{record.createtime,jdbcType=INTEGER},
-          </if>
-          <if test="record.updatetime != null">
-            updatetime = #{record.updatetime,jdbcType=INTEGER},
-          </if>
-          <if test="record.bookShelfAdd != null">
-            book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
-          </if>
-          <if test="record.bookShelfFlag != null">
-            book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-    where id = #{record.id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    update user_recently_read
-    set user_id = #{userId,jdbcType=BIGINT},
-      book_id = #{bookId,jdbcType=BIGINT},
-      chapter_id = #{chapterId,jdbcType=BIGINT},
-      chapter_name = #{chapterName,jdbcType=VARCHAR},
-      flag = #{flag,jdbcType=TINYINT},
-      createtime = #{createtime,jdbcType=INTEGER},
-      updatetime = #{updatetime,jdbcType=INTEGER},
-      book_shelf_add = #{bookShelfAdd,jdbcType=TINYINT},
-      book_shelf_flag = #{bookShelfFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <select id="selectOneByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select
-    <include refid="Base_Column_List" />
-    from user_recently_read
-    <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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    select
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.aliasedEscapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <include refid="Base_Column_List" />
-      </otherwise>
-    </choose>
-    from user_recently_read
-    <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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into user_recently_read
-    (id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add, 
-      book_shelf_flag)
-    values
-    <foreach collection="list" item="item" separator=",">
-      (#{item.id,jdbcType=INTEGER}, #{item.userId,jdbcType=BIGINT}, #{item.bookId,jdbcType=BIGINT}, 
-        #{item.chapterId,jdbcType=BIGINT}, #{item.chapterName,jdbcType=VARCHAR}, #{item.flag,jdbcType=TINYINT}, 
-        #{item.createtime,jdbcType=INTEGER}, #{item.updatetime,jdbcType=INTEGER}, #{item.bookShelfAdd,jdbcType=TINYINT}, 
-        #{item.bookShelfFlag,jdbcType=TINYINT})
-    </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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into user_recently_read (
-    <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}
+        <include refid="Base_Column_List"/>
+        from user_recently_read
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause"/>
         </if>
-        <if test="'user_id'.toString() == column.value">
-          #{item.userId,jdbcType=BIGINT}
+        <if test="orderByClause != null">
+            order by ${orderByClause}
         </if>
-        <if test="'book_id'.toString() == column.value">
-          #{item.bookId,jdbcType=BIGINT}
+        <if test="rows != null">
+            <if test="offset != null">
+                limit ${offset}, ${rows}
+            </if>
+            <if test="offset == null">
+                limit ${rows}
+            </if>
         </if>
-        <if test="'chapter_id'.toString() == column.value">
-          #{item.chapterId,jdbcType=BIGINT}
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select
+        <if test="example != null and example.distinct">
+            distinct
         </if>
-        <if test="'chapter_name'.toString() == column.value">
-          #{item.chapterName,jdbcType=VARCHAR}
+        <choose>
+            <when test="selective != null and selective.length &gt; 0">
+                <foreach collection="selective" item="column" separator=",">
+                    ${column.aliasedEscapedColumnName}
+                </foreach>
+            </when>
+            <otherwise>
+                <include refid="Base_Column_List"/>
+            </otherwise>
+        </choose>
+        from user_recently_read
+        <if test="example != null">
+            <include refid="Update_By_Example_Where_Clause"/>
         </if>
-        <if test="'flag'.toString() == column.value">
-          #{item.flag,jdbcType=TINYINT}
+        <if test="example != null and example.orderByClause != null">
+            order by ${example.orderByClause}
         </if>
-        <if test="'createtime'.toString() == column.value">
-          #{item.createtime,jdbcType=INTEGER}
+        <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>
-        <if test="'updatetime'.toString() == column.value">
-          #{item.updatetime,jdbcType=INTEGER}
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select
+        <include refid="Base_Column_List"/>
+        from user_recently_read
+        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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select
+        <choose>
+            <when test="selective != null and selective.length &gt; 0">
+                <foreach collection="selective" item="column" separator=",">
+                    ${column.aliasedEscapedColumnName}
+                </foreach>
+            </when>
+            <otherwise>
+                <include refid="Base_Column_List"/>
+            </otherwise>
+        </choose>
+        from user_recently_read
+        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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        delete from user_recently_read
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <delete id="deleteByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+
+
+        delete from user_recently_read
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause"/>
         </if>
-        <if test="'book_shelf_add'.toString() == column.value">
-          #{item.bookShelfAdd,jdbcType=TINYINT}
+    </delete>
+    <insert id="insert" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into user_recently_read (id, user_id, book_id,
+        chapter_id, chapter_name, flag,
+        createtime, updatetime, book_shelf_add,
+        book_shelf_flag)
+        values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT},
+        #{chapterId,jdbcType=BIGINT}, #{chapterName,jdbcType=VARCHAR}, #{flag,jdbcType=TINYINT},
+        #{createtime,jdbcType=INTEGER}, #{updatetime,jdbcType=INTEGER}, #{bookShelfAdd,jdbcType=TINYINT},
+        #{bookShelfFlag,jdbcType=TINYINT})
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into user_recently_read
+        <choose>
+            <when test="selective != null and selective.length &gt; 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.userId != null">
+                        user_id,
+                    </if>
+                    <if test="record.bookId != null">
+                        book_id,
+                    </if>
+                    <if test="record.chapterId != null">
+                        chapter_id,
+                    </if>
+                    <if test="record.chapterName != null">
+                        chapter_name,
+                    </if>
+                    <if test="record.flag != null">
+                        flag,
+                    </if>
+                    <if test="record.createtime != null">
+                        createtime,
+                    </if>
+                    <if test="record.updatetime != null">
+                        updatetime,
+                    </if>
+                    <if test="record.bookShelfAdd != null">
+                        book_shelf_add,
+                    </if>
+                    <if test="record.bookShelfFlag != null">
+                        book_shelf_flag,
+                    </if>
+                </trim>
+                <trim prefix="(" suffix=")" suffixOverrides=","/>
+            </otherwise>
+        </choose>
+        values
+        <choose>
+            <when test="selective != null and selective.length &gt; 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.userId != null">
+                        #{record.userId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.bookId != null">
+                        #{record.bookId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.chapterId != null">
+                        #{record.chapterId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.chapterName != null">
+                        #{record.chapterName,jdbcType=VARCHAR},
+                    </if>
+                    <if test="record.flag != null">
+                        #{record.flag,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.createtime != null">
+                        #{record.createtime,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.updatetime != null">
+                        #{record.updatetime,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.bookShelfAdd != null">
+                        #{record.bookShelfAdd,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.bookShelfFlag != null">
+                        #{record.bookShelfFlag,jdbcType=TINYINT},
+                    </if>
+                </trim>
+            </otherwise>
+        </choose>
+    </insert>
+    <select id="countByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample"
+            resultType="java.lang.Long">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select count(*) from user_recently_read
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause"/>
         </if>
-        <if test="'book_shelf_flag'.toString() == column.value">
-          #{item.bookShelfFlag,jdbcType=TINYINT}
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        update user_recently_read
+        SET
+        <choose>
+            <when test="selective != null and selective.length &gt; 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.userId != null">
+                        user_id = #{record.userId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.bookId != null">
+                        book_id = #{record.bookId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.chapterId != null">
+                        chapter_id = #{record.chapterId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.chapterName != null">
+                        chapter_name = #{record.chapterName,jdbcType=VARCHAR},
+                    </if>
+                    <if test="record.flag != null">
+                        flag = #{record.flag,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.createtime != null">
+                        createtime = #{record.createtime,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.updatetime != null">
+                        updatetime = #{record.updatetime,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.bookShelfAdd != null">
+                        book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.bookShelfFlag != null">
+                        book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
+                    </if>
+                </trim>
+            </otherwise>
+        </choose>
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause"/>
         </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 Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into user_recently_read
-    <choose>
-      <when test="selective != null and selective.length &gt; 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.userId != null">
-            user_id,
-          </if>
-          <if test="record.bookId != null">
-            book_id,
-          </if>
-          <if test="record.chapterId != null">
-            chapter_id,
-          </if>
-          <if test="record.chapterName != null">
-            chapter_name,
-          </if>
-          <if test="record.flag != null">
-            flag,
-          </if>
-          <if test="record.createtime != null">
-            createtime,
-          </if>
-          <if test="record.updatetime != null">
-            updatetime,
-          </if>
-          <if test="record.bookShelfAdd != null">
-            book_shelf_add,
-          </if>
-          <if test="record.bookShelfFlag != null">
-            book_shelf_flag,
-          </if>
-        </trim>
-        <trim prefix="(" suffix=")" suffixOverrides="," />
-      </otherwise>
-    </choose>
-    values
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach close=")" collection="selective" item="column" open="(" separator=",">
-          #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        update user_recently_read
+        set id = #{record.id,jdbcType=INTEGER},
+        user_id = #{record.userId,jdbcType=BIGINT},
+        book_id = #{record.bookId,jdbcType=BIGINT},
+        chapter_id = #{record.chapterId,jdbcType=BIGINT},
+        chapter_name = #{record.chapterName,jdbcType=VARCHAR},
+        flag = #{record.flag,jdbcType=TINYINT},
+        createtime = #{record.createtime,jdbcType=INTEGER},
+        updatetime = #{record.updatetime,jdbcType=INTEGER},
+        book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
+        book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT}
+        <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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        update user_recently_read
+        SET
+        <choose>
+            <when test="selective != null and selective.length &gt; 0">
+                <foreach collection="selective" item="column" separator=",">
+                    ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
+                </foreach>
+            </when>
+            <otherwise>
+                <trim suffixOverrides=",">
+                    <if test="record.userId != null">
+                        user_id = #{record.userId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.bookId != null">
+                        book_id = #{record.bookId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.chapterId != null">
+                        chapter_id = #{record.chapterId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.chapterName != null">
+                        chapter_name = #{record.chapterName,jdbcType=VARCHAR},
+                    </if>
+                    <if test="record.flag != null">
+                        flag = #{record.flag,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.createtime != null">
+                        createtime = #{record.createtime,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.updatetime != null">
+                        updatetime = #{record.updatetime,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.bookShelfAdd != null">
+                        book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.bookShelfFlag != null">
+                        book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
+                    </if>
+                </trim>
+            </otherwise>
+        </choose>
+        where id = #{record.id,jdbcType=INTEGER}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        update user_recently_read
+        set user_id = #{userId,jdbcType=BIGINT},
+        book_id = #{bookId,jdbcType=BIGINT},
+        chapter_id = #{chapterId,jdbcType=BIGINT},
+        chapter_name = #{chapterName,jdbcType=VARCHAR},
+        flag = #{flag,jdbcType=TINYINT},
+        createtime = #{createtime,jdbcType=INTEGER},
+        updatetime = #{updatetime,jdbcType=INTEGER},
+        book_shelf_add = #{bookShelfAdd,jdbcType=TINYINT},
+        book_shelf_flag = #{bookShelfFlag,jdbcType=TINYINT}
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="selectOneByExample" parameterType="com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample"
+            resultMap="BaseResultMap">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select
+        <include refid="Base_Column_List"/>
+        from user_recently_read
+        <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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        select
+        <choose>
+            <when test="selective != null and selective.length &gt; 0">
+                <foreach collection="selective" item="column" separator=",">
+                    ${column.aliasedEscapedColumnName}
+                </foreach>
+            </when>
+            <otherwise>
+                <include refid="Base_Column_List"/>
+            </otherwise>
+        </choose>
+        from user_recently_read
+        <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>
+    <select id="selectLastGroupByUserId" resultMap="BaseResultMap">
+        select a.*
+        from user_recently_read a,
+             (select user_id, max(updatetime) updatetime
+              from user_recently_read where createtime between #{from} and #{to}
+              group by user_id ) b
+        where a.user_id = b.user_id
+          and a.updatetime = b.updatetime
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into user_recently_read
+        (id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add,
+        book_shelf_flag)
+        values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.id,jdbcType=INTEGER}, #{item.userId,jdbcType=BIGINT}, #{item.bookId,jdbcType=BIGINT},
+            #{item.chapterId,jdbcType=BIGINT}, #{item.chapterName,jdbcType=VARCHAR}, #{item.flag,jdbcType=TINYINT},
+            #{item.createtime,jdbcType=INTEGER}, #{item.updatetime,jdbcType=INTEGER},
+            #{item.bookShelfAdd,jdbcType=TINYINT},
+            #{item.bookShelfFlag,jdbcType=TINYINT})
         </foreach>
-      </when>
-      <otherwise>
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-          <if test="record.id != null">
-            #{record.id,jdbcType=INTEGER},
-          </if>
-          <if test="record.userId != null">
-            #{record.userId,jdbcType=BIGINT},
-          </if>
-          <if test="record.bookId != null">
-            #{record.bookId,jdbcType=BIGINT},
-          </if>
-          <if test="record.chapterId != null">
-            #{record.chapterId,jdbcType=BIGINT},
-          </if>
-          <if test="record.chapterName != null">
-            #{record.chapterName,jdbcType=VARCHAR},
-          </if>
-          <if test="record.flag != null">
-            #{record.flag,jdbcType=TINYINT},
-          </if>
-          <if test="record.createtime != null">
-            #{record.createtime,jdbcType=INTEGER},
-          </if>
-          <if test="record.updatetime != null">
-            #{record.updatetime,jdbcType=INTEGER},
-          </if>
-          <if test="record.bookShelfAdd != null">
-            #{record.bookShelfAdd,jdbcType=TINYINT},
-          </if>
-          <if test="record.bookShelfFlag != null">
-            #{record.bookShelfFlag,jdbcType=TINYINT},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-    on duplicate key update 
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into user_recently_read (
         <foreach collection="selective" item="column" separator=",">
-          ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
+            ${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_id'.toString() == column.value">
+                    #{item.userId,jdbcType=BIGINT}
+                </if>
+                <if test="'book_id'.toString() == column.value">
+                    #{item.bookId,jdbcType=BIGINT}
+                </if>
+                <if test="'chapter_id'.toString() == column.value">
+                    #{item.chapterId,jdbcType=BIGINT}
+                </if>
+                <if test="'chapter_name'.toString() == column.value">
+                    #{item.chapterName,jdbcType=VARCHAR}
+                </if>
+                <if test="'flag'.toString() == column.value">
+                    #{item.flag,jdbcType=TINYINT}
+                </if>
+                <if test="'createtime'.toString() == column.value">
+                    #{item.createtime,jdbcType=INTEGER}
+                </if>
+                <if test="'updatetime'.toString() == column.value">
+                    #{item.updatetime,jdbcType=INTEGER}
+                </if>
+                <if test="'book_shelf_add'.toString() == column.value">
+                    #{item.bookShelfAdd,jdbcType=TINYINT}
+                </if>
+                <if test="'book_shelf_flag'.toString() == column.value">
+                    #{item.bookShelfFlag,jdbcType=TINYINT}
+                </if>
+            </foreach>
+            )
         </foreach>
-      </when>
-      <otherwise>
-        <trim suffixOverrides=",">
-          <if test="record.id != null">
-            id = #{record.id,jdbcType=INTEGER},
-          </if>
-          <if test="record.userId != null">
-            user_id = #{record.userId,jdbcType=BIGINT},
-          </if>
-          <if test="record.bookId != null">
-            book_id = #{record.bookId,jdbcType=BIGINT},
-          </if>
-          <if test="record.chapterId != null">
-            chapter_id = #{record.chapterId,jdbcType=BIGINT},
-          </if>
-          <if test="record.chapterName != null">
-            chapter_name = #{record.chapterName,jdbcType=VARCHAR},
-          </if>
-          <if test="record.flag != null">
-            flag = #{record.flag,jdbcType=TINYINT},
-          </if>
-          <if test="record.createtime != null">
-            createtime = #{record.createtime,jdbcType=INTEGER},
-          </if>
-          <if test="record.updatetime != null">
-            updatetime = #{record.updatetime,jdbcType=INTEGER},
-          </if>
-          <if test="record.bookShelfAdd != null">
-            book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
-          </if>
-          <if test="record.bookShelfFlag != null">
-            book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-  </insert>
-  <insert id="upsert" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Aug 22 13:51:10 CST 2021.
-    -->
-    insert into user_recently_read
-    (id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add, 
-      book_shelf_flag)
-    values
-    (#{id,jdbcType=INTEGER}, #{userId,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT}, #{chapterId,jdbcType=BIGINT}, 
-      #{chapterName,jdbcType=VARCHAR}, #{flag,jdbcType=TINYINT}, #{createtime,jdbcType=INTEGER}, 
-      #{updatetime,jdbcType=INTEGER}, #{bookShelfAdd,jdbcType=TINYINT}, #{bookShelfFlag,jdbcType=TINYINT}
-      )
-    on duplicate key update 
-    id = #{id,jdbcType=INTEGER}, 
-    user_id = #{userId,jdbcType=BIGINT}, 
-    book_id = #{bookId,jdbcType=BIGINT}, 
-    chapter_id = #{chapterId,jdbcType=BIGINT}, 
-    chapter_name = #{chapterName,jdbcType=VARCHAR}, 
-    flag = #{flag,jdbcType=TINYINT}, 
-    createtime = #{createtime,jdbcType=INTEGER}, 
-    updatetime = #{updatetime,jdbcType=INTEGER}, 
-    book_shelf_add = #{bookShelfAdd,jdbcType=TINYINT}, 
-    book_shelf_flag = #{bookShelfFlag,jdbcType=TINYINT}
-  </insert>
+    </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 Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into user_recently_read
+        <choose>
+            <when test="selective != null and selective.length &gt; 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.userId != null">
+                        user_id,
+                    </if>
+                    <if test="record.bookId != null">
+                        book_id,
+                    </if>
+                    <if test="record.chapterId != null">
+                        chapter_id,
+                    </if>
+                    <if test="record.chapterName != null">
+                        chapter_name,
+                    </if>
+                    <if test="record.flag != null">
+                        flag,
+                    </if>
+                    <if test="record.createtime != null">
+                        createtime,
+                    </if>
+                    <if test="record.updatetime != null">
+                        updatetime,
+                    </if>
+                    <if test="record.bookShelfAdd != null">
+                        book_shelf_add,
+                    </if>
+                    <if test="record.bookShelfFlag != null">
+                        book_shelf_flag,
+                    </if>
+                </trim>
+                <trim prefix="(" suffix=")" suffixOverrides=","/>
+            </otherwise>
+        </choose>
+        values
+        <choose>
+            <when test="selective != null and selective.length &gt; 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.userId != null">
+                        #{record.userId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.bookId != null">
+                        #{record.bookId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.chapterId != null">
+                        #{record.chapterId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.chapterName != null">
+                        #{record.chapterName,jdbcType=VARCHAR},
+                    </if>
+                    <if test="record.flag != null">
+                        #{record.flag,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.createtime != null">
+                        #{record.createtime,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.updatetime != null">
+                        #{record.updatetime,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.bookShelfAdd != null">
+                        #{record.bookShelfAdd,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.bookShelfFlag != null">
+                        #{record.bookShelfFlag,jdbcType=TINYINT},
+                    </if>
+                </trim>
+            </otherwise>
+        </choose>
+        on duplicate key update
+        <choose>
+            <when test="selective != null and selective.length &gt; 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.userId != null">
+                        user_id = #{record.userId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.bookId != null">
+                        book_id = #{record.bookId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.chapterId != null">
+                        chapter_id = #{record.chapterId,jdbcType=BIGINT},
+                    </if>
+                    <if test="record.chapterName != null">
+                        chapter_name = #{record.chapterName,jdbcType=VARCHAR},
+                    </if>
+                    <if test="record.flag != null">
+                        flag = #{record.flag,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.createtime != null">
+                        createtime = #{record.createtime,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.updatetime != null">
+                        updatetime = #{record.updatetime,jdbcType=INTEGER},
+                    </if>
+                    <if test="record.bookShelfAdd != null">
+                        book_shelf_add = #{record.bookShelfAdd,jdbcType=TINYINT},
+                    </if>
+                    <if test="record.bookShelfFlag != null">
+                        book_shelf_flag = #{record.bookShelfFlag,jdbcType=TINYINT},
+                    </if>
+                </trim>
+            </otherwise>
+        </choose>
+    </insert>
+    <insert id="upsert" parameterType="com.book.dao.cpsshard.entity.UserRecentlyRead">
+        <!--
+          WARNING - @mbg.generated
+          This element is automatically generated by MyBatis Generator, do not modify.
+          This element was generated on Sun Aug 22 13:51:10 CST 2021.
+        -->
+        insert into user_recently_read
+        (id, user_id, book_id, chapter_id, chapter_name, flag, createtime, updatetime, book_shelf_add,
+        book_shelf_flag)
+        values
+        (#{id,jdbcType=INTEGER}, #{userId,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT}, #{chapterId,jdbcType=BIGINT},
+        #{chapterName,jdbcType=VARCHAR}, #{flag,jdbcType=TINYINT}, #{createtime,jdbcType=INTEGER},
+        #{updatetime,jdbcType=INTEGER}, #{bookShelfAdd,jdbcType=TINYINT}, #{bookShelfFlag,jdbcType=TINYINT}
+        )
+        on duplicate key update
+        id = #{id,jdbcType=INTEGER},
+        user_id = #{userId,jdbcType=BIGINT},
+        book_id = #{bookId,jdbcType=BIGINT},
+        chapter_id = #{chapterId,jdbcType=BIGINT},
+        chapter_name = #{chapterName,jdbcType=VARCHAR},
+        flag = #{flag,jdbcType=TINYINT},
+        createtime = #{createtime,jdbcType=INTEGER},
+        updatetime = #{updatetime,jdbcType=INTEGER},
+        book_shelf_add = #{bookShelfAdd,jdbcType=TINYINT},
+        book_shelf_flag = #{bookShelfFlag,jdbcType=TINYINT}
+    </insert>
 </mapper>

+ 2 - 3
book-push/src/main/java/com/book/push/handler/MenuHandler.java

@@ -39,8 +39,7 @@ public class MenuHandler extends AbstractHandler {
     private UserService userService;
     @Autowired
     private AdminConfigService adminConfigService;
-    @Autowired
-    private PlatformService platformService;
+
     @Lazy
     @Autowired
     private WxThirdPartService wxThirdPartService;
@@ -123,7 +122,7 @@ public class MenuHandler extends AbstractHandler {
      */
     private void addKandian(User user, int kandian) {
         //TODO
-
+        userService.insertKandian(user.getId(),"5",0,kandian);
     }
 
 

+ 4 - 0
book-push/src/main/java/com/book/push/service/dao/BookService.java

@@ -1,6 +1,7 @@
 package com.book.push.service.dao;
 
 import com.book.dao.cps.pojo.AdminConfig;
+import com.book.dao.cps.pojo.Book;
 import com.book.dao.cps.pojo.User;
 
 /**
@@ -14,4 +15,7 @@ public interface BookService {
 
 
     String createBookUrl(Long bookId, AdminConfig adminConfig, User user);
+
+    Book selectById(Long bookId);
+
 }

+ 16 - 0
book-push/src/main/java/com/book/push/service/dao/OrdersService.java

@@ -0,0 +1,16 @@
+package com.book.push.service.dao;
+
+import com.book.dao.cps.pojo.Orders;
+
+import java.util.List;
+
+/**
+ * created in 2021/9/1
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public interface OrdersService {
+    List<Orders> selectNoPayOrderBetweenCreate(Integer from, Integer to);
+}

+ 17 - 0
book-push/src/main/java/com/book/push/service/dao/SignService.java

@@ -0,0 +1,17 @@
+package com.book.push.service.dao;
+
+import com.book.dao.cpsshard.entity.Sign;
+
+import java.util.List;
+
+/**
+ * created in 2021/9/1
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public interface SignService {
+
+ List<Sign> selectAllUserLastSign(Integer from,Integer to);
+}

+ 19 - 0
book-push/src/main/java/com/book/push/service/dao/UserRecentReadService.java

@@ -0,0 +1,19 @@
+package com.book.push.service.dao;
+
+import com.book.dao.cpsshard.entity.UserRecentlyRead;
+
+import java.util.List;
+
+/**
+ * created in 2021/9/1
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public interface UserRecentReadService {
+    UserRecentlyRead selectLastByUserId(long userId);
+
+    List<UserRecentlyRead> selectLastGroupByUserId(Integer from,Integer to);
+
+}

+ 1 - 0
book-push/src/main/java/com/book/push/service/dao/UserService.java

@@ -29,4 +29,5 @@ public interface UserService {
     List<User> selectListByPushMap(Map map);
 
     void updateOperateTimeByOpenid(String openid, Integer operateTime);
+    int insertKandian(Long userId, String type, int kandian, int freeKandian);
 }

+ 14 - 1
book-push/src/main/java/com/book/push/service/dao/impl/BookServiceImpl.java

@@ -1,7 +1,11 @@
 package com.book.push.service.dao.impl;
 
+import com.book.dao.cps.mapper.BookMapper;
 import com.book.dao.cps.pojo.AdminConfig;
+import com.book.dao.cps.pojo.Book;
+import com.book.dao.cps.pojo.Recharge;
 import com.book.dao.cps.pojo.User;
+import com.book.dao.utils.DateUtils;
 import com.book.push.cons.UrlCons;
 import com.book.push.service.dao.BookService;
 import com.book.push.service.dao.OpHostService;
@@ -16,12 +20,21 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class BookServiceImpl implements BookService {
-
+    @Autowired
+    private BookMapper bookMapper;
     @Autowired
     private OpHostService opHostService;
+
     @Override
     public String createBookUrl(Long bookId, AdminConfig adminConfig, User user) {
       return   String.format(UrlCons.BOOK_URL,adminConfig.getAppid(),opHostService.selectById(adminConfig.getOphostId()),UrlCons.MODEL_BOOK,
                 adminConfig.getAdminId(),user.getId(),String.valueOf(bookId));
     }
+
+    @Override
+    public Book selectById(Long bookId) {
+      return  bookMapper.selectByPrimaryKey(bookId);
+    }
+
+
 }

+ 26 - 0
book-push/src/main/java/com/book/push/service/dao/impl/OrdersServiceImpl.java

@@ -0,0 +1,26 @@
+package com.book.push.service.dao.impl;
+
+import com.book.dao.cps.mapper.OrdersMapper;
+import com.book.dao.cps.pojo.Orders;
+import com.book.push.service.dao.OrdersService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * created in 2021/9/1
+ * Project: book-store
+ *
+ * @author win7
+ */
+@Service
+public class OrdersServiceImpl implements OrdersService {
+    @Autowired
+    private OrdersMapper ordersMapper;
+
+    @Override
+    public List<Orders> selectNoPayOrderBetweenCreate(Integer from, Integer to) {
+        return ordersMapper.selectNoPayOrderBetweenCreate(from,to);
+    }
+}

+ 26 - 0
book-push/src/main/java/com/book/push/service/dao/impl/SignServiceImpl.java

@@ -0,0 +1,26 @@
+package com.book.push.service.dao.impl;
+
+import com.book.dao.cpsshard.entity.Sign;
+import com.book.dao.cpsshard.mapper.SignMapper;
+import com.book.push.service.dao.SignService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * created in 2021/9/1
+ * Project: book-store
+ *
+ * @author win7
+ */
+@Service
+public class SignServiceImpl implements SignService {
+    @Autowired
+    private SignMapper signMapper;
+
+    @Override
+    public List<Sign> selectAllUserLastSign(Integer from, Integer to) {
+        return signMapper.selectAllUserLastSign(from,to);
+    }
+}

+ 35 - 0
book-push/src/main/java/com/book/push/service/dao/impl/UserRecentReadServiceImpl.java

@@ -0,0 +1,35 @@
+package com.book.push.service.dao.impl;
+
+import com.book.dao.cpsshard.entity.UserRecentlyRead;
+import com.book.dao.cpsshard.mapper.UserRecentlyReadMapper;
+import com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample;
+import com.book.push.service.dao.UserRecentReadService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * created in 2021/9/1
+ * Project: book-store
+ *
+ * @author win7
+ */
+@Service
+public class UserRecentReadServiceImpl implements UserRecentReadService {
+    @Autowired
+    private UserRecentlyReadMapper userRecentlyReadMapper;
+
+    @Override
+    public UserRecentlyRead selectLastByUserId(long userId) {
+        UserRecentlyReadExample example = UserRecentlyReadExample.newAndCreateCriteria()
+                .andUserIdEqualTo(userId).example().orderBy(UserRecentlyRead.Column.updatetime.desc()).limit(1);
+        return userRecentlyReadMapper.selectOneByExample(example);
+    }
+
+    @Override
+    public List<UserRecentlyRead> selectLastGroupByUserId(Integer from,Integer to) {
+
+        return userRecentlyReadMapper.selectLastGroupByUserId(from, to);
+    }
+}

+ 54 - 1
book-push/src/main/java/com/book/push/service/dao/impl/UserServiceImpl.java

@@ -1,8 +1,12 @@
 package com.book.push.service.dao.impl;
 
+import com.book.dao.cps.mapper.RechargeMapper;
 import com.book.dao.cps.mapper.UserMapper;
 import com.book.dao.cps.pojo.AdminConfig;
+import com.book.dao.cps.pojo.Recharge;
 import com.book.dao.cps.pojo.User;
+import com.book.dao.cps.pojo.example.RechargeExample;
+import com.book.dao.utils.DateUtils;
 import com.book.push.service.dao.AdminConfigService;
 import com.book.push.service.dao.UserService;
 import me.chanjar.weixin.mp.bean.result.WxMpUser;
@@ -24,6 +28,8 @@ public class UserServiceImpl implements UserService {
     private UserMapper userMapper;
     @Autowired
     private AdminConfigService adminConfigService;
+    @Autowired
+    private RechargeMapper rechargeMapper;
 
     @Override
     public User selectUserByUser(User user) {
@@ -80,6 +86,53 @@ public class UserServiceImpl implements UserService {
 
     @Override
     public void updateOperateTimeByOpenid(String openid, Integer operateTime) {
-        userMapper.updateOperateTimeByOpenid(openid,operateTime);
+        userMapper.updateOperateTimeByOpenid(openid, operateTime);
+    }
+
+    @Override
+    public int insertKandian(Long userId, String type, int kandian, int freeKandian) {
+
+        // 签到看点
+        rechargeMapper.insertSelective(
+                Recharge.builder()
+                        .userId(userId)
+                        .type(type)
+                        .kandian(kandian)
+                        .freeKandian(freeKandian)
+                        .remainFreeKandian(freeKandian)
+                        .freeEndtime(DateUtils.get3DayAfter())
+                        .createtime(DateUtils.getNow())
+                        .updatetime(DateUtils.getNow())
+                        .build()
+        );
+        int freeCount = getFreeCountFromCharges(getFreeCharges(userId));
+
+        // 更新到用户
+        User user = selectById(userId);
+        User user1 = new User();
+        user1.setKandian(user.getKandian() + kandian);
+        user1.setFreeKandian(freeCount);
+        int i = userMapper.updateByPrimaryKeySelective(user1);
+
+        return i;
+    }
+
+    public List<Recharge> getFreeCharges(Long userId) {
+        RechargeExample example = RechargeExample.newAndCreateCriteria()
+                .andUserIdEqualTo(userId)
+                .andFreeEndtimeGreaterThan(DateUtils.getNow())
+                .andRemainFreeKandianGreaterThan(0)
+                .example();
+        example.orderBy(Recharge.Column.freeEndtime.desc());
+        List<Recharge> freeRecharges = rechargeMapper.selectByExample(example);
+        return freeRecharges;
+    }
+
+    public int getFreeCountFromCharges(List<Recharge> freeRecharges) {
+        Integer freeCount = 0;
+        if (freeRecharges != null) {
+            freeCount = freeRecharges.stream().mapToInt(x -> x.getFreeKandian()).sum();
+        }
+        return freeCount;
     }
 }

+ 78 - 0
book-push/src/main/java/com/book/push/task/NoPayTask.java

@@ -0,0 +1,78 @@
+package com.book.push.task;
+
+import com.book.dao.cps.pojo.AdminConfig;
+import com.book.dao.cps.pojo.Book;
+import com.book.dao.cps.pojo.Orders;
+import com.book.dao.cps.pojo.User;
+import com.book.dao.cpsshard.entity.UserRecentlyRead;
+import com.book.dao.utils.DateUtils;
+import com.book.push.service.dao.*;
+import com.book.push.service.push.PushService;
+import com.book.push.service.wx.WxThirdPartService;
+import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
+import me.chanjar.weixin.mp.builder.kefu.TextBuilder;
+import me.chanjar.weixin.open.api.WxOpenMpService;
+import me.chanjar.weixin.open.api.WxOpenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * created in 2021/9/1
+ * Project: book-store
+ *
+ * @author win7
+ */
+@Component
+public class NoPayTask {
+    @Autowired
+    private OrdersService ordersService;
+    @Autowired
+    private AdminConfigService adminConfigService;
+    @Autowired
+    private WxThirdPartService wxThirdPartService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private PushService pushService;
+    @Autowired
+    private UserRecentReadService userRecentReadService;
+    @Autowired
+    private BookService bookService;
+
+    @Scheduled(fixedRate = 1000 * 60 * 5)
+    public void run() {
+        Integer from = DateUtils.getNow() - 24 * 60 * 60;
+        Integer to = from + (5 * 60);
+        List<Orders> orders = ordersService.selectNoPayOrderBetweenCreate(from, to);
+        if (orders == null) {
+            return;
+        }
+        for(Orders o:orders) {
+            Integer adminId = o.getAdminId();
+            Long userId = o.getUserId();
+            AdminConfig adminConfig = adminConfigService.selectByAdminId(adminId);
+            if (adminConfig.getUnpayTip().equals("0")){
+                continue;
+            }
+            User user = userService.selectById(userId);
+            String openid = user.getOpenid();
+            String appid = adminConfig.getAppid();
+            Integer platformId = adminConfig.getPlatformId();
+            WxOpenService wxOpenService = wxThirdPartService.getWxOpenServiceByPlatFormId(platformId);
+            WxOpenMpService wxMpService = wxOpenService.getWxOpenComponentService().getWxMpServiceByAppid(appid);
+            String msg = "亲,你上次看的书还在等着你呐~ 点击继续阅读%n>%s&n首冲50元即可畅读90万字,365元年份会员更可全年无线畅读。%n%n为了下次方便阅读,请置顶公众号";
+            UserRecentlyRead userRecentlyRead = userRecentReadService.selectLastByUserId(userId);
+            Long bookId = userRecentlyRead.getBookId();
+            String url =bookService.createBookUrl(bookId,adminConfig,user);
+            Book book = bookService.selectById(bookId);
+            String link = "<a href='"+url+"'>《"+book.getName()+"》</a>";
+            msg = String.format(msg,link);
+            WxMpKefuMessage wxMpKefuMessage = new TextBuilder().toUser(user.getOpenid()).content(msg).build();
+            pushService.addWxKefuMessagePushTask(wxMpService, wxMpKefuMessage, to - (o.getCreatetime()));
+        }
+
+    }
+}

+ 69 - 0
book-push/src/main/java/com/book/push/task/NoSignTask.java

@@ -0,0 +1,69 @@
+package com.book.push.task;
+
+import com.book.dao.cps.pojo.AdminConfig;
+import com.book.dao.cps.pojo.User;
+import com.book.dao.cpsshard.entity.Sign;
+import com.book.dao.cpsshard.entity.UserRecentlyRead;
+import com.book.dao.utils.DateUtils;
+import com.book.push.service.dao.*;
+import com.book.push.service.push.PushService;
+import com.book.push.service.wx.WxThirdPartService;
+import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
+import me.chanjar.weixin.mp.builder.kefu.TextBuilder;
+import me.chanjar.weixin.open.api.WxOpenMpService;
+import me.chanjar.weixin.open.api.WxOpenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * created in 2021/9/1
+ * Project: book-store
+ *
+ * @author win7
+ */
+@Component
+public class NoSignTask {
+    @Autowired
+    private AdminConfigService adminConfigService;
+    @Autowired
+    private WxThirdPartService wxThirdPartService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private SignService signService;
+
+    @Autowired
+    private UserRecentReadService userRecentReadService;
+    @Autowired
+    private PushService pushService;
+    @Autowired
+    private BookService bookService;
+
+    @Scheduled(fixedRate = 1000 * 60 * 30)
+    public void run() {
+        Integer from = DateUtils.getNow() - 24 * 60 * 60;
+        Integer to = from + (30 * 60);
+        List<Sign> list = signService.selectAllUserLastSign(from,to);
+        for(Sign sign:list){
+            Integer uid = sign.getUid();
+            User user = userService.selectById(uid.longValue());
+            Integer channelId = user.getChannelId();
+            AdminConfig adminConfig = adminConfigService.selectByAdminId(channelId);
+           /* if (adminConfig.getSignTip().equals("0")){
+                continue;
+            }*/
+            String openid = user.getOpenid();
+            String appid = adminConfig.getAppid();
+            Integer platformId = adminConfig.getPlatformId();
+            WxOpenService wxOpenService = wxThirdPartService.getWxOpenServiceByPlatFormId(platformId);
+            WxOpenMpService wxMpService = wxOpenService.getWxOpenComponentService().getWxMpServiceByAppid(appid);
+            String msg = String.format("亲,您今天还没有签到哦,点击%n签到即可领取书币哟~%n%n<a href='weixin://bizmsgmenu?msgmenucontent=签到&msgmenuid=0'>点我签到</a>%n%n为了方便下次阅读,请置顶公众号");
+            WxMpKefuMessage wxMpKefuMessage = new TextBuilder().toUser(user.getOpenid()).content(msg).build();
+            pushService.addWxKefuMessagePushTask(wxMpService, wxMpKefuMessage, to - (sign.getCreatetime()));
+
+        }
+    }
+}

+ 71 - 0
book-push/src/main/java/com/book/push/task/RecentReadTask.java

@@ -0,0 +1,71 @@
+package com.book.push.task;
+
+import com.book.dao.cps.pojo.AdminConfig;
+import com.book.dao.cps.pojo.Book;
+import com.book.dao.cps.pojo.User;
+import com.book.dao.cpsshard.entity.UserRecentlyRead;
+import com.book.dao.utils.DateUtils;
+import com.book.push.service.dao.AdminConfigService;
+import com.book.push.service.dao.BookService;
+import com.book.push.service.dao.UserRecentReadService;
+import com.book.push.service.dao.UserService;
+import com.book.push.service.push.PushService;
+import com.book.push.service.wx.WxThirdPartService;
+import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
+import me.chanjar.weixin.mp.builder.kefu.TextBuilder;
+import me.chanjar.weixin.open.api.WxOpenMpService;
+import me.chanjar.weixin.open.api.WxOpenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * created in 2021/9/1
+ * Project: book-store
+ *
+ * @author win7
+ */
+@Component
+
+public class RecentReadTask {
+    @Autowired
+    private AdminConfigService adminConfigService;
+    @Autowired
+    private WxThirdPartService wxThirdPartService;
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private UserRecentReadService userRecentReadService;
+    @Autowired
+    private PushService pushService;
+    @Autowired
+    private BookService bookService;
+
+    @Scheduled(fixedRate = 1000 * 60 * 4)
+    public void run() {
+        Integer from = DateUtils.getNow() - 7 * 60 * 60;
+        Integer to = from + (4 * 60);
+        List<UserRecentlyRead> list = userRecentReadService.selectLastGroupByUserId(from,to);
+        for (UserRecentlyRead userRecentlyRead : list) {
+            Long userId = userRecentlyRead.getUserId();
+            User user = userService.selectById(userId);
+            Integer channelId = user.getChannelId();
+            AdminConfig adminConfig = adminConfigService.selectByAdminId(channelId);
+            Integer platformId = adminConfig.getPlatformId();
+            String appid = adminConfig.getAppid();
+            Book book = bookService.selectById(userRecentlyRead.getBookId());
+            WxOpenService wxOpenService = wxThirdPartService.getWxOpenServiceByPlatFormId(platformId);
+            WxOpenMpService wxMpService = wxOpenService.getWxOpenComponentService().getWxMpServiceByAppid(appid);
+            String msg = "亲,你上次看的书还在等着你呐~ 点击继续阅读%n>%s&n首冲50元即可畅读90万字,365元年份会员更可全年无线畅读。%n%n为了下次方便阅读,请置顶公众号";
+            Long bookId = userRecentlyRead.getBookId();
+            String url = bookService.createBookUrl(bookId, adminConfig, user);
+            String link = "<a href='" + url + "'>《" + book.getName() + "》</a>";
+            msg = String.format(msg, link);
+            WxMpKefuMessage wxMpKefuMessage = new TextBuilder().toUser(user.getOpenid()).content(msg).build();
+            pushService.addWxKefuMessagePushTask(wxMpService, wxMpKefuMessage, to - (userRecentlyRead.getUpdatetime()));
+        }
+    }
+}

+ 108 - 37
book-push/src/main/resources/application-pro.yml

@@ -1,12 +1,13 @@
 server:
   port: 16063
+
 book:
   debug: true
   redis:
-    host: 121.41.100.198
+    host: r-bp1fhw9pqpgtfnu638.redis.rds.aliyuncs.com
     port: 6379
     database: 0
-    password: wrfg6OTNaXTqd96H7TK7bYIV
+    password: 5uUL$V!UBsVPf+9P$q4Y
     timeout: 1000  # 数据库连接超时时间,2.0 中该参数的类型为Duration,这里在配置的时候需要指明单位
     # 最大空闲连接数
     maxIdle: 500
@@ -17,46 +18,116 @@ book:
     # 最大活跃连接数,负数为不限制
     maxActive: -1
     #  最大连接数
+
 spring:
   datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://121.41.100.198:3306/test_cps?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
-    username: root
-    password: root
-    #下面为连接池补充设置
-    druid:
-      initial-size: 5 # 初始化
-      max-active: 5 # 最大
-      min-idle: 5 # 最小
-      max-wait: 6000 # 超时时间
-      time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
-      min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
-      # 检测链接是否有效的query
-      validation-query: SELECT 1 FROM DUAL
-      test-while-idle: true # 检测到链接空闲时,验证是否有效
-      test-on-borrow: false # 申请链接时,不检测
-      test-on-return: false # 返回链接时,不检测
-      pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
-      # 如果上面开启了游标,这里要设置一下大小,例如 50
-      max-pool-prepared-statement-per-connection-size: -1
-      # 统计、监控配置
-      filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-      # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
-      connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
-      use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
-      stat-view-servlet:
-        enabled: true
-        login-username: tianyun
-        login-password: tianyunperfect
-        allow: # 默认运行所有
-        deny: # 默认即可
-        reset-enable: true
+    cps:
+      type: com.alibaba.druid.pool.DruidDataSource
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      jdbc-url: jdbc:mysql://rm-bp1978b18gyf7v7by.mysql.rds.aliyuncs.com:3306/test_cps?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
+      username: test_cps
+      password: oRt+rY(7x3&kB#OQdit9
+      #下面为连接池补充设置
+      druid:
+        initial-size: 5 # 初始化
+        max-active: 5 # 最大
+        min-idle: 5 # 最小
+        max-wait: 6000 # 超时时间
+        time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
+        min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
+        # 检测链接是否有效的query
+        validation-query: SELECT 1 FROM DUAL
+        test-while-idle: true # 检测到链接空闲时,验证是否有效
+        test-on-borrow: false # 申请链接时,不检测
+        test-on-return: false # 返回链接时,不检测
+        pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
+        # 如果上面开启了游标,这里要设置一下大小,例如 50
+        max-pool-prepared-statement-per-connection-size: -1
+        # 统计、监控配置
+        filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
+        connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
+        use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
+        stat-view-servlet:
+          enabled: true
+          login-username: tianyun
+          login-password: tianyunperfect
+          allow: # 默认运行所有
+          deny: # 默认即可
+          reset-enable: true
+    polar:
+      type: com.alibaba.druid.pool.DruidDataSource
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      jdbc-url: jdbc:mysql://rm-bp1978b18gyf7v7by.mysql.rds.aliyuncs.com:3306/polardb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
+      username: test_cps
+      password: oRt+rY(7x3&kB#OQdit9
+      #下面为连接池补充设置
+      druid:
+        initial-size: 5 # 初始化
+        max-active: 5 # 最大
+        min-idle: 5 # 最小
+        max-wait: 6000 # 超时时间
+        time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
+        min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
+        # 检测链接是否有效的query
+        validation-query: SELECT 1 FROM DUAL
+        test-while-idle: true # 检测到链接空闲时,验证是否有效
+        test-on-borrow: false # 申请链接时,不检测
+        test-on-return: false # 返回链接时,不检测
+        pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
+        # 如果上面开启了游标,这里要设置一下大小,例如 50
+        max-pool-prepared-statement-per-connection-size: -1
+        # 统计、监控配置
+        filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
+        connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
+        use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
+        stat-view-servlet:
+          enabled: true
+          login-username: tianyun
+          login-password: tianyunperfect
+          allow: # 默认运行所有
+          deny: # 默认即可
+          reset-enable: true
+    cpsshard:
+      type: com.alibaba.druid.pool.DruidDataSource
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      jdbc-url: jdbc:mysql://rm-bp1978b18gyf7v7by.mysql.rds.aliyuncs.com:3306/test_cps_shard?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
+      username: test_cps
+      password: oRt+rY(7x3&kB#OQdit9
+      #下面为连接池补充设置
+      druid:
+        initial-size: 5 # 初始化
+        max-active: 5 # 最大
+        min-idle: 5 # 最小
+        max-wait: 6000 # 超时时间
+        time-between-eviction-runs-millis: 60000 # 每分钟检查一次空闲链接
+        min-evictable-idle-time-millis: 300000 # 空闲链接可以保持多久而不被驱逐
+        # 检测链接是否有效的query
+        validation-query: SELECT 1 FROM DUAL
+        test-while-idle: true # 检测到链接空闲时,验证是否有效
+        test-on-borrow: false # 申请链接时,不检测
+        test-on-return: false # 返回链接时,不检测
+        pool-prepared-statements: false # 是否缓存preparedStatement,oracle打开,mysql关闭
+        # 如果上面开启了游标,这里要设置一下大小,例如 50
+        max-pool-prepared-statement-per-connection-size: -1
+        # 统计、监控配置
+        filters: stat,wall # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        # 合并执行的相同sql,避免因为参数不同而统计多条sql语句;开启慢sql记录
+        connect-properties: config.stat.mergeSql=true;config.stat.slowSqlMillis=500
+        use-global-data-source-stat: true # 合并多个DruidDataSource的监控数据
+        stat-view-servlet:
+          enabled: true
+          login-username: tianyun
+          login-password: tianyunperfect
+          allow: # 默认运行所有
+          deny: # 默认即可
+          reset-enable: true
 
 
 mybatis:
-  type-aliases-package: com.book.server.entity
-  mapper-locations: classpath:mapper/*Mapper.xml
+  configuration:
+    map-underscore-to-camel-case: true
 
 
 # 设置debug模式下打印mysql

+ 12 - 12
book-push/src/main/resources/application-test.yml

@@ -1,13 +1,13 @@
 server:
-  port: 8080
+  port: 16063
 
 book:
   debug: true
   redis:
-    host: r-bp1fhw9pqpgtfnu638pd.redis.rds.aliyuncs.com
+    host: r-bp1fhw9pqpgtfnu638.redis.rds.aliyuncs.com
     port: 6379
     database: 0
-    password: 5uUL$V!UBsVPf+9P$q4Y
+    password: wrfg6OTNaXTqd96H7TK7bYIV
     timeout: 1000  # 数据库连接超时时间,2.0 中该参数的类型为Duration,这里在配置的时候需要指明单位
     # 最大空闲连接数
     maxIdle: 500
@@ -24,9 +24,9 @@ spring:
     cps:
       type: com.alibaba.druid.pool.DruidDataSource
       driver-class-name: com.mysql.cj.jdbc.Driver
-      jdbc-url: jdbc:mysql://rm-bp1978b18gyf7v7byzo.mysql.rds.aliyuncs.com:3306/test_cps?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
-      username: test_cps
-      password: oRt+rY(7x3&kB#OQdit9
+      jdbc-url: jdbc:mysql://121.41.100.198:3306/test_cps?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
+      username: root
+      password: root
       #下面为连接池补充设置
       druid:
         initial-size: 5 # 初始化
@@ -58,9 +58,9 @@ spring:
     polar:
       type: com.alibaba.druid.pool.DruidDataSource
       driver-class-name: com.mysql.cj.jdbc.Driver
-      jdbc-url: jdbc:mysql://rm-bp1978b18gyf7v7byzo.mysql.rds.aliyuncs.com:3306/polar?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
-      username: test_cps
-      password: oRt+rY(7x3&kB#OQdit9
+      jdbc-url: jdbc:mysql://121.41.100.198:3306/polar?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
+      username: root
+      password: root
       #下面为连接池补充设置
       druid:
         initial-size: 5 # 初始化
@@ -92,9 +92,9 @@ spring:
     cpsshard:
       type: com.alibaba.druid.pool.DruidDataSource
       driver-class-name: com.mysql.cj.jdbc.Driver
-      jdbc-url: jdbc:mysql://rm-bp1978b18gyf7v7byzo.mysql.rds.aliyuncs.com:3306/test_cps_shard?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
-      username: test_cps
-      password: oRt+rY(7x3&kB#OQdit9
+      jdbc-url: jdbc:mysql://121.41.100.198:3306/test_cps_shard_192?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
+      username: root
+      password: root
       #下面为连接池补充设置
       druid:
         initial-size: 5 # 初始化

+ 1 - 1
book-push/src/main/resources/application.yml

@@ -1,4 +1,4 @@
 spring:
   # 环境 dev:开发环境|test:测试环境|prod:生产环境
   profiles:
-    active: test #激活的配置文件
+    active: pro #激活的配置文件

+ 1 - 0
book-server/src/main/java/com/book/server/service/BookService.java

@@ -40,4 +40,5 @@ public interface BookService {
     Result<BookContent> getContentByContentId2(BookContentVO bookContentVO);
 
     Boolean updateBookContent(BookContentVO bookContentVO);
+    int insertKandian(Long userId, String type, int kandian, int freeKandian);
 }

+ 1 - 0
book-server/src/main/java/com/book/server/service/impl/BookServiceImpl.java

@@ -787,6 +787,7 @@ public class BookServiceImpl implements BookService {
      * @param freeKandian
      * @return
      */
+    @Override
     public int insertKandian(Long userId, String type, int kandian, int freeKandian) {
         // 签到看点
         rechargeMapper.insertSelective(

+ 26 - 24
book-server/src/main/java/com/book/server/service/impl/WxPayServiceImpl.java

@@ -6,6 +6,7 @@ import com.book.dao.cps.entity.Goods;
 import com.book.dao.cps.mapper.*;
 import com.book.dao.cps.pojo.*;
 import com.book.dao.utils.DateUtils;
+import com.book.server.service.BookService;
 import com.book.server.service.UserService;
 import com.book.server.service.WxPayService;
 import com.book.server.utils.DataUtil;
@@ -47,6 +48,10 @@ public class WxPayServiceImpl implements WxPayService {
     private RechargeMapper rechargeMapper;
     @Autowired
     private WxpayMapper wxpayMapper;
+    @Autowired
+    private BookService bookService;
+    @Autowired
+    private AdminExtendMapper adminExtendMapper;
 
     @Override
     public WxPayInfo createOrder(WxPayRequest wxPayRequest) {
@@ -75,8 +80,9 @@ public class WxPayServiceImpl implements WxPayService {
         Ophost ophost = ophostMapper.selectByPrimaryKey(ophostId);
         Config url_pay = configMapper.selectByName("url_pay");
         String url = url_pay.getValue();
+        AdminExtend adminExtend = adminExtendMapper.selectByPrimaryKey(channelId);
         //todo 入库
-        long orderid = TimeUnit.NANOSECONDS.convert(System.currentTimeMillis(), TimeUnit.SECONDS) + wxPayRequest.getUserId();
+        long orderid = TimeUnit.NANOSECONDS.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + wxPayRequest.getUserId();
         Orders order = new Orders();
         order.setUserId(userByUserId.getId());
         order.setAdminId(channelId);
@@ -94,16 +100,20 @@ public class WxPayServiceImpl implements WxPayService {
         order.setCreatetime(DateUtils.getNow());
         order.setPaymentMethod(true);
         order.setChannelId(channelId);
-    order.setState("0");
-    order.setActivityId(0);
-    order.setDeduct(false);
-    order.setRewardAdminId(0);
-    order.setChannelBenefit(new BigDecimal(1));
-    order.setGroup(new Byte((byte)3));
-    order.setMark(0);
-    order.setChannelBenefitMoney(new BigDecimal(1));
-        HashMap<String, String> map = new HashMap();
+        order.setState("0");
+        order.setActivityId(0);
+        order.setDeduct(false);
+        order.setRewardAdminId(0);
+        order.setGroup(new Byte((byte) 3));
+        order.setMark(0);
+        order.setChannelBenefit(adminExtend.getBenefit());
+        order.setChannelBenefitMoney(money.multiply(adminExtend.getBenefit()));
+
+        order.setMoneyBenefit(money.multiply(adminExtend.getBenefit()));
+        order.setBenefit(adminExtend.getBenefit());
 
+        HashMap<String, String> map = new HashMap();
+        int a = money.multiply(new BigDecimal(100)).intValue();
 
         map.put("appid", palmpayAppid);
         map.put("mchId", palmpayMchid);
@@ -113,7 +123,7 @@ public class WxPayServiceImpl implements WxPayService {
         map.put("productName", goods.getTitle());
         map.put("productDesc", goods.getTitle());
         map.put("outTradeNo", orderid + "");
-        map.put("money", amount);
+        map.put("money", a + "");
         map.put("callbackUrl", String.format("http://%s.%s/home.html#/center?userId=%s&channelId=%s",
                 adminConfig.getAppid(), ophost.getHost(), wxPayRequest.getUserId(), adminConfig.getAdminId()));
         map.put("notifyUrl", url + "/api/wxpay/notify");
@@ -125,7 +135,7 @@ public class WxPayServiceImpl implements WxPayService {
         map.put("api", "1");
 
 
-        String str = palmpayAppid + "WECHAT_SUB" + money + orderid + palmpayAppkey;
+        String str = palmpayAppid + "WECHAT_SUB" + a + orderid + palmpayAppkey;
 
         String sign = Md5Util.md5(str);
         // sign = generalSign(map,md5key);
@@ -145,11 +155,10 @@ public class WxPayServiceImpl implements WxPayService {
         PalmpayResponse.Result r = object.getResult();
         order.setPdorderid(r.getPdorderid());
         order.setPayJson(r.getPay_info());*/
-        order.setMoneyBenefit(new BigDecimal(0));
-        order.setBenefit(new BigDecimal(1.00));
+
         ordersMapper.insert(order);
         WxPayInfo wxPayInfo = new WxPayInfo();
-        wxPayInfo.setUserId(userByUserId.getId()+"");
+        wxPayInfo.setUserId(userByUserId.getId() + "");
         wxPayInfo.setUrl(PALMPAY_URL + "?" + form);
         wxPayInfo.setOrderId(order.getOutTradeNo());
         return wxPayInfo;
@@ -192,18 +201,11 @@ public class WxPayServiceImpl implements WxPayService {
                 orders.setUpdatetime(DateUtils.getNow());
                 orders.setFinishtime(DateUtils.getNow());
                 ordersMapper.updateByOutTradeNo(outTradeNo);
+                bookService.insertKandian(order.getUserId(), "1", order.getKandian(), order.getFreeKandian());
             }
 
 
-            //TODO 看点
-            Recharge recharge = new Recharge();
-            recharge.setUserId(order.getUserId());
-            recharge.setKandian(order.getKandian());
-            recharge.setFreeKandian(order.getKandian());
-            recharge.setType("1");
-            recharge.setRemainFreeKandian(order.getFreeKandian());
-            recharge.setCreatetime(DateUtils.getNow());
-            rechargeMapper.insert(recharge);
+
 
 
         }