zhangyuewww 2 роки тому
батько
коміт
b15e889e70

+ 4 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/SpeedCustomerInfoController.java

@@ -23,7 +23,7 @@ public class SpeedCustomerInfoController {
 
 
     /**
-     * 极速版费用信息列表
+     * 极速版客户信息列表
      * @param speedCustomerInfo
      * @return
      */
@@ -32,7 +32,7 @@ public class SpeedCustomerInfoController {
         return speedCustomerInfoService.selectInfo(speedCustomerInfo);
     }
     /**
-     * 添加极速版费用信息
+     * 添加极速版客户信息
      * @param speedCustomerInfo
      * @return
      */
@@ -41,7 +41,7 @@ public class SpeedCustomerInfoController {
         return speedCustomerInfoService.addInfo(speedCustomerInfo);
     }
     /**
-     * 删除极速版费用信息
+     * 删除极速版客户信息
      * @param speedCustomerInfo
      */
     @PostMapping("/api/deleteInfo")
@@ -49,7 +49,7 @@ public class SpeedCustomerInfoController {
         speedCustomerInfoService.deleteInfo(speedCustomerInfo.getId());
     }
     /**
-     * 编辑极速版费用信息
+     * 编辑极速版客户信息
      * @param speedCustomerInfo
      * @return
      */

+ 6 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/SpeedCustomerInfo.java

@@ -2,6 +2,7 @@ package com.yh.saas.plugin.yiliangyiyun.entity;
 
 import java.io.Serializable;
 
+import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 
 import com.baomidou.mybatisplus.annotations.TableName;
@@ -56,7 +57,11 @@ public class SpeedCustomerInfo extends BaseModel<SpeedCustomerInfo> {
      * 开户支行
      */
     private String bankDepositBranch;
-
+    /**
+     * 模糊查询
+     */
+    @TableField(exist = false)
+    private String searchKeyWord;
 
     @Override
     protected Serializable pkVal() {

+ 23 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/SpeedExpenseInfo.java

@@ -1,15 +1,19 @@
 package com.yh.saas.plugin.yiliangyiyun.entity;
 
 import java.io.Serializable;
+import java.util.Date;
 
+import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 
 import com.baomidou.mybatisplus.annotations.TableName;
 import com.baomidou.mybatisplus.enums.IdType;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.yh.saas.common.support.entity.BaseModel;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * <p>
@@ -56,7 +60,25 @@ public class SpeedExpenseInfo extends BaseModel<SpeedExpenseInfo> {
      * 附件地址
      */
     private String addressUrl;
-
+    /**
+     * 模糊查询
+     */
+    @TableField(exist = false)
+    private String searchKeyWord;
+    /**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private Date startDate;
+    /**
+     * 结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private Date endDate;
 
     @Override
     protected Serializable pkVal() {

+ 6 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/SpeedCustomerInfoMapper.java

@@ -3,6 +3,9 @@ package com.yh.saas.plugin.yiliangyiyun.mapper;
 import com.yh.saas.plugin.yiliangyiyun.entity.SpeedCustomerInfo;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 记录极速版客户信息 Mapper 接口
@@ -13,4 +16,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
  */
 public interface SpeedCustomerInfoMapper extends BaseMapper<SpeedCustomerInfo> {
 
+    Integer getCountByCondition(Map<String, Object> pageView);
+
+    List<SpeedCustomerInfo> getListByCondition(Map<String, Object> pageView);
 }

+ 6 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/SpeedExpenseInfoMapper.java

@@ -3,6 +3,9 @@ package com.yh.saas.plugin.yiliangyiyun.mapper;
 import com.yh.saas.plugin.yiliangyiyun.entity.SpeedExpenseInfo;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 记录极速版费用信息 Mapper 接口
@@ -13,4 +16,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
  */
 public interface SpeedExpenseInfoMapper extends BaseMapper<SpeedExpenseInfo> {
 
+    Integer getCountByCondition(Map<String, Object> pageView);
+
+    List<SpeedExpenseInfo> getListByCondition(Map<String, Object> pageView);
 }

+ 22 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/SpeedCustomerInfoServiceImpl.java

@@ -1,13 +1,19 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 import com.baomidou.mybatisplus.plugins.Page;
+import com.google.common.collect.Lists;
 import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.yiliangyiyun.entity.SalePlanInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.SpeedCustomerInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.SpeedCustomerInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ISpeedCustomerInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 记录极速版客户信息 服务实现类
@@ -21,7 +27,22 @@ public class SpeedCustomerInfoServiceImpl extends ServiceImpl<SpeedCustomerInfoM
 
     @Override
     public Page<SpeedCustomerInfo> selectInfo(SpeedCustomerInfo speedCustomerInfo) {
-        return null;
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("startRecord", (speedCustomerInfo.getCurrentPage() - 1)
+                * speedCustomerInfo.getPageSize());
+        //公司id
+        pageView.put("compId", speedCustomerInfo.getCompId());
+        pageView.put("searchKeyWord", speedCustomerInfo.getSearchKeyWord());
+        pageView.put("pageSize", speedCustomerInfo.getPageSize());
+        pageView.put("currentPage", speedCustomerInfo.getCurrentPage());
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<SpeedCustomerInfo> dataList = baseMapper.getListByCondition(pageView);
+        Page<SpeedCustomerInfo> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(speedCustomerInfo.getCurrentPage());
+        page.setSize(speedCustomerInfo.getPageSize());
+        return page;
     }
 
     @Override

+ 25 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/SpeedExpenseInfoServiceImpl.java

@@ -1,13 +1,19 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 import com.baomidou.mybatisplus.plugins.Page;
+import com.google.common.collect.Lists;
 import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.yiliangyiyun.entity.SpeedCustomerInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.SpeedExpenseInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.SpeedExpenseInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.ISpeedExpenseInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 记录极速版费用信息 服务实现类
@@ -21,7 +27,25 @@ public class SpeedExpenseInfoServiceImpl extends ServiceImpl<SpeedExpenseInfoMap
 
     @Override
     public Page<SpeedExpenseInfo> selectInfo(SpeedExpenseInfo speedExpenseInfo) {
-        return null;
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("startRecord", (speedExpenseInfo.getCurrentPage() - 1)
+                * speedExpenseInfo.getPageSize());
+        //公司id
+        pageView.put("compId", speedExpenseInfo.getCompId());
+        pageView.put("searchKeyWord", speedExpenseInfo.getSearchKeyWord());
+        pageView.put("expensesType", speedExpenseInfo.getExpensesType());
+        pageView.put("startDate", speedExpenseInfo.getStartDate());
+        pageView.put("endDate", speedExpenseInfo.getEndDate());
+        pageView.put("pageSize", speedExpenseInfo.getPageSize());
+        pageView.put("currentPage", speedExpenseInfo.getCurrentPage());
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<SpeedExpenseInfo> dataList = baseMapper.getListByCondition(pageView);
+        Page<SpeedExpenseInfo> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(speedExpenseInfo.getCurrentPage());
+        page.setSize(speedExpenseInfo.getPageSize());
+        return page;
     }
 
     @Override

+ 29 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/SpeedCustomerInfoMapper.xml

@@ -2,4 +2,33 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.SpeedCustomerInfoMapper">
 
+    <select id="getListByCondition" parameterType="Map" resultType="com.yh.saas.plugin.yiliangyiyun.entity.SpeedCustomerInfo">
+        SELECT
+        id,
+        customer_name as customerName,
+        customer_phone as customerPhone,
+        comp_id as compId,
+        bank_card as bankCard,
+        bank_deposit as bankDeposit,
+        bank_deposit_branch as bankDepositBranch,
+        update_date as updateDate
+        FROM speed_customer_info
+        WHERE delete_flag = '0'
+        and comp_id= #{compId}
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(customer_phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+    </select>
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(id)
+        FROM speed_customer_info
+        WHERE delete_flag = '0'
+        and comp_id= #{compId}
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(customer_phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+    </select>
 </mapper>

+ 50 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/SpeedExpenseInfoMapper.xml

@@ -2,4 +2,54 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.SpeedExpenseInfoMapper">
 
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(id)
+        FROM speed_expense_info
+        WHERE delete_flag = '0'
+        and comp_id= #{compId}
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(expense_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(remark) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+        <if test="expensesType != null and expensesType != ''">
+            AND expenses_type = #{expensesType}
+        </if>
+        <if test="startDate != null">
+            AND (DATE_FORMAT(create_date ,"%Y%m%d") >=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
+        </if>
+        <if test="endDate != null">
+            AND (DATE_FORMAT(create_date ,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+    </select>
+    <select id="getListByCondition" parameterType="Map" resultType="com.yh.saas.plugin.yiliangyiyun.entity.SpeedExpenseInfo">
+        SELECT
+        id,
+        expenses_type as expensesType,
+        expense_name as expenseName,
+        amount_money as amountMoney,
+        remark,
+        address_url as addressUrl,
+        update_date as updateDate
+        FROM speed_expense_info
+        WHERE delete_flag = '0'
+        and comp_id= #{compId}
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(expense_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(remark) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+        <if test="expensesType != null and expensesType != ''">
+            AND expenses_type = #{expensesType}
+        </if>
+        <if test="startDate != null">
+            AND (DATE_FORMAT(create_date ,"%Y%m%d") >=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
+        </if>
+        <if test="endDate != null">
+            AND (DATE_FORMAT(create_date ,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+    </select>
 </mapper>