Commit ab8133df by 284718418@qq.com

跟进动态统计

parent 2a3f92a3
package cn.timer.api.bean.crm;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Date;
/**
* Title: 客户跟进动态日志表
*
* @Description:
* @author wuqingjun
* @date 2023年7月31日
* @version 1.0
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "crm_client_log")
@ApiModel("客户跟进动态日志表")
public class CrmClientLog extends Model<CrmClientLog> {
private static final long serialVersionUID = -7362549097557018582L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
@ApiModelProperty(value = "客户数据id")
private Integer cid;
@ApiModelProperty(value = "变更前客户数据状态")
private Integer beforeClientStatus;
@ApiModelProperty(value = "变更后客户数据状态")
private Integer afterClientStatus;
@ApiModelProperty(value = "创建人")
private Integer createUser;
@ApiModelProperty(value = "企业id")
private Integer orgCode;
@ApiModelProperty(value = "创建人姓名")
private String createUserName;
@ApiModelProperty(value = "备注")
private String remark;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间")
private Date createTime;
}
......@@ -33,6 +33,19 @@ public interface CrmClientFollowMapper extends BaseMapper<CrmClientFollow> {
* @return
*/
List<CrmClientFollowCountDto> selectCrmClientFollowCount(@Param("param") CrmClientFollowCountParam param);
/**
* 根据条件查询 统计跟进数据 需要显示的人数
* @param param
* @return
*/
List<CrmClientFollowCountDto> selectCrmClientFollowList(@Param("param") CrmClientFollowCountParam param);
/**
* 根据条件查询 统计跟进数据
* @param param
* @return
*/
Integer selectCountByParam(@Param("param") CrmClientFollowCountParam param);
}
package cn.timer.api.dao.crm;
import cn.timer.api.bean.crm.CrmClientLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Title: 客户跟进动态日志表
*
* @Description:
* @author wuqingjun
* @date 2023年7月31日
* @version 1.0
*/
public interface CrmClientLogMapper extends BaseMapper<CrmClientLog> {
}
......@@ -8,8 +8,10 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.awt.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
*
......@@ -25,7 +27,7 @@ public class CrmClientFollowCountDto implements Serializable {
@ApiModelProperty(value = "跟进数")
private Integer followCount;
private List<Integer> followCount;
@ApiModelProperty(value = "创建人")
private Integer createUser;
......
......@@ -44,4 +44,9 @@ public class CrmClientFollowCountParam implements Serializable {
*/
@ApiModelProperty(value = "当前企业id")
private Integer orgCode;
/**
* 当前用户ID
*/
@ApiModelProperty(value = "当前用户ID")
private Integer createUser;
}
package cn.timer.api.dto.crm;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
*
* @author wuqingjun
* @date 2023年7月28日
* @version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CrmClientFollowListDto implements Serializable {
@ApiModelProperty(value = "时间")
private List<String> createStr;
private List<CrmClientFollowCountDto> dtos;
}
......@@ -23,8 +23,47 @@
</if>
</where>
GROUP BY
create_user_name, DATE(create_time)
createUser, DATE(create_time)
ORDER BY
create_user_name, DATE(create_time);
createUser, DATE(create_time);
</select>
<select id="selectCrmClientFollowList" resultType="cn.timer.api.dto.crm.CrmClientFollowCountDto">
SELECT
create_user_name createUserName,
create_user createUser
FROM
crm_client_follow
<where>
<if test='null != param.startTime and param.startTime !=""'>
AND create_time <![CDATA[>=]]> #{param.startTime}
</if>
<if test='null != param.endTime and param.endTime !=""'>
AND create_time <![CDATA[<=]]> #{param.endTime}
</if>
<if test='null != param.orgCode and param.orgCode !=""'>
AND org_code = #{param.orgCode}
</if>
</where>
GROUP BY
createUser
ORDER BY
createUser
</select>
<select id="selectCountByParam" resultType="int">
SELECT
COUNT(*)
FROM
crm_client_follow
<where>
<if test='null != param.startTime and param.startTime !=""'>
AND DATE(create_time) = #{param.startTime}
</if>
<if test='null != param.createUser and param.createUser !=""'>
AND create_user = #{param.createUser}
</if>
<if test='null != param.orgCode and param.orgCode !=""'>
AND org_code = #{param.orgCode}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?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="cn.timer.api.dao.crm.CrmClientLogMapper">
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment