Merge branch 'dev/feat/partner1.3_20230828' into hxd/feat/labelAndlLine

# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
#	coolstore-partner-service/pom.xml
This commit is contained in:
xiaodong.hu
2023-08-14 15:10:31 +08:00
110 changed files with 4559 additions and 135 deletions

View File

@@ -50,6 +50,11 @@
<version>1.3.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>4.1.4</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,143 @@
package com.cool.store.dao;
import com.cool.store.entity.HyFollowTaskDO;
import com.cool.store.enums.FollowTaskStatusEnum;
import com.cool.store.mapper.HyFollowTaskMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: HyFollowTaskDAO
* @Description:
* @date 2023-08-10 10:35
*/
@Repository
public class HyFollowTaskDAO {
@Resource
private HyFollowTaskMapper hyFollowTaskMapper;
/**
* 获取跟进任务想去
* @param followTaskId
* @return
*/
public HyFollowTaskDO getFollowTask(Long followTaskId){
if(Objects.isNull(followTaskId)){
return null;
}
return hyFollowTaskMapper.getFollowTask(followTaskId);
}
/**
* 新增跟进任务
* @param request
* @return
*/
public Long addFollowTask(HyFollowTaskDO request){
if(StringUtils.isBlank(request.getFollowUserId()) || Objects.isNull(request.getPartnerLineId())){
return null;
}
hyFollowTaskMapper.insertSelective(request);
return request.getId();
}
/**
* 更新跟进任务
* @param request
* @return
*/
public Integer updateFollowTask(HyFollowTaskDO request){
if(Objects.isNull(request.getId())){
return null;
}
return hyFollowTaskMapper.updateByPrimaryKeySelective(request);
}
/**
* 完成更近任务
* @param followTaskId
* @return
*/
public Integer finishFollowTask(Long followTaskId){
HyFollowTaskDO update = new HyFollowTaskDO();
update.setId(followTaskId);
update.setTaskStatus(FollowTaskStatusEnum.FINISHED.getCode());
return updateFollowTask(update);
}
/**
* 取消跟进任务
* @param followTaskId
* @return
*/
public Integer cancelFollowTask(Long followTaskId){
HyFollowTaskDO update = new HyFollowTaskDO();
update.setId(followTaskId);
update.setTaskStatus(FollowTaskStatusEnum.CANCELLED.getCode());
return updateFollowTask(update);
}
/**
* 获取线索的所有任务
* @param partnerLineId
* @return
*/
public List<HyFollowTaskDO> getTaskListByLineId(Long partnerLineId){
if(Objects.isNull(partnerLineId)){
return Lists.newArrayList();
}
return hyFollowTaskMapper.getTaskListByLineId(partnerLineId);
}
/**
* 分页获取任务
* @param followUserId
* @param taskStatus
* @param deadlineStartTIme
* @param deadlineEndTIme
* @param pageNum
* @param pageSize
* @return
*/
public Page<HyFollowTaskDO> getTaskPage(String followUserId, Integer taskStatus, String deadlineStartTIme, String deadlineEndTIme, Integer pageNum, Integer pageSize){
if(StringUtils.isBlank(followUserId)){
return new Page<>();
}
PageHelper.startPage(pageNum, pageSize);
return hyFollowTaskMapper.getTaskPage(followUserId, taskStatus, deadlineStartTIme, deadlineEndTIme);
}
/**
* 更新未完成的任务跟进人
* @param partnerLineId
* @param userId
*/
public void updateUndoTaskFollowUserId(Long partnerLineId, String userId){
if(Objects.isNull(partnerLineId) || StringUtils.isNotBlank(userId)){
return;
}
hyFollowTaskMapper.updateUndoTaskFollowUserId(partnerLineId, userId);
}
/**
* 作废待完成&已逾期的任务
* @param partnerLineId
*/
public void cancelUndoFollowTask(Long partnerLineId){
if(Objects.isNull(partnerLineId)){
return;
}
hyFollowTaskMapper.cancelUndoFollowTask(partnerLineId);
}
}

View File

@@ -5,6 +5,7 @@ import com.cool.store.entity.HyPartnerIntentInfoDO;
import com.cool.store.mapper.HyPartnerIntentInfoMapper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
@@ -40,11 +41,12 @@ public class HyPartnerIntentInfoDAO {
}
public List<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(String userId, String workflowStage, String workflowStatus){
public List<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(String userId, String workflowStage, String workflowStatus, String keyword, Integer callStatus,
List<String> userPortraitIdList, String lastFollowStartTime, String lastFollowEndTime, String userChannelIdList){
if (StringUtils.isEmpty(userId)){
return new ArrayList<>();
}
return hyPartnerIntentInfoMapper.selectPartnerIntentApplyInfoList(userId,workflowStage,workflowStatus);
return hyPartnerIntentInfoMapper.selectPartnerIntentApplyInfoList(userId,workflowStage,workflowStatus,keyword,callStatus,userPortraitIdList,lastFollowStartTime,lastFollowEndTime,userChannelIdList);
}

View File

@@ -1,5 +1,7 @@
package com.cool.store.dao;
import cn.hutool.core.map.MapUtil;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.partner.PartnerBlackListDTO;
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
import com.cool.store.dto.partner.StageCountDTO;
@@ -8,13 +10,15 @@ import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
@@ -180,4 +184,25 @@ public class HyPartnerLineInfoDAO {
return hyPartnerLineInfoMapper.getLineFollowHistoryList(partnerId);
}
/**
* 获取线索加盟商简要信息
* @param partnerLineIds
* @return
*/
public Map<Long, PartnerSimpleInfoDTO> getPartnerSimpleInfoByLineIds(List<Long> partnerLineIds){
if(CollectionUtils.isEmpty(partnerLineIds)){
return MapUtil.newHashMap();
}
List<PartnerSimpleInfoDTO> partnerList = hyPartnerLineInfoMapper.getPartnerSimpleInfoByLineIds(partnerLineIds);
return ListUtils.emptyIfNull(partnerList).stream().collect(Collectors.toMap(k->k.getPartnerLineId(), Function.identity(), (k1, k2)->k1));
}
public PartnerSimpleInfoDTO getPartnerSimpleInfoByLineId(Long partnerLineId){
if(Objects.isNull(partnerLineId)){
return null;
}
List<PartnerSimpleInfoDTO> partnerList = hyPartnerLineInfoMapper.getPartnerSimpleInfoByLineIds(Arrays.asList(partnerLineId));
return CollectionUtils.isEmpty(partnerList) ? null : partnerList.get(CommonConstants.ZERO);
}
}

View File

@@ -0,0 +1,29 @@
package com.cool.store.mapper;
import com.cool.store.entity.CallRecordDO;
import org.apache.ibatis.annotations.Param;
/**
* @author zhangchenbiao
* @date 2023-08-11 01:03
*/
public interface CallRecordMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-08-11 01:03
*/
int insertSelective(CallRecordDO record);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-08-11 01:03
*/
int updateByPrimaryKeySelective(CallRecordDO record);
int updateByTransNoSelective(CallRecordDO record);
CallRecordDO selectByTransNo(String transNo);
}

View File

@@ -0,0 +1,66 @@
package com.cool.store.mapper;
import com.cool.store.entity.HyFollowTaskDO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-08-10 10:10
*/
public interface HyFollowTaskMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-08-10 10:10
*/
int insertSelective(@Param("record") HyFollowTaskDO record);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-08-10 10:10
*/
int updateByPrimaryKeySelective(@Param("record") HyFollowTaskDO record);
/**
* 根据线索获取任务列表
* @param partnerLineId
* @return
*/
List<HyFollowTaskDO> getTaskListByLineId(@Param("partnerLineId")Long partnerLineId);
/**
* 获取任务列表
* @param followUserId
* @param taskStatus
* @param deadlineStartTIme
* @param deadlineEndTIme
* @return
*/
Page<HyFollowTaskDO> getTaskPage(@Param("followUserId")String followUserId, @Param("taskStatus")Integer taskStatus, @Param("deadlineStartTIme")String deadlineStartTIme, @Param("deadlineEndTIme")String deadlineEndTIme);
/**
* 获取跟进任务详情
* @param followTaskId
* @return
*/
HyFollowTaskDO getFollowTask(@Param("followTaskId") Long followTaskId);
/**
* 更新任务跟进人
* @param partnerLineId
* @param followUserId
*/
Integer updateUndoTaskFollowUserId(@Param("partnerLineId") Long partnerLineId, @Param("followUserId") String followUserId);
/**
* 作废未完成的跟进任务
* @param partnerLineId
* @return
*/
Integer cancelUndoFollowTask(@Param("partnerLineId") Long partnerLineId);
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.mapper;
import com.cool.store.dto.outbound.OutboundListDTO;
import com.cool.store.entity.HyOutboundMobileDO;
import com.cool.store.vo.HyOutboundVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author Fun Li
* @date 2023/08/09
*/
public interface HyOutboundMobileMapper {
int deleteByPrimaryKey(Long id);
int insert(HyOutboundMobileDO record);
int insertSelective(HyOutboundMobileDO record);
HyOutboundMobileDO selectByPrimaryKey(Long id);
List<HyOutboundMobileDO> selectByPrimarySelective(HyOutboundMobileDO hyOutboundMobileDO);
int updateByPrimaryKeySelective(HyOutboundMobileDO record);
int updateByPrimaryKey(HyOutboundMobileDO record);
/**
* 获取呼出手机号列表
*
* @param dto
* @param userId
* @return
*/
List<HyOutboundVo> getOutboundNumberList(@Param("dto") OutboundListDTO dto, @Param("userId") String userId);
}

View File

@@ -38,8 +38,14 @@ public interface HyPartnerIntentInfoMapper {
* @return
*/
List<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(@Param("userId") String userId,
@Param("workflowStage") String workflowStage ,
@Param("workflowStatus") String workflowStatus);
@Param("workflowStage") String workflowStage ,
@Param("workflowStatus") String workflowStatus,
@Param("keyword") String keyword,
@Param("callStatus") Integer callStatus,
@Param("userPortraitIdList") List<String> userPortraitIdList,
@Param("lastFollowStartTime") String lastFollowStartTime,
@Param("lastFollowEndTime") String lastFollowEndTime,
@Param("userChannelIdList") String userChannelIdList);
/**
* 根据线索ID查询数据

View File

@@ -0,0 +1,32 @@
package com.cool.store.mapper;
import com.cool.store.entity.HyPartnerLabelGroupDO;
import com.cool.store.vo.LabelGroupListVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author Fun Li 2023/8/10 13:25
* @version 1.0
*/
@Mapper
public interface HyPartnerLabelGroupMapper {
int deleteByPrimaryKey(Long id);
int insert(HyPartnerLabelGroupDO record);
int insertSelective(HyPartnerLabelGroupDO record);
HyPartnerLabelGroupDO selectByPrimaryKey(Long id);
List<HyPartnerLabelGroupDO> selectSelective(HyPartnerLabelGroupDO record);
List<LabelGroupListVo> getLabelGroupList(HyPartnerLabelGroupDO record);
int updateByPrimaryKeySelective(HyPartnerLabelGroupDO record);
int updateByPrimaryKey(HyPartnerLabelGroupDO record);
}

View File

@@ -0,0 +1,38 @@
package com.cool.store.mapper;
import com.cool.store.dto.label.LabelListDTO;
import com.cool.store.entity.HyPartnerLabelDO;
import com.cool.store.vo.LabelListVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author Fun Li
* @date 2023-08-10
*/
public interface HyPartnerLabelMapper {
int deleteByPrimaryKey(Long id);
int insert(HyPartnerLabelDO record);
int insertSelective(HyPartnerLabelDO record);
HyPartnerLabelDO selectByPrimaryKey(Long id);
List<HyPartnerLabelDO> selectSelective(HyPartnerLabelDO labelDO);
int updateByPrimaryKeySelective(HyPartnerLabelDO record);
int updateByPrimaryKey(HyPartnerLabelDO record);
List<LabelListVo> getLabelList(LabelListDTO dto);
/**
* 某个标签组内是否有未删除的标签
* @param labelGroupId 标签组 id
*/
Boolean whetherGroupInUse(@Param("labelGroupId") Long labelGroupId);
List<HyPartnerLabelDO> getLabelListByIds(@Param("labelIds") List<Long> labelIds);
}

View File

@@ -225,4 +225,12 @@ public interface HyPartnerLineInfoMapper {
@Param("endTime") Date endTime);
void batchUpdateStatusByLineIds(@Param("lineIds") List<Long> lineIds, @Param("status")Integer status);
/**
* 获取线索简要信息
* @param partnerLineIds
* @return
*/
List<PartnerSimpleInfoDTO> getPartnerSimpleInfoByLineIds(@Param("partnerLineIds") List<Long> partnerLineIds);
}

View File

@@ -4,6 +4,8 @@ import com.cool.store.entity.HyPartnerUserChannelDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface HyPartnerUserChannelMapper {
@@ -22,4 +24,8 @@ public interface HyPartnerUserChannelMapper {
HyPartnerUserChannelDO selectByChannelId(@Param("channelId") Long id);
HyPartnerUserChannelDO selectByChannelName(@Param("channelName") String channelName);
List<HyPartnerUserChannelDO> getAllUserChannel();
List<HyPartnerUserChannelDO> getUserChannelByIds(List<Integer> userChannelIds);
}

View File

@@ -0,0 +1,242 @@
<?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.cool.store.mapper.CallRecordMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.CallRecordDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="partner_line_id" jdbcType="BIGINT" property="partnerLineId" />
<result column="trans_no" jdbcType="VARCHAR" property="transNo" />
<result column="outgoing_mobile" jdbcType="VARCHAR" property="outgoingMobile" />
<result column="outgoing_user_id" jdbcType="VARCHAR" property="outgoingUserId" />
<result column="incoming_mobile" jdbcType="VARCHAR" property="incomingMobile" />
<result column="incoming_user_id" jdbcType="VARCHAR" property="incomingUserId" />
<result column="call_start_time" jdbcType="TIMESTAMP" property="callStartTime" />
<result column="call_end_time" jdbcType="TIMESTAMP" property="callEndTime" />
<result column="record_url" jdbcType="VARCHAR" property="recordUrl" />
<result column="call_status" jdbcType="TINYINT" property="callStatus" />
<result column="fail_reason" jdbcType="VARCHAR" property="failReason" />
<result column="creater" jdbcType="VARCHAR" property="creater" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, partner_line_id, trans_no, outgoing_mobile, outgoing_user_id, incoming_mobile,
incoming_user_id, call_start_time, call_end_time, record_url, call_status, fail_reason,
creater, create_time, updater, update_time, remark
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into call_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="partnerLineId != null">
partner_line_id,
</if>
<if test="transNo != null">
trans_no,
</if>
<if test="outgoingMobile != null">
outgoing_mobile,
</if>
<if test="outgoingUserId != null">
outgoing_user_id,
</if>
<if test="incomingMobile != null">
incoming_mobile,
</if>
<if test="incomingUserId != null">
incoming_user_id,
</if>
<if test="callStartTime != null">
call_start_time,
</if>
<if test="callEndTime != null">
call_end_time,
</if>
<if test="recordUrl != null">
record_url,
</if>
<if test="callStatus != null">
call_status,
</if>
<if test="failReason != null">
fail_reason,
</if>
<if test="creater != null">
creater,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updater != null">
updater,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="partnerLineId != null">
#{partnerLineId},
</if>
<if test="transNo != null">
#{transNo},
</if>
<if test="outgoingMobile != null">
#{outgoingMobile},
</if>
<if test="outgoingUserId != null">
#{outgoingUserId},
</if>
<if test="incomingMobile != null">
#{incomingMobile},
</if>
<if test="incomingUserId != null">
#{incomingUserId},
</if>
<if test="callStartTime != null">
#{callStartTime},
</if>
<if test="callEndTime != null">
#{callEndTime},
</if>
<if test="recordUrl != null">
#{recordUrl},
</if>
<if test="callStatus != null">
#{callStatus},
</if>
<if test="failReason != null">
#{failReason},
</if>
<if test="creater != null">
#{creater},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updater != null">
#{updater},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="remark != null">
#{remark},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update call_record
<set>
<if test="partnerLineId != null">
partner_line_id = #{partnerLineId},
</if>
<if test="transNo != null">
trans_no = #{transNo},
</if>
<if test="outgoingMobile != null">
outgoing_mobile = #{outgoingMobile},
</if>
<if test="outgoingUserId != null">
outgoing_user_id = #{outgoingUserId},
</if>
<if test="incomingMobile != null">
incoming_mobile = #{incomingMobile},
</if>
<if test="incomingUserId != null">
incoming_user_id = #{incomingUserId},
</if>
<if test="callStartTime != null">
call_start_time = #{callStartTime},
</if>
<if test="callEndTime != null">
call_end_time = #{callEndTime},
</if>
<if test="recordUrl != null">
record_url = #{recordUrl},
</if>
<if test="callStatus != null">
call_status = #{callStatus},
</if>
<if test="failReason != null">
fail_reason = #{failReason},
</if>
<if test="creater != null">
creater = #{creater},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updater != null">
updater = #{updater},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="remark != null">
remark = #{remark},
</if>
</set>
where id = #{id}
</update>
<update id="updateByTransNoSelective">
update call_record
<set>
<if test="partnerLineId != null">
partner_line_id = #{partnerLineId},
</if>
<if test="outgoingMobile != null">
outgoing_mobile = #{outgoingMobile},
</if>
<if test="outgoingUserId != null">
outgoing_user_id = #{outgoingUserId},
</if>
<if test="incomingMobile != null">
incoming_mobile = #{incomingMobile},
</if>
<if test="incomingUserId != null">
incoming_user_id = #{incomingUserId},
</if>
<if test="callStartTime != null">
call_start_time = #{callStartTime},
</if>
<if test="callEndTime != null">
call_end_time = #{callEndTime},
</if>
<if test="recordUrl != null">
record_url = #{recordUrl},
</if>
<if test="callStatus != null">
call_status = #{callStatus},
</if>
<if test="failReason != null">
fail_reason = #{failReason},
</if>
<if test="creater != null">
creater = #{creater},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updater != null">
updater = #{updater},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="remark != null">
remark = #{remark},
</if>
</set>
where trans_no = #{transNo}
</update>
<select id="selectByTransNo" resultType="com.cool.store.entity.CallRecordDO">
select
<include refid="Base_Column_List" />
from call_record
where trans_no = #{transNo}
</select>
</mapper>

View File

@@ -0,0 +1,168 @@
<?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.cool.store.mapper.HyFollowTaskMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyFollowTaskDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="partner_line_id" jdbcType="BIGINT" property="partnerLineId"/>
<result column="follow_user_id" jdbcType="VARCHAR" property="followUserId"/>
<result column="task_title" jdbcType="VARCHAR" property="taskTitle"/>
<result column="communication_type" jdbcType="TINYINT" property="communicationType"/>
<result column="deadline" jdbcType="TIMESTAMP" property="deadline"/>
<result column="communication_content" jdbcType="VARCHAR" property="communicationContent"/>
<result column="task_status" jdbcType="TINYINT" property="taskStatus"/>
<result column="deleted" jdbcType="BIT" property="deleted"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, partner_line_id, follow_user_id, task_title, communication_type, deadline, communication_content,
task_status, deleted, create_time, update_time
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_follow_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null">
partner_line_id,
</if>
<if test="record.followUserId != null">
follow_user_id,
</if>
<if test="record.taskTitle != null">
task_title,
</if>
<if test="record.communicationType != null">
communication_type,
</if>
<if test="record.deadline != null">
deadline,
</if>
<if test="record.communicationContent != null">
communication_content,
</if>
<if test="record.taskStatus != null">
task_status,
</if>
<if test="record.deleted != null">
deleted,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null">
#{record.partnerLineId},
</if>
<if test="record.followUserId != null">
#{record.followUserId},
</if>
<if test="record.taskTitle != null">
#{record.taskTitle},
</if>
<if test="record.communicationType != null">
#{record.communicationType},
</if>
<if test="record.deadline != null">
#{record.deadline},
</if>
<if test="record.communicationContent != null">
#{record.communicationContent},
</if>
<if test="record.taskStatus != null">
#{record.taskStatus},
</if>
<if test="record.deleted != null">
#{record.deleted},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update hy_follow_task
<set>
<if test="record.partnerLineId != null">
partner_line_id = #{record.partnerLineId},
</if>
<if test="record.followUserId != null">
follow_user_id = #{record.followUserId},
</if>
<if test="record.taskTitle != null">
task_title = #{record.taskTitle},
</if>
<if test="record.communicationType != null">
communication_type = #{record.communicationType},
</if>
<if test="record.deadline != null">
deadline = #{record.deadline},
</if>
<if test="record.communicationContent != null">
communication_content = #{record.communicationContent},
</if>
<if test="record.taskStatus != null">
task_status = #{record.taskStatus},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
</set>
where id = #{record.id}
</update>
<select id="getTaskListByLineId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
hy_follow_task
where
deleted = '0' and partner_line_id = #{partnerLineId}
</select>
<select id="getTaskPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
hy_follow_task
where
deleted = '0' and follow_user_id = #{followUserId}
<if test="taskStatus != null">
and task_status = #{taskStatus}
</if>
<if test="deadlineStartTIme != null">
and deadline >= #{deadlineStartTIme}
</if>
<if test="deadlineEndTIme != null">
<![CDATA[ and deadline <= #{deadlineEndTIme}]]>
</if>
</select>
<select id="getFollowTask" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
hy_follow_task
where
deleted = '0' and id = #{followTaskId}
</select>
<update id="updateUndoTaskFollowUserId">
update hy_follow_task set follow_user_id = #{followUserId} where partner_line_id = #{partnerLineId}
</update>
<update id="cancelUndoFollowTask">
update hy_follow_task set task_status = '3' where partner_line_id = #{partnerLineId} and task_status in ('0', '2')
</update>
</mapper>

View File

@@ -0,0 +1,179 @@
<?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.cool.store.mapper.HyOutboundMobileMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyOutboundMobileDO">
<id column="id" property="id" />
<result column="mobile" property="mobile" />
<result column="remark" property="remark" />
<result column="edit_user_id" property="editUserId" />
<result column="create_user_id" property="createUserId" />
<result column="update_user_id" property="updateUserId" />
<result column="deleted" property="deleted" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, mobile, remark, edit_user_id, create_user_id, update_user_id, deleted, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_outbound_mobile
where id = #{id}
</select>
<select id="selectByPrimarySelective" resultType="com.cool.store.entity.HyOutboundMobileDO">
select <include refid="Base_Column_List" />
from hy_outbound_mobile
where deleted = 0
<if test="id != null">
id = #{id}
</if>
<if test="mobile != null and mobile != ''">
and mobile = #{mobile}
</if>
<if test="editUserId != null and editUserId != ''">
and edit_user_id = #{editUserId}
</if>
<if test="remark != null and remark != ''">
and remark = #{remark}
</if>
<if test="createUserId != null">
and create_user_id = #{createUserId}
</if>
<if test="updateUserId != null">
and update_user_id = #{updateUserId}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from hy_outbound_mobile
where id = #{id}
</delete>
<insert id="insert" parameterType="com.cool.store.entity.HyOutboundMobileDO">
insert into hy_outbound_mobile (id, mobile, edit_user_id, remark,
create_user_id, update_user_id, deleted,
create_time, update_time)
values (#{id}, #{mobile}, #{editUserId}, #{remark},
#{createUserId}, #{updateUserId}, #{deleted},
#{createTime}, #{updateTime})
</insert>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyOutboundMobileDO">
insert into hy_outbound_mobile
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="mobile != null and mobile != ''">
mobile,
</if>
<if test="editUserId != null and editUserId != ''">
edit_user_id,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
<if test="createUserId != null">
create_user_id,
</if>
<if test="updateUserId != null">
update_user_id,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="mobile != null and mobile != ''">
#{mobile},
</if>
<if test="remark != null and remark != ''">
#{remark},
</if>
<if test="editUserId != null and editUserId != ''">
#{editUserId},
</if>
<if test="createUserId != null">
#{createUserId},
</if>
<if test="updateUserId != null">
#{updateUserId},
</if>
<if test="deleted != null">
#{deleted},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyOutboundMobileDO">
update hy_outbound_mobile
<set>
<if test="mobile != null and mobile != ''">
mobile = #{mobile},
</if>
<if test="remark != null and remark != ''">
remark = #{remark},
</if>
<if test="editUserId != null and editUserId != ''">
edit_user_id = #{editUserId},
</if>
<if test="createUserId != null">
create_user_id = #{createUserId},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId},
</if>
<if test="deleted != null">
deleted = #{deleted},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
</set>
where id = #{id}
</update>
<update id="updateByPrimaryKey" parameterType="com.cool.store.entity.HyOutboundMobileDO">
update hy_outbound_mobile
set mobile = #{mobile},
edit_user_id = #{editUserId},
remark = #{remark},
create_user_id = #{createUserId},
update_user_id = #{updateUserId},
deleted = #{deleted},
create_time = #{createTime},
update_time = #{updateTime}
where id = #{id}
</update>
<!-- 获取呼出手机号列表 -->
<select id="getOutboundNumberList" resultType="com.cool.store.vo.HyOutboundVo">
SELECT t1.id, t1.mobile as outboundNumber, t2.name as updaterName, t2.mobile as updaterMobile, t1.update_time as update_time
FROM hy_outbound_mobile t1
LEFT JOIN enterprise_user t2 ON t1.edit_user_id = t2.user_id
WHERE t2.deleted = 0 AND t1.deleted = 0
AND t1.edit_user_id = #{userId}
</select>
</mapper>

View File

@@ -261,13 +261,47 @@
b.id as id,
b.create_time as partnerSubmitTime,
b.deadline as deadline,
bi.user_portrait as userPortrait,
hpuinfo.mobile as mobile,
hpuinfo.username as partnerUserName,
hpuinfo.user_channel_id as userChannelId,
hpuinfo.live_area as liveArea,
hpuinfo.want_shop_area as wantShopArea,
hpuinfo.accept_adjust_type as acceptAdjustType
hpuinfo.accept_adjust_type as acceptAdjustType,
cr.create_time as lastFollowTime,
cr.call_status as callStatus
from hy_partner_line_info a
left join hy_partner_intent_info b on a.id = b.partner_line_id
left join hy_partner_base_info bi on a.id = bi.partner_line_id
LEFT JOIN hy_partner_user_info hpuinfo ON a.partner_id = hpuinfo.partner_id
LEFT join call_record cr on a.id = cr.partner_line_id
where deleted = 0 and line_status!=3
and (cr.id in (
select max(id) maxId
from call_record group by partner_line_id) or cr.id is null)
<if test="keyword!=null and keyword!=''">
and (hpuinfo.mobile like concat('%',#{keyword},'%') or hpuinfo.username like concat('%',#{keyword},'%'))
</if>
<if test="callStatus!=null and callStatus==1">
and cr.call_status = #{callStatus}
</if>
<if test="callStatus!=null and callStatus==0">
and cr.call_status != 1
</if>
<if test="lastFollowStartTime!=null and lastFollowEndTime!=null">
and cr.create_time>#{lastFollowStartTime} and cr.create_time <![CDATA[<]]> #{lastFollowEndTime}
</if>
<if test="userChannelIdList!=null and userChannelIdList.size>0">
<foreach collection="userChannelIdList" open="and hpuinfo.user_channel_id in (" close=")" separator="," item="userChannelId">
#{userChannelId}
</foreach>
</if>
<if test="userPortraitIdList!=null and userPortraitIdList.size>0">
and
<foreach collection="userPortraitIdList" separator="or" open="(" close=")" item="userPortraitId">
bi.user_portrait like concat("%,", #{userPortraitId}, ",%")
</foreach>
</if>
<if test="userId!=null and userId!=''">
and a.investment_manager = #{userId}
</if>

View File

@@ -302,6 +302,9 @@
hpli.partner_id as partnerId,
hpli.deadline as deadline,
hpli.workflow_status as status,
cr.create_time as lastFollowTime,
cr.call_status as callStatus,
bi.user_portrait as userPortrait,
a.id as interviewId,
a.auth_code as authCode,
a.approve_time as approveTime,
@@ -315,24 +318,26 @@
hpci.intention_contract_no as intentionContractNo
from hy_partner_line_info hpli
left join hy_partner_interview a on hpli.id = a.partner_line_id
left join hy_partner_base_info bi on hpli.id = bi.partner_line_id
left join hy_partner_interview_plan b on a.interview_plan_id = b.id
left join hy_partner_certification_info hpci on hpci.partner_interview_id = a.id
<where>
and hpli.deleted = 0 and hpli.line_status!=3
<if test="filter">
and b.deleted = 0
</if>
<if test="workflowStage!=null and workflowStage!=''">
and hpli.workflow_stage = #{workflowStage}
</if>
<if test="workflowStatus!=null and workflowStatus!=''">
and hpli.workflow_status = #{workflowStatus}
</if>
<if test="userId!=null and userId!=''">
and hpli.investment_manager = #{userId}
</if>
</where>
LEFT join call_record cr on hpli.id = cr.partner_line_id
where hpli.deleted = 0 and hpli.line_status!=3
and (cr.id in (
select max(id) maxId
from call_record group by partner_line_id) or cr.id is null)
<if test="filter">
and b.deleted = 0
</if>
<if test="workflowStage!=null and workflowStage!=''">
and hpli.workflow_stage = #{workflowStage}
</if>
<if test="workflowStatus!=null and workflowStatus!=''">
and hpli.workflow_status = #{workflowStatus}
</if>
<if test="userId!=null and userId!=''">
and hpli.investment_manager = #{userId}
</if>
</select>
<select id="getInterviewList" resultType="com.cool.store.vo.interview.InterviewVO">

View File

@@ -0,0 +1,226 @@
<?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.cool.store.mapper.HyPartnerLabelGroupMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerLabelGroupDO">
<id column="id" property="id" />
<result column="label_group_name" property="labelGroupName" />
<result column="deleted" property="deleted" />
<result column="edit_user_id" property="editUserId" />
<result column="edit_date" property="editDate" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="create_user_id" property="createUserId" />
<result column="update_user_id" property="updateUserId" />
<result column="remark" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, label_group_name, deleted, edit_user_id, edit_date, create_time, update_time,
create_user_id, update_user_id, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_partner_label_group
where id = #{id}
order by create_time
</select>
<select id="selectSelective" resultType="com.cool.store.entity.HyPartnerLabelGroupDO">
select <include refid="Base_Column_List"></include>
from hy_partner_label_group
where deleted = 0
<if test="labelGroupName != null and labelGroupName != ''">
and label_group_name = #{labelGroupName}
</if>
<if test="editUserId != null">
and edit_user_id = #{editUserId}
</if>
<if test="editDate != null">
and edit_date = #{editDate}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time =#{updateTime}
</if>
<if test="createUserId != null">
and create_user_id = #{createUserId}
</if>
<if test="updateUserId != null">
and update_user_id = #{updateUserId}
</if>
<if test="remark != null and remark != ''">
and remark like concat('%', #{remark}, '%')
</if>
order by create_time
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from hy_partner_label_group
where id = #{id}
<if test="id != null">
and id = #{id}
</if>
<if test="labelGroupName != null and labelGroupName != ''">
and label_group_name like concat('%', #{labelGroupName}, '%')
</if>
<if test="editUserId != null">
and edit_user_id = #{editUserId}
</if>
<if test="editDate != null">
and edit_date = #{editDate}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time =#{updateTime}
</if>
<if test="createUserId != null">
and create_user_id = #{createUserId}
</if>
<if test="updateUserId != null">
and update_user_id = #{updateUserId}
</if>
<if test="remark != null and remark != ''">
and remark like concat('%', #{remark}, '%')
</if>
</delete>
<insert id="insert" parameterType="com.cool.store.entity.HyPartnerLabelGroupDO">
insert into hy_partner_label_group (id, label_group_name, deleted,
edit_user_id, edit_date, create_time,
update_time, create_user_id, update_user_id,
remark)
values (#{id}, #{labelGroupName}, #{deleted},
#{editUserId}, #{editDate}, #{createTime},
#{updateTime}, #{createUserId}, #{updateUserId},
#{remark})
</insert>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyPartnerLabelGroupDO">
insert into hy_partner_label_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="labelGroupName != null and labelGroupName != ''">
label_group_name,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="editUserId != null">
edit_user_id,
</if>
<if test="editDate != null">
edit_date,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createUserId != null">
create_user_id,
</if>
<if test="updateUserId != null">
update_user_id,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="labelGroupName != null">
#{labelGroupName},
</if>
<if test="deleted != null">
#{deleted},
</if>
<if test="editUserId != null">
#{editUserId},
</if>
<if test="editDate != null">
#{editDate},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="createUserId != null">
#{createUserId},
</if>
<if test="updateUserId != null">
#{updateUserId},
</if>
<if test="remark != null">
#{remark},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyPartnerLabelGroupDO">
update hy_partner_label_group
<set>
<if test="labelGroupName != null">
label_group_name = #{labelGroupName},
</if>
<if test="deleted != null">
deleted = #{deleted},
</if>
<if test="editUserId != null">
edit_user_id = #{editUserId},
</if>
<if test="editDate != null">
edit_date = #{editDate},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="createUserId != null">
create_user_id = #{createUserId},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId},
</if>
<if test="remark != null">
remark = #{remark},
</if>
</set>
where id = #{id}
</update>
<update id="updateByPrimaryKey" parameterType="com.cool.store.entity.HyPartnerLabelGroupDO">
update hy_partner_label_group
set label_group_name = #{labelGroupName},
deleted = #{deleted},
edit_user_id = #{editUserId},
edit_date = #{editDate},
create_time = #{createTime},
update_time = #{updateTime},
create_user_id = #{createUserId},
update_user_id = #{updateUserId},
remark = #{remark}
where id = #{id}
</update>
<!-- 获取标签分组信息列表 -->
<select id="getLabelGroupList" resultType="com.cool.store.vo.LabelGroupListVo">
SELECT t1.id, t1.label_group_name, t2.`name` AS editName, t2.mobile AS editMobile, t1.edit_date
FROM hy_partner_label_group t1
LEFT JOIN enterprise_user t2 ON t1.edit_user_id = t2.user_id
WHERE t1.deleted = 0
<if test="labelGroupName != null and labelGroupName != ''">
AND t1.label_group_name LIKE CONCAT('%', #{labelGroupName}, '%')
</if>
ORDER BY t1.create_time DESC
</select>
</mapper>

View File

@@ -0,0 +1,234 @@
<?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.cool.store.mapper.HyPartnerLabelMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerLabelDO">
<id column="id" property="id" />
<result column="label_group_id" property="labelGroupId" />
<result column="label_name" property="labelName" />
<result column="edit_user_id" property="editUserId" />
<result column="edit_date" property="editDate" />
<result column="deleted" property="deleted" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="create_user_id" property="createUserId" />
<result column="update_user_id" property="updateUserId" />
<result column="remark" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, label_group_id, label_name, edit_user_id, edit_date, deleted, create_time, update_time,
create_user_id, update_user_id, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_partner_label
where deleted = 0
and id = #{id}
order by create_time desc
</select>
<select id="selectSelective" resultType="com.cool.store.entity.HyPartnerLabelDO">
select <include refid="Base_Column_List"></include>
from hy_partner_label
where deleted = 0
<if test="labelGroupId != null">
and label_group_id = #{labelGroupId}
</if>
<if test="labelName != null and labelName != ''">
and label_name = #{labelName}
</if>
<if test="editUserId != null">
and edit_user_id = #{editUserId}
</if>
<if test="editDate != null">
and edit_date = #{editDate}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createUserId != null">
and create_user_id = #{createUserId}
</if>
<if test="updateUserId != null">
and update_user_id = #{updateUserId}
</if>
<if test="remark != null">
and remark = #{remark}
</if>
order by create_time desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from hy_partner_label
where id = #{id}
</delete>
<insert id="insert" parameterType="com.cool.store.entity.HyPartnerLabelDO">
insert into hy_partner_label (id, label_group_id, label_name,
edit_user_id, edit_date, deleted,
create_time, update_time, create_user_id,
update_user_id, remark)
values (#{id}, #{labelGroupId}, #{labelName},
#{editUserId}, #{editDate}, #{deleted},
#{createTime}, #{updateTime}, #{createUserId},
#{updateUserId}, #{remark})
</insert>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyPartnerLabelDO">
insert into hy_partner_label
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="labelGroupId != null">
label_group_id,
</if>
<if test="labelName != null">
label_name,
</if>
<if test="editUserId != null">
edit_user_id,
</if>
<if test="editDate != null">
edit_date,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createUserId != null">
create_user_id,
</if>
<if test="updateUserId != null">
update_user_id,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="labelGroupId != null">
#{labelGroupId},
</if>
<if test="labelName != null">
#{labelName},
</if>
<if test="editUserId != null">
#{editUserId},
</if>
<if test="editDate != null">
#{editDate},
</if>
<if test="deleted != null">
#{deleted},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="createUserId != null">
#{createUserId},
</if>
<if test="updateUserId != null">
#{updateUserId},
</if>
<if test="remark != null">
#{remark},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyPartnerLabelDO">
update hy_partner_label
<set>
<if test="labelGroupId != null">
label_group_id = #{labelGroupId},
</if>
<if test="labelName != null and labelName != ''">
label_name = #{labelName},
</if>
<if test="editUserId != null">
edit_user_id = #{editUserId},
</if>
<if test="editDate != null">
edit_date = #{editDate},
</if>
<if test="deleted != null">
deleted = #{deleted},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="createUserId != null">
create_user_id = #{createUserId},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId},
</if>
<if test="remark != null">
remark = #{remark},
</if>
</set>
where deleted = 0
and id = #{id}
</update>
<update id="updateByPrimaryKey" parameterType="com.cool.store.entity.HyPartnerLabelDO">
update hy_partner_label
set label_group_id = #{labelGroupId},
label_name = #{labelName},
edit_user_id = #{editUserId},
edit_date = #{editDate},
deleted = #{deleted},
create_time = #{createTime},
update_time = #{updateTime},
create_user_id = #{createUserId},
update_user_id = #{updateUserId},
remark = #{remark}
where id = #{id}
</update>
<select id="getLabelList" resultType="com.cool.store.vo.LabelListVo">
SELECT t1.id, t2.id AS labelGroupId, t1.label_name, t2.label_group_name, t3.`name` AS editName, t3.mobile AS editMobile, t1.edit_date
FROM hy_partner_label t1
LEFT JOIN hy_partner_label_group t2 ON t1.label_group_id = t2.id
LEFT JOIN enterprise_user t3 ON t1.edit_user_id = t3.user_id
WHERE t1.deleted = 0 AND t2.deleted = 0
<if test="labelName != null and labelName != ''">
AND t1.label_name LIKE CONCAT('%', #{labelName} ,'%')
</if>
<if test="labelGroupId != null">
AND t2.id = #{labelGroupId}
</if>
ORDER BY t1.create_time DESC
</select>
<select id="whetherGroupInUse" resultType="java.lang.Boolean">
SELECT COUNT(*)
FROM hy_partner_label
WHERE deleted = 0
AND label_group_id = #{labelGroupId}
</select>
<select id="getLabelListByIds" resultMap="BaseResultMap">
select * from hy_partner_label where deleted = 0
<if test="labelIds!=null and labelIds.size>0">
<foreach collection="labelIds" item="labelId" open="and id in (" close=")" separator=",">
#{labelId}
</foreach>
</if>
</select>
</mapper>

View File

@@ -441,12 +441,15 @@
a.update_time as updateTime,
b.partner_id as partner_id,
b.mobile as mobile,
b.user_channel_id as userChannelId,
b.username as userName,
b.want_shop_area as wantShopArea,
b.accept_adjust_type as acceptAdjustType,
bi.user_portrait as userPortrait,
hpl.phone_address as phoneAddress
FROM hy_partner_line_info a
inner JOIN hy_partner_user_info b on a.partner_id = b.partner_id
left join hy_partner_base_info bi on hpli.id = bi.partner_line_id
LEFT JOIN hy_open_area_info hoai ON hoai.id = b.want_shop_area
LEFT JOIN hy_phone_location hpl ON hpl.phone_number = b.mobile
where a.line_status = 0 and a.deleted = 0
@@ -485,6 +488,7 @@
hpli.development_manager as developmentManager,
hpli.line_status as lineStatus,
hpli.update_time as updateTime,
hpuinfo.user_channel_id as userChannelId,
hpuinfo.want_shop_area as wantShopArea,
hpuinfo.accept_adjust_type as acceptAdjustType,
hpuinfo.username as partnerUserName,
@@ -493,11 +497,13 @@
hpuinfo.shop_name as storeName,
hpuinfo.recommend_partner_name as recommendPartnerName,
hpuinfo.recommend_partner_mobile as recommendPartnerMobile,
bi.user_portrait as userPortrait,
eu.name as investmentManagerName,
eu.mobile as investmentManagerMobile
FROM
hy_partner_line_info hpli
LEFT JOIN hy_partner_intent_info hpii ON hpli.id = hpii.partner_line_id
left join hy_partner_base_info bi on hpli.id = bi.partner_line_id
LEFT JOIN hy_partner_user_info hpuinfo ON hpli.partner_id = hpuinfo.partner_id
LEFT JOIN enterprise_user eu ON hpli.investment_manager = eu.user_id
LEFT JOIN hy_open_area_info hoai ON hoai.id = hpuinfo.want_shop_area
@@ -660,4 +666,18 @@
</foreach>
</update>
<select id="getPartnerSimpleInfoByLineIds" resultType="com.cool.store.dto.partner.PartnerSimpleInfoDTO">
select
a.id as partnerLineId,
a.partner_id as partnerId,
a.workflow_stage as workflowStage,
a.line_status as lineStatus,
b.username as username,
b.mobile as mobile
from
hy_partner_line_info a inner join hy_partner_user_info b on a.partner_id = b.partner_id and a.deleted = '0'
where
a.id in <foreach collection="partnerLineIds" open="(" close=")" separator="," item="lineId">#{lineId}</foreach>
</select>
</mapper>

View File

@@ -90,4 +90,19 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="getAllUserChannel" resultMap="BaseResultMap">
select * from hy_partner_user_channel
</select>
<select id="getUserChannelByIds" resultMap="BaseResultMap">
select * from hy_partner_user_channel
<where>
<if test="userChannelIds!=null and userChannelIds.size>0">
<foreach collection="userChannelIds" item="userChannelId" open="channel_id in (" close=")" separator=",">
#{userChannelId}
</foreach>
</if>
</where>
</select>
</mapper>

View File

@@ -1,5 +1,6 @@
package generator.defined;
import org.apache.commons.lang3.StringUtils;
import org.mybatis.generator.api.CommentGenerator;
import org.mybatis.generator.api.IntrospectedColumn;
import org.mybatis.generator.api.IntrospectedTable;
@@ -63,6 +64,8 @@ public class MyCommentGenerator extends DefaultCommentGenerator implements Comme
topLevelClass.addJavaDocLine(" * @author " + author);
topLevelClass.addJavaDocLine(" * @date " + currentDateStr);
topLevelClass.addJavaDocLine(" */");
String tableName = "\"" +introspectedTable.getFullyQualifiedTableNameAtRuntime()+"\"";
topLevelClass.addAnnotation("@Table(name = "+tableName+")");
}
@Override

View File

@@ -20,10 +20,13 @@ import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.InsertSelective
import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.UpdateByPrimaryKeySelectiveElementGenerator;
import org.mybatis.generator.config.GeneratedKey;
import org.mybatis.generator.config.PropertyRegistry;
import org.mybatis.generator.internal.rules.Rules;
import org.mybatis.generator.internal.util.JavaBeansUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
import static org.mybatis.generator.internal.util.messages.Messages.getString;
@@ -67,17 +70,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
return JavaBeansUtil.getCamelCaseString(tableName,true);
}
private boolean isConfigTable() {
String tableName = this.getTableConfiguration().getTableName();
String tableSuffix = tableName.substring(tableName.lastIndexOf("_") + 1);
if(StringUtils.isNotBlank(tableSuffix) && tableSuffix.length() == 32){
//企业库
return false;
}
//平台库
return true;
}
@Override
protected String calculateMyBatis3XmlMapperFileName() {
StringBuilder sb = new StringBuilder();
@@ -93,12 +85,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
}
StringBuilder sb = new StringBuilder();
sb.append(calculateJavaClientImplementationPackage());
sb.append('.');
sb.append(getTableNameFromConfigFile());
sb.append("DAOImpl"); //$NON-NLS-1$
setDAOImplementationType(sb.toString());
sb.setLength(0);
sb.append(calculateJavaClientInterfacePackage());
sb.append('.');
@@ -204,12 +190,17 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
context.getCommentGenerator().addRootComment(answer);
addResultMapWithoutBLOBsElement(answer);
addResultMapWithBLOBsElement(answer);
addExampleWhereClauseElement(answer);
addMyBatis3UpdateByExampleWhereClauseElement(answer);
addBaseColumnListElement(answer);
addBlobColumnListElement(answer);
addInsertSelectiveElement(answer);
/*addInsertSelectiveElement(answer);
addUpdateByPrimaryKeySelectiveElement(answer);
addMyBatis3UpdateByExampleWhereClauseElement(answer);
addExampleWhereClauseElement(answer);
addSelectByExampleWithBLOBsElement(answer);
addSelectByExampleWithoutBLOBsElement(answer);
addUpdateByExampleWithBLOBsElement(answer);
addUpdateByExampleWithoutBLOBsElement(answer);
addUpdateByExampleSelectiveElement(answer);*/
return answer;
}
@@ -244,7 +235,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
@Override
public List<CompilationUnit> getCompilationUnits() {
boolean isConfig = isConfigTable();
progressCallback.startTask(getString("Progress.17", //$NON-NLS-1$
introspectedTable.getFullyQualifiedTable().toString()));
CommentGenerator commentGenerator = context.getCommentGenerator();
@@ -268,30 +258,25 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
interfaze.addSuperInterface(fqjt);
interfaze.addImportedType(fqjt);
}
if(!isConfig){
interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Param"));
}
addInsertSelectiveMethod(interfaze);
addUpdateByPrimaryKeySelectiveMethod(interfaze);
interfaze.addSuperInterface(new FullyQualifiedJavaType("tk.mybatis.mapper.common.Mapper<"+getTableNameFromConfigFile()+"DO>"));
interfaze.addImportedType(new FullyQualifiedJavaType("tk.mybatis.mapper.common.Mapper"));
interfaze.addImportedType(new FullyQualifiedJavaType(calculateJavaModelPackage() + "."+getTableNameFromConfigFile()+"DO"));
//addInsertSelectiveMethod(interfaze);
//addUpdateByPrimaryKeySelectiveMethod(interfaze);
List<Method> methods = interfaze.getMethods();
for (Method method : methods) {
List<Parameter> parameters = method.getParameters();
for (Parameter parameter : parameters) {
if(!isConfig){
String name = parameter.getName();
parameter.addAnnotation("@Param(\""+ name+"\")");
}
}
if(!isConfig){
Parameter enterpriseId = new Parameter(FullyQualifiedJavaType.getStringInstance(), "enterpriseId");
enterpriseId.addAnnotation("@Param(\"enterpriseId\")");
method.addParameter(enterpriseId);
String name = parameter.getName();
parameter.addAnnotation("@Param(\""+ name+"\")");
}
}
/*addSelectByExampleWithBLOBsMethod(interfaze);
addSelectByExampleWithoutBLOBsMethod(interfaze);
addUpdateByExampleSelectiveMethod(interfaze);
addUpdateByExampleWithoutBLOBsMethod(interfaze);*/
List<CompilationUnit> answer = new ArrayList<CompilationUnit>();
if (context.getPlugins().clientGenerated(interfaze, null,
introspectedTable)) {
if (context.getPlugins().clientGenerated(interfaze, null, introspectedTable)) {
answer.add(interfaze);
}
@@ -312,7 +297,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
@Override
public void addElements(XmlElement parentElement) {
boolean isConfig = isConfigTable();
XmlElement answer = new XmlElement("insert"); //$NON-NLS-1$
answer.addAttribute(new Attribute(
@@ -383,9 +367,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
}
sb.setLength(0);
if(!isConfig){
sb.append("record.");
}
sb.append("record.");
sb.append(introspectedColumn.getJavaProperty());
sb.append(" != null"); //$NON-NLS-1$
XmlElement insertNotNullElement = new XmlElement("if"); //$NON-NLS-1$
@@ -400,9 +382,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
insertTrimElement.addElement(insertNotNullElement);
sb.setLength(0);
if(!isConfig){
sb.append("record.");
}
sb.append("record.");
sb.append(introspectedColumn.getJavaProperty());
sb.append(" != null"); //$NON-NLS-1$
XmlElement valuesNotNullElement = new XmlElement("if"); //$NON-NLS-1$
@@ -410,11 +390,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
"test", sb.toString())); //$NON-NLS-1$
sb.setLength(0);
if(isConfig){
sb.append("#{"+introspectedColumn.getJavaProperty() + "}");
}else{
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
}
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
sb.append(',');
valuesNotNullElement.addElement(new TextElement(sb.toString()));
valuesTrimElement.addElement(valuesNotNullElement);
@@ -433,7 +409,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
@Override
public void addElements(XmlElement parentElement) {
boolean isConfig = isConfigTable();
XmlElement answer = new XmlElement("update"); //$NON-NLS-1$
answer.addAttribute(new Attribute(
@@ -446,10 +421,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
} else {
parameterType = introspectedTable.getBaseRecordType();
}
/*answer.addAttribute(new Attribute("parameterType", //$NON-NLS-1$
parameterType));*/
context.getCommentGenerator().addComment(answer);
StringBuilder sb = new StringBuilder();
@@ -463,9 +434,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
for (IntrospectedColumn introspectedColumn : ListUtilities.removeGeneratedAlwaysColumns(introspectedTable.getNonPrimaryKeyColumns())) {
sb.setLength(0);
if(!isConfig){
sb.append("record.");
}
sb.append("record.");
sb.append(introspectedColumn.getJavaProperty());
sb.append(" != null"); //$NON-NLS-1$
XmlElement isNotNullElement = new XmlElement("if"); //$NON-NLS-1$
@@ -476,11 +445,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
sb.append(MyBatis3FormattingUtilities
.getEscapedColumnName(introspectedColumn));
sb.append(" = ");
if(!isConfig){
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
}else{
sb.append("#{"+introspectedColumn.getJavaProperty() + "}");
}
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
sb.append(',');
isNotNullElement.addElement(new TextElement(sb.toString()));
@@ -499,11 +464,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
sb.append(MyBatis3FormattingUtilities
.getEscapedColumnName(introspectedColumn));
sb.append(" = ");
if(isConfig){
sb.append("#{"+introspectedColumn.getJavaProperty() + "}");
}else{
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
}
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
answer.addElement(new TextElement(sb.toString()));
}

View File

@@ -42,6 +42,7 @@ public class MyPluginAdapter extends PluginAdapter {
topLevelClass.addImportedType("lombok.NoArgsConstructor");
topLevelClass.addImportedType("lombok.AllArgsConstructor");
topLevelClass.addImportedType("io.swagger.annotations.ApiModelProperty");
topLevelClass.addImportedType("javax.persistence.Table");
topLevelClass.addAnnotation("@Data");
topLevelClass.addAnnotation("@Builder");
topLevelClass.addAnnotation("@NoArgsConstructor");

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<properties resource="mybatis-generator.properties" />
<context id="Mysql" targetRuntime="MyBatis3Simple" defaultModelType="flat">
<plugin type="tk.mybatis.mapper.generator.MapperPlugin">
<property name="mappers" value="tk.mybatis.mapper.common.Mapper" />
<!-- caseSensitive默认false当数据库表名区分大小写时可以将该属性设置为true -->
<property name="caseSensitive" value="true" />
</plugin>
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="${jdbc.url}" userId="${jdbc.user}" password="${jdbc.password}">
<property name="nullCatalogMeansCurrent" value="true" />
</jdbcConnection>
<!-- targetProject:生成PO类的位置 -->
<javaModelGenerator targetPackage="com.cool.store.entity" targetProject="coolstore-partner-model/src/main/java">
<property name="enableSubPackages" value="true"/>
</javaModelGenerator>
<!-- targetProject:mapperXML映射文件生成的位置 -->
<sqlMapGenerator targetPackage="mapper" targetProject="coolstore-partner-dao/src/main/resources" />
<!-- targetPackagemapper接口生成的位置 -->
<javaClientGenerator targetPackage="com.cool.store.mapper" targetProject="coolstore-partner-dao/src/main/java" type="XMLMAPPER" />
<table tableName="${table.name}" enableCountByExample="false" enableUpdateByExample="true" enableDeleteByExample="false"
enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" type=""/>
</table>
</context>
</generatorConfiguration>

View File

@@ -3,4 +3,4 @@ jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcoll
jdbc.user= coolstore
jdbc.password = CSCErYcXniNYm7bT
table.name = hy_inspection_setting_mapping
table.name = sys_menu_copy1