Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
68881eaf
Commit
68881eaf
authored
Jul 31, 2023
by
翁国栋
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/feature_20230426_test' into feature_20230426_test
parents
632b2d01
ab8133df
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
585 additions
and
7 deletions
+585
-7
src/main/java/cn/timer/api/bean/crm/CrmClientLog.java
+69
-0
src/main/java/cn/timer/api/controller/crm/CrmController.java
+0
-0
src/main/java/cn/timer/api/dao/crm/CrmClientDataMapper.java
+42
-1
src/main/java/cn/timer/api/dao/crm/CrmClientFollowMapper.java
+27
-0
src/main/java/cn/timer/api/dao/crm/CrmClientLogMapper.java
+18
-0
src/main/java/cn/timer/api/dto/crm/CrmClientFollowCountDto.java
+40
-0
src/main/java/cn/timer/api/dto/crm/CrmClientFollowCountParam.java
+52
-0
src/main/java/cn/timer/api/dto/crm/CrmClientFollowListDto.java
+29
-0
src/main/java/cn/timer/api/utils/DateUtil.java
+38
-4
src/main/resources/mapping/crm/CrmClientDataMapper.xml
+192
-2
src/main/resources/mapping/crm/CrmClientFollowMapper.xml
+70
-0
src/main/resources/mapping/crm/CrmClientLogMapper.xml
+8
-0
No files found.
src/main/java/cn/timer/api/bean/crm/CrmClientLog.java
0 → 100644
View file @
68881eaf
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
;
}
src/main/java/cn/timer/api/controller/crm/CrmController.java
View file @
68881eaf
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dao/crm/CrmClientDataMapper.java
View file @
68881eaf
...
...
@@ -10,6 +10,9 @@ package cn.timer.api.dao.crm;
import
java.util.List
;
import
cn.timer.api.dto.crm.CrmCartogramCountExportDto
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
...
...
@@ -38,4 +41,41 @@ public interface CrmClientDataMapper extends BaseMapper<CrmClientData> {
@RequestParam
(
name
=
"belongGroup"
,
required
=
false
)
Integer
belongGroup
,
@RequestParam
(
name
=
"startCreateTime"
,
required
=
false
)
String
startCreateTime
,
@RequestParam
(
name
=
"endCreateTime"
,
required
=
false
)
String
endCreateTime
);
}
List
<
CrmClientData
>
getCrmClientData
(
@Param
(
"empNum"
)
Integer
empNum
,
@Param
(
"orgCode"
)
Integer
orgCode
,
@Param
(
"groupId"
)
Integer
groupId
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"like"
)
String
like
,
@Param
(
"startCreateTime"
)
String
startCreateTime
,
@Param
(
"endCreateTime"
)
String
endCreateTime
,
@Param
(
"startFollowTime"
)
String
startFollowTime
,
@Param
(
"endFollowTime"
)
String
endFollowTime
,
@Param
(
"typei"
)
Integer
typei
,
@Param
(
"unfollowedDays"
)
Integer
unfollowedDays
,
@Param
(
"followNumber"
)
Integer
followNumber
,
@Param
(
"industry"
)
Integer
industry
);
IPage
<
CrmClientData
>
getCrmClientData1
(
IPage
<
CrmClientData
>
page
,
@Param
(
"empNum"
)
Integer
empNum
,
@Param
(
"orgCode"
)
Integer
orgCode
,
@Param
(
"groupId"
)
Integer
groupId
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"like"
)
String
like
,
@Param
(
"startCreateTime"
)
String
startCreateTime
,
@Param
(
"endCreateTime"
)
String
endCreateTime
,
@Param
(
"startFollowTime"
)
String
startFollowTime
,
@Param
(
"endFollowTime"
)
String
endFollowTime
,
@Param
(
"type"
)
Integer
type
,
@Param
(
"ifPhone"
)
String
ifPhone
,
@Param
(
"customerowner"
)
String
customerowner
,
@Param
(
"unfollowedDays"
)
Integer
unfollowedDays
,
@Param
(
"followNumber"
)
Integer
followNumber
,
@Param
(
"industry"
)
Integer
industry
);
IPage
<
CrmClientData
>
getCrmClientData2
(
IPage
<
CrmClientData
>
page
,
@Param
(
"empNum"
)
Integer
empNum
,
@Param
(
"orgCode"
)
Integer
orgCode
,
@Param
(
"groupId"
)
Integer
groupId
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"like"
)
String
like
,
@Param
(
"startCreateTime"
)
String
startCreateTime
,
@Param
(
"endCreateTime"
)
String
endCreateTime
,
@Param
(
"startFollowTime"
)
String
startFollowTime
,
@Param
(
"endFollowTime"
)
String
endFollowTime
,
@Param
(
"type"
)
Integer
type
,
@Param
(
"ifPhone"
)
String
ifPhone
,
@Param
(
"customerowner"
)
String
customerowner
,
@Param
(
"unfollowedDays"
)
Integer
unfollowedDays
,
@Param
(
"followNumber"
)
Integer
followNumber
,
@Param
(
"industry"
)
Integer
industry
);
List
<
CrmClientData
>
getCrmClientData3
(
@Param
(
"empNum"
)
Integer
empNum
,
@Param
(
"orgCode"
)
Integer
orgCode
,
@Param
(
"groupId"
)
Integer
groupId
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"like"
)
String
like
,
@Param
(
"startCreateTime"
)
String
startCreateTime
,
@Param
(
"endCreateTime"
)
String
endCreateTime
,
@Param
(
"startFollowTime"
)
String
startFollowTime
,
@Param
(
"endFollowTime"
)
String
endFollowTime
,
@Param
(
"type"
)
Integer
type
,
@Param
(
"ifPhone"
)
String
ifPhone
,
@Param
(
"customerowner"
)
String
customerowner
,
@Param
(
"unfollowedDays"
)
Integer
unfollowedDays
,
@Param
(
"followNumber"
)
Integer
followNumber
,
@Param
(
"industry"
)
Integer
industry
);
}
\ No newline at end of file
src/main/java/cn/timer/api/dao/crm/CrmClientFollowMapper.java
View file @
68881eaf
...
...
@@ -7,9 +7,16 @@
*/
package
cn
.
timer
.
api
.
dao
.
crm
;
import
cn.timer.api.dto.crm.CrmCartogramCountExportDto
;
import
cn.timer.api.dto.crm.CrmClientFollowCountDto
;
import
cn.timer.api.dto.crm.CrmClientFollowCountParam
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.timer.api.bean.crm.CrmClientFollow
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
/**
* Title: CrmClientFollowMapper.java
...
...
@@ -20,5 +27,25 @@ import cn.timer.api.bean.crm.CrmClientFollow;
* @version 1.0
*/
public
interface
CrmClientFollowMapper
extends
BaseMapper
<
CrmClientFollow
>
{
/**
* 根据条件查询 统计跟进数据
* @param param
* @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
);
}
src/main/java/cn/timer/api/dao/crm/CrmClientLogMapper.java
0 → 100644
View file @
68881eaf
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
>
{
}
src/main/java/cn/timer/api/dto/crm/CrmClientFollowCountDto.java
0 → 100644
View file @
68881eaf
package
cn
.
timer
.
api
.
dto
.
crm
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.awt.*
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
*
* @author wuqingjun
* @date 2023年7月28日
* @version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
CrmClientFollowCountDto
implements
Serializable
{
@ApiModelProperty
(
value
=
"跟进数"
)
private
List
<
Integer
>
followCount
;
@ApiModelProperty
(
value
=
"创建人"
)
private
Integer
createUser
;
@ApiModelProperty
(
value
=
"创建人姓名"
)
private
String
createUserName
;
@ApiModelProperty
(
value
=
"时间"
)
private
String
createTime
;
}
src/main/java/cn/timer/api/dto/crm/CrmClientFollowCountParam.java
0 → 100644
View file @
68881eaf
package
cn
.
timer
.
api
.
dto
.
crm
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
*
* @author wuqingjun
* @date 2023年7月28日
* @version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
CrmClientFollowCountParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
1230023773946170911L
;
/**
* 开始时间
*/
@ApiModelProperty
(
value
=
"开始时间"
)
private
String
startTime
;
/**
* 结束时间
*/
@ApiModelProperty
(
value
=
"结束时间"
)
private
String
endTime
;
/**
* 当前企业id
*/
@ApiModelProperty
(
value
=
"当前企业id"
)
private
Integer
orgCode
;
/**
* 当前用户ID
*/
@ApiModelProperty
(
value
=
"当前用户ID"
)
private
Integer
createUser
;
}
src/main/java/cn/timer/api/dto/crm/CrmClientFollowListDto.java
0 → 100644
View file @
68881eaf
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
;
}
src/main/java/cn/timer/api/utils/DateUtil.java
View file @
68881eaf
...
...
@@ -3,12 +3,10 @@ package cn.timer.api.utils;
import
java.text.Format
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
cn.hutool.core.util.StrUtil
;
import
org.springframework.util.StringUtils
;
public
class
DateUtil
{
...
...
@@ -479,4 +477,40 @@ public class DateUtil {
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
));
return
dft
.
format
(
calendar
.
getTime
());
}
/**
* 获取当前月的所有天数
* @param yearMonth
* @return
*/
public
static
List
<
String
>
getDayByMonth
(
String
yearMonth
){
List
<
String
>
list
=
new
ArrayList
<>();
if
(
StringUtils
.
isEmpty
(
yearMonth
)){
return
list
;
}
String
[]
year_monnth
=
yearMonth
.
split
(
"-"
);
Calendar
calendar
=
Calendar
.
getInstance
(
Locale
.
CHINA
);
calendar
.
set
(
Integer
.
parseInt
(
year_monnth
[
0
]),
Integer
.
parseInt
(
year_monnth
[
1
])-
1
,
1
);
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
//年份
int
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
//月份
int
day
=
calendar
.
getActualMaximum
(
Calendar
.
DATE
);
for
(
int
i
=
1
;
i
<=
day
;
i
++)
{
String
date
=
null
;
if
(
month
<
10
&&
i
<
10
){
date
=
String
.
valueOf
(
year
)+
"-0"
+
month
+
"-0"
+
i
;
}
if
(
month
<
10
&&
i
>=
10
){
date
=
String
.
valueOf
(
year
)+
"-0"
+
month
+
"-"
+
i
;
}
if
(
month
>=
10
&&
i
<
10
){
date
=
String
.
valueOf
(
year
)+
"-"
+
month
+
"-0"
+
i
;
}
if
(
month
>=
10
&&
i
>=
10
){
date
=
String
.
valueOf
(
year
)+
"-"
+
month
+
"-"
+
i
;
}
list
.
add
(
date
);
}
return
list
;
}
}
src/main/resources/mapping/crm/CrmClientDataMapper.xml
View file @
68881eaf
...
...
@@ -6,11 +6,12 @@
<select
id=
"crmCartogram"
resultType=
"cn.timer.api.dto.crm.CrmCartogramDto"
>
SELECT
province_id,
province as provinceName,count(province_id
) num
province_id,
city as provinceName,count(address
) num
FROM
crm_client_data
WHERE
org_code = #{orgCode}
and client_cellphone != ''
<if
test=
'null != belongUser and belongUser !=""'
>
AND
belong_user = #{belongUser}
</if>
...
...
@@ -24,7 +25,7 @@
create_time
<![CDATA[<=]]>
#{endCreateTime}
</if>
GROUP BY
province_id
city
</select>
<select
id=
"selectCrmCartogramCount"
resultType=
"cn.timer.api.dto.crm.CrmCartogramCountExportDto"
>
SELECT belong_user_name,
...
...
@@ -50,4 +51,192 @@
</where>
GROUP BY ccd.belong_user
</select>
<select
id=
"getCrmClientData"
resultType=
"CrmClientData"
>
SELECT *
FROM crm_client_data ccd
WHERE ccd.org_code = #{orgCode}
AND ccd.belong_user = #{empNum}
<if
test=
"industry != null and industry > 0"
>
AND ccd.industry = #{industry}
</if>
<if
test=
"groupId != null and groupId > 0"
>
AND ccd.belong_group = #{groupId}
</if>
<if
test=
"status != null and status > 0"
>
AND ccd.client_status = #{status}
</if>
<if
test=
"typei != null and typei > 0"
>
AND ccd.client_type = #{typei}
</if>
<if
test=
"startCreateTime != null and endCreateTime != null"
>
AND ccd.create_time BETWEEN #{startCreateTime} AND #{endCreateTime}
</if>
<if
test=
"startFollowTime != null and endFollowTime != null"
>
AND ccd.last_follow_time BETWEEN #{startFollowTime} AND #{endFollowTime}
</if>
<if
test=
"like != null and like.trim().length() > 0"
>
AND (ccd.belong_user_name LIKE CONCAT('%', #{like}, '%')
OR ccd.client_name LIKE CONCAT('%', #{like}, '%')
OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if>
<if
test=
"unfollowedDays != null and unfollowedDays > 0"
>
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays}
</if>
<if
test=
"followNumber != null and followNumber > 0"
>
AND (
SELECT COUNT(*)
FROM crm_client_follow ccf
WHERE ccf.cid = ccd.id
) >= #{followNumber}
</if>
ORDER BY ccd.create_time DESC
</select>
<select
id=
"getCrmClientData1"
resultType=
"CrmClientData"
>
SELECT ccd.*
FROM crm_client_data ccd
WHERE ccd.org_code = #{orgCode}
AND ccd.belong_user = #{empNum}
<if
test=
"industry != null and industry > 0"
>
AND ccd.industry = #{industry}
</if>
<if
test=
"groupId != null and groupId >= 0"
>
AND ccd.belong_group = #{groupId}
</if>
<if
test=
"type != null and type >= 0"
>
AND ccd.client_type = #{type}
</if>
<if
test=
"ifPhone != null and ifPhone != '' and ifPhone == '1'"
>
AND ccd.client_cellphone LIKE '%1'
</if>
<if
test=
"ifPhone != null and ifPhone != '' and ifPhone == '2'"
>
AND (ccd.client_cellphone IS NULL OR ccd.client_cellphone = '')
</if>
<if
test=
"status != null and status >= 0"
>
AND ccd.client_status = #{status}
</if>
<if
test=
"customerowner != null and customerowner != ''"
>
AND ccd.belong_user_name LIKE CONCAT('%', #{customerowner}, '%')
</if>
<if
test=
"startCreateTime != null and startCreateTime != '' and endCreateTime != null and endCreateTime != '' "
>
AND ccd.create_time BETWEEN #{startCreateTime} AND #{endCreateTime}
</if>
<if
test=
"startFollowTime != null and endFollowTime != null"
>
AND ccd.last_follow_time BETWEEN #{startFollowTime} AND #{endFollowTime}
</if>
<if
test=
"like != null and like.trim().length() > 0"
>
AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if>
<if
test=
"unfollowedDays != null and unfollowedDays > 0"
>
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays}
</if>
<if
test=
"followNumber != null and followNumber > 0"
>
AND (
SELECT COUNT(*)
FROM crm_client_follow
WHERE cid = ccd.id
) >= #{followNumber}
</if>
ORDER BY ccd.create_time DESC
</select>
<select
id=
"getCrmClientData2"
resultType=
"CrmClientData"
>
SELECT *
FROM crm_client_data ccd
WHERE ccd.org_code = #{orgCode}
AND ccd.belong_user = #{empNum}
<if
test=
"industry != null and industry > 0"
>
AND ccd.industry = #{industry}
</if>
<if
test=
"groupId != null and groupId >= 0"
>
AND ccd.belong_group = #{groupId}
</if>
<if
test=
"type != null and type >= 0"
>
AND ccd.client_type = #{type}
</if>
<if
test=
"customerowner != null and customerowner != ''"
>
AND ccd.belong_user_name LIKE CONCAT('%', #{customerowner}, '%')
</if>
<if
test=
"status != null and status >= 0"
>
AND ccd.client_status = #{status}
</if>
<if
test=
"keywordStr != null and keywordStr != ''"
>
AND ccd.belong_group IN (${keywordStr})
</if>
<if
test=
"ifPhone != null and ifPhone != '' and ifPhone == '1'"
>
AND ccd.client_cellphone LIKE '%1'
</if>
<if
test=
"ifPhone != null and ifPhone != '' and ifPhone == '2'"
>
AND (ccd.client_cellphone IS NULL OR ccd.client_cellphone = '')
</if>
<if
test=
"startCreateTime != null and startCreateTime != '' and endCreateTime != null and endCreateTime != '' "
>
AND ccd.create_time BETWEEN #{startCreateTime} AND #{endCreateTime}
</if>
<if
test=
"startFollowTime != null and endFollowTime != null"
>
AND ccd.last_follow_time BETWEEN #{startFollowTime} AND #{endFollowTime}
</if>
<if
test=
"like != null and like.trim().length() > 0"
>
AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if>
<if
test=
"unfollowedDays != null and unfollowedDays > 0"
>
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays}
</if>
<if
test=
"followNumber != null and followNumber > 0"
>
AND (
SELECT COUNT(*)
FROM crm_client_follow
WHERE cid = ccd.id
) >= #{followNumber}
</if>
ORDER BY ccd.create_time DESC;
</select>
<select
id=
"getCrmClientData3"
resultType=
"CrmClientData"
>
SELECT *
FROM crm_client_data ccd
WHERE ccd.belong_group = #{gid}
<if
test=
"industry != null and industry > 0"
>
AND ccd.industry = #{industry}
</if>
<if
test=
"groupId != null and groupId >= 0"
>
AND ccd.belong_group = #{groupId}
</if>
<if
test=
"type != null and type >= 0"
>
AND ccd.client_type = #{type}
</if>
<if
test=
"customerowner != null and customerowner != ''"
>
AND ccd.belong_user_name LIKE CONCAT('%', #{customerowner}, '%')
</if>
<if
test=
"status != null and status >= 0"
>
AND ccd.client_status = #{status}
</if>
<if
test=
"ifPhone != null and ifPhone != '' and ifPhone == '1'"
>
AND ccd.client_cellphone LIKE '%1'
</if>
<if
test=
"ifPhone != null and ifPhone != '' and ifPhone == '2'"
>
AND (ccd.client_cellphone IS NULL OR ccd.client_cellphone = '')
</if>
<if
test=
"startCreateTime != null and startCreateTime != '' and endCreateTime != null and endCreateTime != '' "
>
AND ccd.create_time BETWEEN #{startCreateTime} AND #{endCreateTime}
</if>
<if
test=
"startFollowTime != null and endFollowTime != null"
>
AND ccd.last_follow_time BETWEEN #{startFollowTime} AND #{endFollowTime}
</if>
<if
test=
"like != null and like.trim().length() > 0"
>
AND (ccd.client_name LIKE CONCAT('%', #{like}, '%') OR ccd.client_cellphone LIKE CONCAT('%', #{like}, '%'))
</if>
<if
test=
"unfollowedDays != null and unfollowedDays > 0"
>
AND DATEDIFF(NOW(), (SELECT MAX(last_follow_time) FROM crm_client_follow ccf WHERE ccf.cid = ccd.id)) >= #{unfollowedDays}
</if>
<if
test=
"followNumber != null and followNumber > 0"
>
AND (
SELECT COUNT(*)
FROM crm_client_follow
WHERE cid = ccd.id
) >= #{followNumber}
</if>
ORDER BY ccd.create_time DESC;
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapping/crm/CrmClientFollowMapper.xml
0 → 100644
View file @
68881eaf
<?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.CrmClientFollowMapper"
>
<select
id=
"selectCrmClientFollowCount"
resultType=
"cn.timer.api.dto.crm.CrmClientFollowCountDto"
>
SELECT
create_user_name createUserName,
create_user createUser,
DATE(create_time) AS createTime,
COUNT(*) AS followCount
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, DATE(create_time)
ORDER BY
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
src/main/resources/mapping/crm/CrmClientLogMapper.xml
0 → 100644
View file @
68881eaf
<?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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment