Browse Source

增加用户跟进表和懒加载选择器

ruqinhu 5 years ago
parent
commit
13d1b9090d

+ 79 - 0
src/main/java/com/ygj/yuemum/controller/customer/CustomerInfoFollowController.java

@@ -0,0 +1,79 @@
+package com.ygj.yuemum.controller.customer;
+
+import com.ygj.yuemum.domain.customer.CustomerInfoFollow;
+import com.ygj.yuemum.domain.customer.dto.CustomerInfoFollowDto;
+import com.ygj.yuemum.service.customer.CustomerInfoFollowService;
+import com.ygj.yuemum.utils.ResponseUtil;
+import io.swagger.annotations.Api;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+* customer_info_follow
+* @author zrz
+* @date 2020/06/19
+*/
+@Api(tags = "客户跟进表")
+@RestController
+@RequestMapping(value = "/CustomerInfoFollow")
+public class CustomerInfoFollowController {
+
+    @Resource
+    private CustomerInfoFollowService customerInfoFollowService;
+
+    /**
+    * [新增]
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    @RequestMapping("/insert")
+    public int insert(CustomerInfoFollow customerInfoFollow){
+        return customerInfoFollowService.insert(customerInfoFollow);
+    }
+
+    /**
+    * [刪除]
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    @RequestMapping("/delete")
+    public int delete(int id){
+        return customerInfoFollowService.delete(id);
+    }
+
+    /**
+    * [更新]
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    @RequestMapping("/update")
+    public int update(CustomerInfoFollow customerInfoFollow){
+        return customerInfoFollowService.update(customerInfoFollow);
+    }
+
+    /**
+    * [查询] 根据主键 id 查询
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    @RequestMapping("/load")
+    public CustomerInfoFollow load(int id){
+        return customerInfoFollowService.load(id);
+    }
+
+    /**
+    * [查询] 分页查询
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    @RequestMapping("/list")
+    public Map<String, Object> pageList(CustomerInfoFollowDto customerInfoFollowDto) {
+        List<CustomerInfoFollow> list = customerInfoFollowService.selectByPageNumSize(customerInfoFollowDto);
+        return ResponseUtil.convertRetMap(list);
+    }
+
+}

+ 62 - 0
src/main/java/com/ygj/yuemum/dao/customer/CustomerInfoFollowMapper.java

@@ -0,0 +1,62 @@
+package com.ygj.yuemum.dao.customer;
+
+import com.ygj.yuemum.domain.customer.CustomerInfoFollow;
+import com.ygj.yuemum.domain.customer.dto.CustomerInfoFollowDto;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+* customer_info_follow
+* @author zrz
+* @date 2020/06/19
+*/
+@Repository
+public interface CustomerInfoFollowMapper {
+
+    /**
+    * [新增]
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    int insert(CustomerInfoFollow customerInfoFollow);
+
+    /**
+    * [刪除]
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    int delete(int id);
+
+    /**
+    * [更新]
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    int update(CustomerInfoFollow customerInfoFollow);
+
+    /**
+    * [查询] 根据主键 id 查询
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    CustomerInfoFollow load(int id);
+
+    /**
+    * [查询] 分页查询
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    List<CustomerInfoFollow> pageList(int offset,int pagesize);
+
+    /**
+    * [查询] 分页查询 count
+    * @author zrz
+    * @date 2020/06/19
+    **/
+    int pageListCount(int offset,int pagesize);
+
+    List<CustomerInfoFollow> selectByPageNumSize(CustomerInfoFollowDto customerInfoFollowDto);
+
+
+}

+ 4 - 0
src/main/java/com/ygj/yuemum/domain/customer/CustomerInfoBasic.java

@@ -97,6 +97,10 @@ public class CustomerInfoBasic implements Serializable {
     */
     private String create_person;
 
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date fb_date;
+
     private Integer page;
     private Integer limit;
     private String start_entry_date;

+ 91 - 0
src/main/java/com/ygj/yuemum/domain/customer/CustomerInfoFollow.java

@@ -0,0 +1,91 @@
+package com.ygj.yuemum.domain.customer;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ *  customer_info_follow
+ * @author zrz 2020-06-19
+ */
+@Data
+public class CustomerInfoFollow implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    private Integer id;
+
+    /**
+     * 创建时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date create_date;
+
+    /**
+     * 跟进方式
+     */
+    private String follow_mehtod;
+
+    /**
+     * 客户姓名
+     */
+    private String fb_customer_name;
+
+    /**
+     * 用户电话
+     */
+    private String fb_customer_phone;
+
+    /**
+     * 渠道来源
+     */
+    private String source_channel;
+
+    /**
+     * 预产期
+     */
+    private Date edc_date;
+
+    /**
+     * 跟进状态
+     */
+    private String follow_state;
+
+    /**
+     * 位置
+     */
+    private String address;
+
+    /**
+     * 跟进情况描述
+     */
+    private String follow_desc;
+
+    /**
+     * 相关照片
+     */
+    private String photos;
+
+    /**
+     * 下次跟进时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date next_follow_date;
+
+    private String create_person;
+
+    private Date fb_date;
+
+    public CustomerInfoFollow() {
+    }
+
+}

+ 8 - 0
src/main/java/com/ygj/yuemum/domain/customer/dto/CustomerInfoBasicDto.java

@@ -1,6 +1,8 @@
 package com.ygj.yuemum.domain.customer.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.util.Date;
 import java.util.List;
@@ -68,8 +70,14 @@ public class CustomerInfoBasicDto {
     /**
      * 录入时间
      */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date entry_date;
 
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date fb_date;
+
     private Integer page;
     private Integer limit;
     private String start_entry_date;

+ 84 - 0
src/main/java/com/ygj/yuemum/domain/customer/dto/CustomerInfoFollowDto.java

@@ -0,0 +1,84 @@
+package com.ygj.yuemum.domain.customer.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class CustomerInfoFollowDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    private Integer id;
+
+    /**
+     * 创建时间
+     */
+    private Date create_date;
+
+    /**
+     * 跟进方式
+     */
+    private String follow_mehtod;
+
+    /**
+     * 客户姓名
+     */
+    private String fb_customer_name;
+
+    /**
+     * 用户电话
+     */
+    private String fb_customer_phone;
+
+    /**
+     * 渠道来源
+     */
+    private String source_channel;
+
+    /**
+     * 预产期
+     */
+    private Date edc_date;
+
+    /**
+     * 跟进状态
+     */
+    private String follow_state;
+
+    /**
+     * 位置
+     */
+    private String address;
+
+    /**
+     * 跟进情况描述
+     */
+    private String follow_desc;
+
+    /**
+     * 相关照片
+     */
+    private String photos;
+
+    /**
+     * 下次跟进时间
+     */
+    private Date next_follow_date;
+
+    private Date fb_date;
+
+    private String start_fb_date;
+
+    private String end_fb_date;
+
+    private List<String> create_person;
+    private Integer page;
+    private Integer limit;
+
+}

+ 1 - 1
src/main/java/com/ygj/yuemum/service/customer/CustomerInfoBasicService.java

@@ -59,7 +59,7 @@ public class CustomerInfoBasicService {
 	}
 
 	public List<CustomerInfoBasic> selectByPageNumSize(CustomerInfoBasicDto customerInfoBasic) {
-		PageHelper.startPage(customerInfoBasic.getPage(), customerInfoBasic.getLimit());
+		PageHelper.startPage(customerInfoBasic.getPage(), customerInfoBasic.getLimit(), true, false);
 		return customerInfoBasicDao.selectByPageNumSize(customerInfoBasic);
 	}
 

+ 1 - 1
src/main/java/com/ygj/yuemum/service/customer/CustomerInfoFeedbackService.java

@@ -17,7 +17,7 @@ public class CustomerInfoFeedbackService {
     CustomerInfoFeedbackDao feedbackDao;
 
     public List<CustomerInfoFeedback> selectByPageNumSize(CustomerInfoFeedbackDto customerInfoFeedbackDto) {
-        PageHelper.startPage(customerInfoFeedbackDto.getPage(), customerInfoFeedbackDto.getLimit());
+        PageHelper.startPage(customerInfoFeedbackDto.getPage(), customerInfoFeedbackDto.getLimit(), true, false);
         return feedbackDao.selectByPageNumSize(customerInfoFeedbackDto);
     }
 

+ 53 - 0
src/main/java/com/ygj/yuemum/service/customer/CustomerInfoFollowService.java

@@ -0,0 +1,53 @@
+package com.ygj.yuemum.service.customer;
+
+import com.github.pagehelper.PageHelper;
+import com.ygj.yuemum.dao.customer.CustomerInfoFollowMapper;
+import com.ygj.yuemum.domain.customer.CustomerInfoFollow;
+import com.ygj.yuemum.domain.customer.dto.CustomerInfoFollowDto;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+* customer_info_follow
+* @author zrz
+* @date 2020/06/19
+*/
+@Service
+public class CustomerInfoFollowService {
+
+	@Resource
+	private CustomerInfoFollowMapper customerInfoFollowMapper;
+
+
+
+	public int insert(CustomerInfoFollow customerInfoFollow) {
+
+		return customerInfoFollowMapper.insert(customerInfoFollow);
+	}
+
+
+
+	public int delete(int id) {
+		return customerInfoFollowMapper.delete(id);
+	}
+
+
+	public int update(CustomerInfoFollow customerInfoFollow) {
+		return customerInfoFollowMapper.update(customerInfoFollow);
+	}
+
+
+	public CustomerInfoFollow load(int id) {
+		return customerInfoFollowMapper.load(id);
+	}
+
+
+	public List<CustomerInfoFollow> selectByPageNumSize(CustomerInfoFollowDto customerInfoFollowDto) {
+		PageHelper.startPage(customerInfoFollowDto.getPage(), customerInfoFollowDto.getLimit());
+		return customerInfoFollowMapper.selectByPageNumSize(customerInfoFollowDto);
+	}
+
+
+}

+ 12 - 2
src/main/resources/mybatis/mapper/customer/CustomerInfoBasicDao.xml

@@ -19,6 +19,7 @@
         <result column="fb_remarks" property="fb_remarks" />
         <result column="entry_date" property="entry_date" />
         <result column="create_person" property="create_person" />
+        <result column="fb_date" property="fb_date" />
     </resultMap>
 
     <sql id="Base_Column_List">
@@ -36,7 +37,8 @@
                 address_detail,
                 fb_remarks,
                 entry_date,
-                create_person
+                create_person,
+                fb_date
     </sql>
 
     <insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.ygj.yuemum.domain.customer.CustomerInfoBasic">
@@ -84,6 +86,9 @@
             <if test ='null != create_person'>
                 create_person
             </if>
+            <if test ='null != fb_date'>
+                fb_date
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test ='null != branche_name'>
@@ -128,6 +133,9 @@
             <if test ='null != create_person'>
                 #{create_person}
             </if>
+            <if test ='null != fb_date'>
+                #{fb_date}
+            </if>
         </trim>
     </insert>
 
@@ -153,6 +161,7 @@
             <if test ='null != fb_remarks'>fb_remarks = #{fb_remarks},</if>
             <if test ='null != entry_date'>entry_date = #{entry_date},</if>
             <if test ='null != create_person'>create_person = #{create_person}</if>
+            <if test ='null != fb_date'>fb_date = #{fb_date}</if>
         </set>
         WHERE id = #{id}
     </update>
@@ -192,7 +201,8 @@
             address_detail,
             fb_remarks,
             entry_date,
-            create_person
+            create_person,
+            fb_date
         FROM
         customer_info_basic c
         where 1=1

+ 212 - 0
src/main/resources/mybatis/mapper/customer/CustomerInfoFollowMapper.xml

@@ -0,0 +1,212 @@
+<?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.ygj.yuemum.dao.customer.CustomerInfoFollowMapper">
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.customer.CustomerInfoFollow" >
+        <result column="id" property="id" />
+        <result column="create_date" property="create_date" />
+        <result column="follow_mehtod" property="follow_mehtod" />
+        <result column="fb_customer_name" property="fb_customer_name" />
+        <result column="fb_customer_phone" property="fb_customer_phone" />
+        <result column="source_channel" property="source_channel" />
+        <result column="edc_date" property="edc_date" />
+        <result column="follow_state" property="follow_state" />
+        <result column="address" property="address" />
+        <result column="follow_desc" property="follow_desc" />
+        <result column="photos" property="photos" />
+        <result column="next_follow_date" property="next_follow_date" />
+        <result column="create_person" property="create_person" />
+        <result column="fb_date" property="fb_date" />
+    </resultMap>
+
+    <sql id="Base_Column_List">
+                id,
+                create_date,
+                follow_mehtod,
+                fb_customer_name,
+                fb_customer_phone,
+                source_channel,
+                edc_date,
+                follow_state,
+                address,
+                follow_desc,
+                photos,
+                next_follow_date,
+                create_person,
+                fb_date
+    </sql>
+
+    <insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.ygj.yuemum.domain.customer.CustomerInfoFollow">
+        INSERT INTO customer_info_follow
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test ='null != create_date'>
+                create_date,
+            </if>
+            <if test ='null != follow_mehtod'>
+                follow_mehtod,
+            </if>
+            <if test ='null != fb_customer_name'>
+                fb_customer_name,
+            </if>
+            <if test ='null != fb_customer_phone'>
+                fb_customer_phone,
+            </if>
+            <if test ='null != source_channel'>
+                source_channel,
+            </if>
+            <if test ='null != edc_date'>
+                edc_date,
+            </if>
+            <if test ='null != follow_state'>
+                follow_state,
+            </if>
+            <if test ='null != address'>
+                address,
+            </if>
+            <if test ='null != follow_desc'>
+                follow_desc,
+            </if>
+            <if test ='null != photos'>
+                photos,
+            </if>
+            <if test ='null != next_follow_date'>
+                next_follow_date,
+            </if>
+            <if test ='null != create_person'>
+                create_person,
+            </if>
+            <if test ='null != fb_date'>
+                fb_date
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test ='null != create_date'>
+                #{create_date},
+            </if>
+            <if test ='null != follow_mehtod'>
+                #{follow_mehtod},
+            </if>
+            <if test ='null != fb_customer_name'>
+                #{fb_customer_name},
+            </if>
+            <if test ='null != fb_customer_phone'>
+                #{fb_customer_phone},
+            </if>
+            <if test ='null != source_channel'>
+                #{source_channel},
+            </if>
+            <if test ='null != edc_date'>
+                #{edc_date},
+            </if>
+            <if test ='null != follow_state'>
+                #{follow_state},
+            </if>
+            <if test ='null != address'>
+                #{address},
+            </if>
+            <if test ='null != follow_desc'>
+                #{follow_desc},
+            </if>
+            <if test ='null != photos'>
+                #{photos},
+            </if>
+            <if test ='null != next_follow_date'>
+                #{next_follow_date},
+            </if>
+            <if test ='null != create_person'>
+                #{create_person},
+            </if>
+            <if test ='null != fb_date'>
+                #{fb_date}
+            </if>
+        </trim>
+    </insert>
+
+    <delete id="delete" >
+        DELETE FROM customer_info_follow
+        WHERE id = #{id}
+    </delete>
+
+    <update id="update" parameterType="com.ygj.yuemum.domain.customer.CustomerInfoFollow">
+        UPDATE customer_info_follow
+        <set>
+            <if test ='null != create_date'>create_date = #{create_date},</if>
+            <if test ='null != follow_mehtod'>follow_mehtod = #{follow_mehtod},</if>
+            <if test ='null != fb_customer_name'>fb_customer_name = #{fb_customer_name},</if>
+            <if test ='null != fb_customer_phone'>fb_customer_phone = #{fb_customer_phone},</if>
+            <if test ='null != source_channel'>source_channel = #{source_channel},</if>
+            <if test ='null != edc_date'>edc_date = #{edc_date},</if>
+            <if test ='null != follow_state'>follow_state = #{follow_state},</if>
+            <if test ='null != address'>address = #{address},</if>
+            <if test ='null != follow_desc'>follow_desc = #{follow_desc},</if>
+            <if test ='null != photos'>photos = #{photos},</if>
+            <if test ='null != next_follow_date'>next_follow_date = #{next_follow_date},</if>
+            <if test ='null != create_person'>create_person = #{create_person},</if>
+            <if test ='null != fb_date'>fb_date = #{fb_date}</if>
+        </set>
+        WHERE id = #{id}
+    </update>
+
+
+    <select id="load" resultMap="BaseResultMap">
+        SELECT <include refid="Base_Column_List" />
+        FROM customer_info_follow
+        WHERE id = #{id}
+    </select>
+
+    <select id="pageList" resultMap="BaseResultMap">
+        SELECT <include refid="Base_Column_List" />
+        FROM customer_info_follow
+        LIMIT #{offset}, #{pageSize}
+    </select>
+
+    <select id="pageListCount" resultType="java.lang.Integer">
+        SELECT count(1)
+        FROM customer_info_follow
+    </select>
+
+    <!--获取所有数据-->
+    <select id="selectByPageNumSize" resultType="com.ygj.yuemum.domain.customer.CustomerInfoFollow" parameterType="com.ygj.yuemum.domain.customer.dto.CustomerInfoFollowDto">
+        SELECT
+        id,
+        create_date,
+        follow_mehtod,
+        fb_customer_name,
+        fb_customer_phone,
+        source_channel,
+        edc_date,
+        follow_state,
+        address,
+        follow_desc,
+        photos,
+        next_follow_date,
+        create_person,
+        fb_date
+        FROM
+        customer_info_follow
+        where 1=1
+        <if test="id != null and id !=''">
+            and id = #{id}
+        </if>
+        <if test="start_fb_date != null and start_fb_date !=''">
+            and fb_Date &gt;= #{start_fb_date}
+        </if>
+        <if test="end_fb_date != null and end_fb_date !=''">
+            and fb_Date &lt; #{end_fb_date}
+        </if>
+        <if test="follow_state != null and follow_state !=''">
+            and follow_state like "%"#{follow_state,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="fb_customer_phone != null and fb_customer_phone !=''">
+            and fb_customer_phone like "%"#{fb_customer_phone,jdbcType=VARCHAR}"%"
+        </if>
+        <if test="create_person != null ">
+            and create_person in
+            <foreach collection="create_person" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+</mapper>