Commit be3eb8b0 by Water Wang

optimize

parent d485e78b
......@@ -96,18 +96,18 @@ public class CustomerServiceImpl implements CustomerService{
List<AclCustomer> aclCustomerList = aclCustomerDALService.findByLogin(mobileNo);
if(aclCustomerList.isEmpty()){
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
mobileNo = jpaCryptoConverter.encode(mobileNo);
AclCustomer aclCustomer = new AclCustomer();
aclCustomer.setRole(2);//1= Staff 2=Customer 3=Partner
aclCustomer.setAccountId(accountId);
aclCustomer.setLogin(mobileNo);
aclCustomer.setMobileNo(mobileNo);
aclCustomer.setMobileNo(jpaCryptoConverter.encode(mobileNo));
aclCustomer.setPassword(EncryptUtil.encrypt(requestVO.getPassword(),null));
aclCustomer.setEmail(requestVO.getEmail());
aclCustomer.setCusLevel(1);
aclCustomer.setName(requestVO.getName());
aclCustomer.setIsActive(1);
aclCustomer.setRoleId(3L);
aclCustomer.setWithdrawType(0);
aclCustomer.setCreatedAt(new Date());
aclCustomer.setCreatedBy(-1L);
aclCustomer.setUpdatedAt(new Date());
......
......@@ -15,17 +15,9 @@ import com.yd.api.practitioner.vo.recruit.*;
import com.yd.api.practitioner.vo.setting.*;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.*;
import com.yd.dal.entity.practitioner.*;
import com.yd.dal.entity.tencent.TenInterfRecord;
import com.yd.dal.service.customer.AclCustomerLogDALService;
import com.yd.dal.service.customer.AclFileUploadDALService;
import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.dal.service.customer.AclPractitionerPotentialDALService;
import com.yd.dal.entity.customer.practitioner.*;
import com.yd.dal.service.customer.*;
import com.yd.dal.service.meta.MdCodeDALService;
import com.yd.dal.service.practitioner.PractitionerDALService;
import com.yd.dal.service.practitioner.PractitionerSubordinateDALService;
import com.yd.dal.service.tencent.TenInterfRecordDALService;
import com.yd.dal.service.transaction.TranLogDALService;
import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.tencent.wechat.service.WechatService;
import com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest;
......@@ -56,13 +48,13 @@ import java.util.List;
public class PractitionerServiceImpl implements com.yd.api.practitioner.service.PractitionerService {
@Autowired
private PractitionerDALService practitionerDALService;
private AclPractitionerDALService aclPractitionerDALService;
@Autowired
private MdCodeDALService mdCodeDALService;
@Autowired
private AclFileUploadDALService aclFileUploadDALService;
@Autowired
private PractitionerSubordinateDALService practitionerSubordinateDALService;
private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDALService;
@Autowired
private AclCustomerLogDALService aclCustomerLogDALService;
@Autowired
......@@ -72,9 +64,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
@Autowired
private CustomerService customerService;
@Autowired
private AclPractitionerDALService aclPractitionerDALService;
@Autowired
private AclPractitionerPotentialDALService aclPractitionerPotentialDALService;
@Autowired
private AclPractitionerPotentialAssignedTrackDALService aclPractitionerPotentialAssignedTrackDALService;
@Override
public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) {
......@@ -87,7 +80,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return responseVO;
}
//2、检查是否在ag_acl_customer表中存在该用户,如果不存在就注册,然后直接抛错,该用户未注册为经纪人
PractitionerInfo practitionerInfo = practitionerDALService.findPractitionerInfoByLogin(mobileNo);
PractitionerInfo practitionerInfo = aclPractitionerDALService.findPractitionerInfoByLogin(mobileNo);
if(practitionerInfo != null){
Long practitionerType = practitionerInfo.getPractitionerType();
//处理特殊人员
......@@ -110,7 +103,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//获取体系信息
Long subordinateId = practitionerInfo.getSubordinateId();
if(subordinateId != null){
PractitionerSubordinateInfo subordinateInfo = practitionerSubordinateDALService.findSubordinateInfo(subordinateId);
PractitionerSubordinateInfo subordinateInfo = aclPractitionerSubordinateSystemDALService.findSubordinateInfo(subordinateId);
if(subordinateInfo != null){
basicInfo.setSubordinateName(subordinateInfo.getSubordinateName());
basicInfo.setSubordinateLeader(subordinateInfo.getSubordinateLeader());
......@@ -168,16 +161,16 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
List<PractitionerRankInfo> rankInfoList;
if(platform == 1){
Long practitionerTypeId = 28L;
rankInfoList = practitionerDALService.getPractitionerRankInfoForOnline(time,practitionerTypeId);
rankInfoList = aclPractitionerDALService.getPractitionerRankInfoForOnline(time,practitionerTypeId);
//特殊人员处理
String mobileSpecialStr = mdCodeDALService.findCodeByType("special_practitioner_mobile");
if(!Strings.isNullOrEmpty(mobileSpecialStr)){
List<String> mobileSpecials = Arrays.asList(mobileSpecialStr.split(","));
List<PractitionerRankInfo> rankInfoListSpecials = practitionerDALService.getPractitionerRankInfoForSpecials(mobileSpecials,time);
List<PractitionerRankInfo> rankInfoListSpecials = aclPractitionerDALService.getPractitionerRankInfoForSpecials(mobileSpecials,time);
rankInfoList.addAll(rankInfoListSpecials);
}
}else{
rankInfoList = practitionerDALService.getPractitionerRankInfoForOffline(time);
rankInfoList = aclPractitionerDALService.getPractitionerRankInfoForOffline(time);
}
return rankInfoList;
}
......@@ -185,7 +178,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private PractitionerBasicInfo getPractitionerBasicInfo(String mobileNo, Integer platform) {
PractitionerBasicInfo practitionerBasicInfo;
if(platform == 1){
practitionerBasicInfo = practitionerDALService.getPractitionerBasicInfoForOnline(mobileNo);
practitionerBasicInfo = aclPractitionerDALService.getPractitionerBasicInfoForOnline(mobileNo);
if(practitionerBasicInfo != null){
Long practitionerId = practitionerBasicInfo.getPractitionerIdForOnline();
if(practitionerId != null){
......@@ -193,7 +186,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
}
}
}else{
practitionerBasicInfo = practitionerDALService.getPractitionerBasicInfoForOffline(mobileNo);
practitionerBasicInfo = aclPractitionerDALService.getPractitionerBasicInfoForOffline(mobileNo);
}
return practitionerBasicInfo;
}
......@@ -248,7 +241,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
Long practitionerId = requestVO.getPractitionerId();//入参经纪人id
//需要查询的信息 1.自我介绍 2.我的设置 3.头像 4.个人微信二位码 5.生活照
//1.2均在ag_acl_practitioner表中查询
AclPractitionerInfo practitioner = practitionerDALService.findPractitionerById(practitionerId);
AclPractitionerInfo practitioner = aclPractitionerDALService.findPractitionerById(practitionerId);
String bioIntro = practitioner.getBioIntro();//经纪人个人介绍
Integer isMobileShow = practitioner.getIsMobileShow();
Integer isNameShow = practitioner.getIsNameShow();
......@@ -410,7 +403,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
RecruitResponseVO responseVO = new RecruitResponseVO();
String name = requestVO.getName();
String mobileNo = requestVO.getMobileNo();
if(!Strings.isNullOrEmpty(name) && !Strings.isNullOrEmpty(mobileNo)){
Long practitionerId = requestVO.getPractitionerId();
if(!Strings.isNullOrEmpty(name) && !Strings.isNullOrEmpty(mobileNo) && practitionerId != null){
if(mobileNo.length() != 11 || mobileNo.startsWith("1")){
RegisterRequestVO register = new RegisterRequestVO();
register.setMobileNo(mobileNo);
......@@ -425,33 +419,31 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
Long potentialId = requestVO.getPotentialId();
List<AclPractitionerPotential> practitionerPotentialList = aclPractitionerPotentialDALService.findByMobileNo(mobileNo,1);
if(potentialId != null || practitionerPotentialList.isEmpty()){
Long assignedId = requestVO.getAssignedId();
AclPractitionerPotential practitionerPotential = new AclPractitionerPotential();
BeanUtils.copyProperties(requestVO,practitionerPotential);
practitionerPotential.setCustomerId(customerId);
practitionerPotential.setPractitionerAssignedIds(assignedId.toString());
practitionerPotential.setPractitionerAssignedIds(practitionerId.toString());
practitionerPotential.setCreatedAt(new Date());
practitionerPotential.setCreatedBy(assignedId);
practitionerPotential.setCreatedBy(practitionerId);
practitionerPotential.setCreatorType(2);
practitionerPotential.setIsActive(1);
if(potentialId != null){
practitionerPotential.setId(potentialId);
}
practitionerPotential = aclPractitionerPotentialService.save(practitionerPotential);
aclPractitionerPotentialDALService.save(practitionerPotential);
potentialId = practitionerPotential.getId();
//如果已经分配团队长,则在追踪表中增加记录
if(assignedId != null){
List<Long> practitionerPotentialIdList = new ArrayList<>();
practitionerPotentialIdList.add(potentialId);
customerService.addPractitionerPotentialTrack(practitionerPotentialIdList, assignedId, operateUserId);
}
addPractitionerPotentialTrack(practitionerPotentialIdList, practitionerId);
responseVO.setPotentialCustomerId(customerId);
responseVO.setPotentialId(potentialId);
responseVO.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
}else{
responseVO.setPotentialCustomerId(customerId);
responseVO.setPotentialId(practitionerPotentialList.get(0).getId());
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("830061")));
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("830011")));
}
}else{
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("830010")));
......@@ -461,10 +453,31 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("630001",paras)));
}
}else{
String [] paras = {"name,mobileNo"};
String [] paras = {"name,mobileNo,practitionerId"};
responseVO.setCommonResult(new CommonResult(false,ZHBErrorConfig.getErrorInfo("610002",paras)));
}
return null;
return responseVO;
}
private void addPractitionerPotentialTrack(List<Long> practitionerPotentialIdList, Long practitionerId) {
if (practitionerId != null && !practitionerPotentialIdList.isEmpty()) {
List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList = new ArrayList<>();
AclPractitionerPotentialAssignedTrack potentialAssignedTrack;
for (Long potentialId : practitionerPotentialIdList) {
potentialAssignedTrack = new AclPractitionerPotentialAssignedTrack();
potentialAssignedTrack.setPractitionerPotentialId(potentialId);
potentialAssignedTrack.setPractitionerAssignedId(practitionerId);
potentialAssignedTrack.setTrackStatusId(112L);//待跟进
potentialAssignedTrack.setIsActive(1);
potentialAssignedTrack.setIsLasted(1);
potentialAssignedTrack.setCreatedAt(new Date());
potentialAssignedTrack.setCreatedBy(practitionerId);
potentialAssignedTrack.setCreatorType(2);
potentialAssignedTrackList.add(potentialAssignedTrack);
}
aclPractitionerPotentialAssignedTrackDALService.saveAll(potentialAssignedTrackList);
}
}
@Override
......@@ -515,14 +528,14 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
String settingSave = requestVO.getSettingSave();
if (settingSave.equalsIgnoreCase("isShow")||settingSave.equalsIgnoreCase("intro")){
Long practitionerId = requestVO.getPractitionerId();
AclPractitionerInfo practitioner = practitionerDALService.findPractitionerById(practitionerId);
AclPractitionerInfo practitioner = aclPractitionerDALService.findPractitionerById(practitionerId);
if (settingSave.equalsIgnoreCase("intro")){
practitioner.setBioIntro(requestVO.getBioIntro());
}else if (settingSave.equalsIgnoreCase("isShow")){
practitioner.setIsNameShow(requestVO.getIsNameShow());
practitioner.setIsMobileShow(requestVO.getIsMobileShow());
}
practitionerDALService.updatePractitioner(practitioner);
aclPractitionerDALService.updatePractitioner(practitioner);
}
}
......@@ -605,7 +618,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
updateImgOld(practitionerId,targetUseFor);
}
//保存到数据库
AclPractitionerInfo practitioner = practitionerDALService.findPractitionerById(practitionerId);
AclPractitionerInfo practitioner = aclPractitionerDALService.findPractitionerById(practitionerId);
AclFileUpload aclFileUpload = new AclFileUpload();
aclFileUpload.setTargetType(1);
aclFileUpload.setTargetId(practitioner.getId());
......
......@@ -15,7 +15,7 @@ public class RecruitRequestVO {
private String tag;
private String remark;
private String ossPathResume;
private Long assignedId;
private Long practitionerId;
public Long getPotentialId() {
return potentialId;
......@@ -129,11 +129,11 @@ public class RecruitRequestVO {
this.ossPathResume = ossPathResume;
}
public Long getAssignedId() {
return assignedId;
public Long getPractitionerId() {
return practitionerId;
}
public void setAssignedId(Long assignedId) {
this.assignedId = assignedId;
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
}
......@@ -282,5 +282,6 @@ public class AclCustomer implements Serializable {
*/
private Long age;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -64,5 +64,7 @@ public class AclPractitionerPotentialAssignedTrack implements Serializable {
private Integer updatorType;
private Integer isLasted;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.customer;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ag_acl_practitioner_subordinate_system
* @author
*/
@Data
public class AclPractitionerSubordinateSystem implements Serializable {
/**
* serial id
*/
private Long id;
/**
* FK ag_acl_insurer.id
*/
private Long insurerId;
/**
* FK ag_acl_insurer.id
*/
private Long insurerBranchId;
/**
* FK ag_acl_insurer_branch_dept.id 所属部门id
*/
private Long deptId;
/**
* 编码
*/
private String subordinateSystemCode;
/**
* dept name
*/
private String name;
/**
* dept english name
*/
private String nameEn;
/**
* FK ag_acl_practitioner.id,体系主管
*/
private Long ownerPractitionerId;
/**
* 联系人
*/
private String contactName;
/**
* 联系电话
*/
private String contactNo;
/**
* memo or tips
*/
private String remark;
/**
* 0=No, 1=Yes
*/
private Integer isActive;
private Date createdAt;
/**
* FK ag_acl_user.id
*/
private Long createdBy;
private Date updatedAt;
/**
* FK ag_acl_user.id
*/
private Long updatedBy;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yd.dal.entity.practitioner;
package com.yd.dal.entity.customer.practitioner;
import java.io.Serializable;
import java.util.Date;
......
package com.yd.dal.entity.practitioner;
package com.yd.dal.entity.customer.practitioner;
public class PractitionerBasicInfo {
private Long customerId;
......
package com.yd.dal.entity.practitioner;
package com.yd.dal.entity.customer.practitioner;
public class PractitionerInfo {
private Long customerId;
......
package com.yd.dal.entity.practitioner;
package com.yd.dal.entity.customer.practitioner;
public class PractitionerRankInfo {
private Long customerId;
......
package com.yd.dal.entity.practitioner;
package com.yd.dal.entity.customer.practitioner;
public class PractitionerSubordinateInfo {
private Long subordinateId;
......
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.entity.customer.practitioner.AclPractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerRankInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AclPractitionerMapper {
int deleteByPrimaryKey(Long id);
......@@ -9,9 +16,23 @@ public interface AclPractitionerMapper {
int insertSelective(AclPractitioner record);
AclPractitioner selectByPrimaryKey(Long id);
AclPractitionerInfo selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitioner record);
int updateByPrimaryKeySelective(AclPractitionerInfo record);
int updateByPrimaryKey(AclPractitioner record);
PractitionerBasicInfo getPractitionerInfoByMobileNoForOffline(String mobileNo);
List<PractitionerRankInfo> getPractitionerRankInfoForOffline(@Param("time") Integer time);
PractitionerBasicInfo getPractitionerInfoByMobileNoForOnline(String mobileNo);
List<PractitionerRankInfo> getPractitionerRankInfoForOnline(@Param("time")Integer time,@Param("practitionerTypeId")Long practitionerTypeId);
List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(@Param("mobileSpecials") List<String> mobileSpecials, @Param("time")Integer time);
PractitionerInfo findPractitionerInfoByLogin(@Param("mobileNo")String mobileNo);
AclPractitioner findByCustomerIdIsActive(@Param("customerId") Long customerId, @Param("isActive")int isActive);
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AclPractitionerPotentialAssignedTrackMapper {
int deleteByPrimaryKey(Long id);
......@@ -14,4 +16,6 @@ public interface AclPractitionerPotentialAssignedTrackMapper {
int updateByPrimaryKeySelective(AclPractitionerPotentialAssignedTrack record);
int updateByPrimaryKey(AclPractitionerPotentialAssignedTrack record);
void insertList(@Param("potentialAssignedTrackList") List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclPractitionerSubordinateSystem;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
public interface AclPractitionerSubordinateSystemMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerSubordinateSystem record);
int insertSelective(AclPractitionerSubordinateSystem record);
AclPractitionerSubordinateSystem selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerSubordinateSystem record);
int updateByPrimaryKey(AclPractitionerSubordinateSystem record);
PractitionerSubordinateInfo findSubordinateInfo(Long subordinateId);
}
\ No newline at end of file
package com.yd.dal.mapper.practitioner;
import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.entity.practitioner.AclPractitionerInfo;
import org.apache.ibatis.annotations.Param;
public interface AclPractitionerMapper {
int deleteByPrimaryKey(Long id);
int insert(AclPractitionerInfo record);
int insertSelective(AclPractitionerInfo record);
AclPractitionerInfo selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclPractitionerInfo record);
int updateByPrimaryKey(AclPractitionerInfo record);
AclPractitioner findByCustomerIdIsActive(@Param("customerId") Long customerId, @Param("isActive")int isActive);
}
\ No newline at end of file
package com.yd.dal.mapper.practitioner;
import com.yd.dal.entity.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.practitioner.PractitionerInfo;
import com.yd.dal.entity.practitioner.PractitionerRankInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface PractitionerMapper {
PractitionerBasicInfo getPractitionerInfoByMobileNoForOffline(String mobileNo);
List<PractitionerRankInfo> getPractitionerRankInfoForOffline(@Param("time") Integer time);
PractitionerBasicInfo getPractitionerInfoByMobileNoForOnline(String mobileNo);
List<PractitionerRankInfo> getPractitionerRankInfoForOnline(@Param("time")Integer time,@Param("practitionerTypeId")Long practitionerTypeId);
List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(@Param("mobileSpecials") List<String> mobileSpecials, @Param("time")Integer time);
PractitionerInfo findPractitionerInfoByLogin(@Param("mobileNo")String mobileNo);
}
package com.yd.dal.mapper.practitioner;
import com.yd.dal.entity.practitioner.PractitionerSubordinateInfo;
import org.apache.ibatis.annotations.Param;
public interface PractitionerSubordinateMapper {
PractitionerSubordinateInfo findSubordinateInfo(@Param("subordinateId") Long subordinateId);
}
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.entity.customer.practitioner.AclPractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerRankInfo;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerDALService")
public interface AclPractitionerDALService {
/**
......@@ -12,4 +18,58 @@ public interface AclPractitionerDALService {
* @return
*/
AclPractitioner findByCustomerIdIsActive(Long customerId, int i);
/**
* 线下--通过手机号码获取经纪人的基础信息
* @param mobileNo
* @return
*/
PractitionerBasicInfo getPractitionerBasicInfoForOffline(String mobileNo);
/**
* 线上--通过手机号码获取经纪人的基础信息
* @param mobileNo
* @return
*/
PractitionerBasicInfo getPractitionerBasicInfoForOnline(String mobileNo);
/**
* 线下--按照时间进行查询经纪人的排名统计信息
* @param time 1-month,2-year
* @return
*/
List<PractitionerRankInfo> getPractitionerRankInfoForOffline(Integer time);
/**
* 线上--按照时间进行查询经纪人的排名统计信息
* @param time 1-month,2-year
* @return
*/
List<PractitionerRankInfo> getPractitionerRankInfoForOnline(Integer time,Long practitionerTypeId);
/**
* 线上--按照时间进行查询特殊人员的排名统计信息
* @param mobileSpecials
* @return
*/
List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(List<String> mobileSpecials,Integer time);
/**
* 经纪人基本信息查询
* @param mobileNo
* @return
*/
PractitionerInfo findPractitionerInfoByLogin(String mobileNo);
/**
* 通过经纪人id查找经纪人
* @param practitionerId
* @return
*/
AclPractitionerInfo findPractitionerById(Long practitionerId);
/**
* 通过id更新practitioner
* @param practitioner
*/
void updatePractitioner(AclPractitionerInfo practitioner);
}
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialAssignedTrackDALService")
public interface AclPractitionerPotentialAssignedTrackDALService {
void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList);
}
......@@ -13,4 +13,11 @@ public interface AclPractitionerPotentialDALService {
* @return
*/
List<AclPractitionerPotential> findByMobileNo(String mobileNo,Integer isActive);
/**
* 保存
* @param practitionerPotential
* @return
*/
int save(AclPractitionerPotential practitionerPotential);
}
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
import org.springframework.stereotype.Service;
@Service("aclPractitionerSubordinateSystemDALService")
public interface AclPractitionerSubordinateSystemDALService {
PractitionerSubordinateInfo findSubordinateInfo(Long subordinateId);
}
package com.yd.dal.service.customer.impl;
import com.google.common.base.Strings;
import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.mapper.practitioner.AclPractitionerMapper;
import com.yd.dal.entity.customer.practitioner.AclPractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerInfo;
import com.yd.dal.entity.customer.practitioner.PractitionerRankInfo;
import com.yd.dal.mapper.customer.AclPractitionerMapper;
import com.yd.dal.service.customer.AclPractitionerDALService;
import org.springframework.beans.factory.annotation.Autowired;
import com.yd.util.intercept.annotation.TargetDataSource;
import com.yd.util.intercept.commons.DataSourceKey;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("aclPractitionerDALService")
public class AclPractitionerDALServiceImpl implements AclPractitionerDALService {
@Autowired
private static final Logger LOG = Logger.getLogger(AclPractitionerDALServiceImpl.class);
@Resource
private AclPractitionerMapper aclPractitionerMapper;
@Override
public AclPractitioner findByCustomerIdIsActive(Long customerId, int isActive) {
return aclPractitionerMapper.findByCustomerIdIsActive(customerId,isActive);
}
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_EGOLDEN)
public PractitionerBasicInfo getPractitionerBasicInfoForOffline(String mobileNo) {
if(!Strings.isNullOrEmpty(mobileNo)){
return aclPractitionerMapper.getPractitionerInfoByMobileNoForOffline(mobileNo);
}else{
LOG.error("mobileNo is null!");
}
return null;
}
@Override
public PractitionerBasicInfo getPractitionerBasicInfoForOnline(String mobileNo) {
if(!Strings.isNullOrEmpty(mobileNo)){
return aclPractitionerMapper.getPractitionerInfoByMobileNoForOnline(mobileNo);
}else{
LOG.error("mobileNo is null!");
}
return null;
}
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_EGOLDEN)
public List<PractitionerRankInfo> getPractitionerRankInfoForOffline(Integer time) {
return aclPractitionerMapper.getPractitionerRankInfoForOffline(time);
}
@Override
public List<PractitionerRankInfo> getPractitionerRankInfoForOnline(Integer time,Long practitionerTypeId) {
return aclPractitionerMapper.getPractitionerRankInfoForOnline(time,practitionerTypeId);
}
@Override
public List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(List<String> mobileSpecials,Integer time) {
return aclPractitionerMapper.getPractitionerRankInfoForSpecials(mobileSpecials,time);
}
@Override
public PractitionerInfo findPractitionerInfoByLogin(String mobileNo) {
return aclPractitionerMapper.findPractitionerInfoByLogin(mobileNo);
}
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_MASTER)
public AclPractitionerInfo findPractitionerById(Long practitionerId) {
return aclPractitionerMapper.selectByPrimaryKey(practitionerId);
}
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_MASTER)
public void updatePractitioner(AclPractitionerInfo practitioner) {
aclPractitionerMapper.updateByPrimaryKeySelective(practitioner);
}
}
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack;
import com.yd.dal.mapper.customer.AclPractitionerPotentialAssignedTrackMapper;
import com.yd.dal.service.customer.AclPractitionerPotentialAssignedTrackDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialAssignedTrackDALService")
public class AclPractitionerPotentialAssignedTrackDALServiceImpl implements AclPractitionerPotentialAssignedTrackDALService {
@Autowired
private AclPractitionerPotentialAssignedTrackMapper aclPractitionerPotentialAssignedTrackMapper;
@Override
public void saveAll(List<AclPractitionerPotentialAssignedTrack> potentialAssignedTrackList) {
aclPractitionerPotentialAssignedTrackMapper.insertList(potentialAssignedTrackList);
}
}
......@@ -4,9 +4,10 @@ import com.yd.dal.entity.customer.AclPractitionerPotential;
import com.yd.dal.mapper.customer.AclPractitionerPotentialMapper;
import com.yd.dal.service.customer.AclPractitionerPotentialDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("aclPractitionerPotentialDALService")
public class AclPractitionerPotentialDALServiceImpl implements AclPractitionerPotentialDALService {
@Autowired
......@@ -15,4 +16,9 @@ public class AclPractitionerPotentialDALServiceImpl implements AclPractitionerPo
public List<AclPractitionerPotential> findByMobileNo(String mobileNo, Integer isActive) {
return aclPractitionerPotentialMapper.findByMobileNo(mobileNo,isActive);
}
@Override
public int save(AclPractitionerPotential practitionerPotential) {
return aclPractitionerPotentialMapper.insert(practitionerPotential);
}
}
package com.yd.dal.service.practitioner.impl;
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.practitioner.PractitionerSubordinateInfo;
import com.yd.dal.mapper.practitioner.PractitionerSubordinateMapper;
import com.yd.dal.service.practitioner.PractitionerSubordinateDALService;
import org.springframework.beans.factory.annotation.Autowired;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
import com.yd.dal.mapper.customer.AclPractitionerSubordinateSystemMapper;
import com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService;
import org.springframework.stereotype.Service;
@Service("practitionerSubordinateDALService")
public class PractitionerSubordinateDALServiceImpl implements PractitionerSubordinateDALService {
import javax.annotation.Resource;
@Autowired
private PractitionerSubordinateMapper practitionerSubordinateMapper;
@Service("aclPractitionerSubordinateSystemDALService")
public class AclPractitionerSubordinateSystemDALServiceImpl implements AclPractitionerSubordinateSystemDALService {
@Resource
private AclPractitionerSubordinateSystemMapper aclPractitionerSubordinateSystemMapper;
/**
* 根据体系ID获取体系相关信息
* @param subordinateId 体系ID
......@@ -19,7 +20,7 @@ public class PractitionerSubordinateDALServiceImpl implements PractitionerSubord
public PractitionerSubordinateInfo findSubordinateInfo(Long subordinateId) {
PractitionerSubordinateInfo subordinateInfo = null;
if(subordinateId != null){
subordinateInfo = practitionerSubordinateMapper.findSubordinateInfo(subordinateId);
subordinateInfo = aclPractitionerSubordinateSystemMapper.findSubordinateInfo(subordinateId);
}
return subordinateInfo;
}
......
package com.yd.dal.service.practitioner;
import com.yd.dal.entity.customer.AclFileUpload;
import com.yd.dal.entity.practitioner.AclPractitionerInfo;
import com.yd.dal.entity.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.practitioner.PractitionerInfo;
import com.yd.dal.entity.practitioner.PractitionerRankInfo;
import java.util.List;
public interface PractitionerDALService {
/**
* 线下--通过手机号码获取经纪人的基础信息
* @param mobileNo
* @return
*/
PractitionerBasicInfo getPractitionerBasicInfoForOffline(String mobileNo);
/**
* 线上--通过手机号码获取经纪人的基础信息
* @param mobileNo
* @return
*/
PractitionerBasicInfo getPractitionerBasicInfoForOnline(String mobileNo);
/**
* 线下--按照时间进行查询经纪人的排名统计信息
* @param time 1-month,2-year
* @return
*/
List<PractitionerRankInfo> getPractitionerRankInfoForOffline(Integer time);
/**
* 线上--按照时间进行查询经纪人的排名统计信息
* @param time 1-month,2-year
* @return
*/
List<PractitionerRankInfo> getPractitionerRankInfoForOnline(Integer time,Long practitionerTypeId);
/**
* 线上--按照时间进行查询特殊人员的排名统计信息
* @param mobileSpecials
* @return
*/
List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(List<String> mobileSpecials,Integer time);
/**
* 经纪人基本信息查询
* @param mobileNo
* @return
*/
PractitionerInfo findPractitionerInfoByLogin(String mobileNo);
/**
* 通过经纪人id查找经纪人
* @param practitionerId
* @return
*/
AclPractitionerInfo findPractitionerById(Long practitionerId);
/**
* 通过id更新practitioner
* @param practitioner
*/
void updatePractitioner(AclPractitionerInfo practitioner);
}
package com.yd.dal.service.practitioner;
import com.yd.dal.entity.practitioner.PractitionerSubordinateInfo;
import org.springframework.stereotype.Service;
@Service("practitionerSubordinateDALService")
public interface PractitionerSubordinateDALService {
PractitionerSubordinateInfo findSubordinateInfo(Long subordinateId);
}
package com.yd.dal.service.practitioner.impl;
import com.google.common.base.Strings;
import com.yd.dal.entity.practitioner.AclPractitionerInfo;
import com.yd.dal.entity.practitioner.PractitionerBasicInfo;
import com.yd.dal.entity.practitioner.PractitionerInfo;
import com.yd.dal.entity.practitioner.PractitionerRankInfo;
import com.yd.dal.mapper.practitioner.AclPractitionerMapper;
import com.yd.dal.mapper.practitioner.PractitionerMapper;
import com.yd.dal.service.customer.impl.CustomerDALServiceImpl;
import com.yd.dal.service.practitioner.PractitionerDALService;
import com.yd.util.intercept.annotation.TargetDataSource;
import com.yd.util.intercept.commons.DataSourceKey;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("practitionerServiceDAL")
public class PractitionerDALServiceImpl implements PractitionerDALService {
private static final Logger LOG = Logger.getLogger(CustomerDALServiceImpl.class);
@Resource
private PractitionerMapper practitionerMapper;
@Resource
private AclPractitionerMapper aclPractitionerMapper;
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_EGOLDEN)
public PractitionerBasicInfo getPractitionerBasicInfoForOffline(String mobileNo) {
if(!Strings.isNullOrEmpty(mobileNo)){
return practitionerMapper.getPractitionerInfoByMobileNoForOffline(mobileNo);
}else{
LOG.error("mobileNo is null!");
}
return null;
}
@Override
public PractitionerBasicInfo getPractitionerBasicInfoForOnline(String mobileNo) {
if(!Strings.isNullOrEmpty(mobileNo)){
return practitionerMapper.getPractitionerInfoByMobileNoForOnline(mobileNo);
}else{
LOG.error("mobileNo is null!");
}
return null;
}
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_EGOLDEN)
public List<PractitionerRankInfo> getPractitionerRankInfoForOffline(Integer time) {
return practitionerMapper.getPractitionerRankInfoForOffline(time);
}
@Override
public List<PractitionerRankInfo> getPractitionerRankInfoForOnline(Integer time,Long practitionerTypeId) {
return practitionerMapper.getPractitionerRankInfoForOnline(time,practitionerTypeId);
}
@Override
public List<PractitionerRankInfo> getPractitionerRankInfoForSpecials(List<String> mobileSpecials,Integer time) {
return practitionerMapper.getPractitionerRankInfoForSpecials(mobileSpecials,time);
}
@Override
public PractitionerInfo findPractitionerInfoByLogin(String mobileNo) {
return practitionerMapper.findPractitionerInfoByLogin(mobileNo);
}
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_MASTER)
public AclPractitionerInfo findPractitionerById(Long practitionerId) {
return aclPractitionerMapper.selectByPrimaryKey(practitionerId);
}
@Override
@TargetDataSource(dataSourceKey = DataSourceKey.DB_MASTER)
public void updatePractitioner(AclPractitionerInfo practitioner) {
aclPractitionerMapper.updateByPrimaryKeySelective(practitioner);
}
}
......@@ -21,6 +21,7 @@
830007=上传头像失败,请重新上传!
830008=上传生活照失败,请重新上传!
830009=上传微信二维码失败,请重新上传!
830010=该用户已经注册为银盾经纪人!
830010=该用户已经注册为银盾经纪人
830011=该增员已存在!
900003=保险公司响应报文为空!
\ No newline at end of file
......@@ -487,4 +487,195 @@
gender = #{gender,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<resultMap id="base_result_map_practitioner_info" type="com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo">
<result column="customerId" property="customerId"/>
<result column="practitionerIdForOnline" property="practitionerIdForOnline"/>
<result column="practitionerId" property="practitionerId"/>
<result column="name" property="name"/>
<result column="titleCode" property="titleCode" />
<!-- <result column="mobile_no" property="titleCode" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>-->
<result column="titleName" property="titleName"/>
<result column="gender" property="gender"/>
</resultMap>
<select id="getPractitionerInfoByMobileNoForOffline" resultMap="base_result_map_practitioner_info">
SELECT
p.SAL_MST_ID as practitionerId,
p.SAL_MST_NAME as name,
p.SAL_MST_GENDER as gender,
md.DRP_TITLE_LEVEL as titleCode,
md.DRP_TITLE_NAME as titleName
FROM sal001 p left join DRP003 md on md.DRP_TITLE_CODE = p.FK_DRP_TITLE_CODE
where p.SAL_MST_MOBILE = #{mobileNo}
</select>
<select id="getPractitionerInfoByMobileNoForOnline" resultMap="base_result_map_practitioner_info">
select
p.customer_id as customerId,
p.id as practitionerIdForOnline,
p.name as name,
o.drop_option_code as titleCode,
o.drop_option_name as titleName,
p.gender as gender
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo};
</select>
<resultMap id="practitioner_rank_map" type="com.yd.dal.entity.customer.practitioner.PractitionerRankInfo">
<result column="customerId" property="customerId"/>
<result column="practitionerIdForOnLine" property="practitionerIdForOnLine"/>
<result column="practitionerId" property="practitionerId"/>
<result column="name" property="name"/>
<result column="titleCode" property="titleCode" />
<result column="titleName" property="titleName"/>
<result column="count" property="count"/>
<result column="fyp" property="fyp"/>
<result column="fyc" property="fyc"/>
</resultMap>
<select id="getPractitionerRankInfoForOffline" resultMap="practitioner_rank_map" resultType="java.lang.Integer">
SELECT
p.SAL_MST_ID as practitionerId ,
p.SAL_MST_NAME as name ,-- 姓名
md.DRP_TITLE_LEVEL as titleCode,-- 职称code
md.DRP_TITLE_NAME as titleName,-- 职称名称
spc.SPC_DIV_NAME as spcDivName,-- 体系id
count(m.MON025_002) as count,-- 保单id
sum(m.MON025_401) as fyp,-- 保费
sum(m.MON025_405) as fyc -- 应发佣金
FROM MON025 m INNER JOIN sal001 p on m.MON025_007 = p.SAL_MST_ID -- 业务员id
left join DRP003 md on p.FK_DRP_TITLE_CODE = md.DRP_TITLE_CODE
inner JOIN ins001 policy on m.MON025_002 = policy.INS_MST_ID -- 保单id
inner join spc004 spc on m.MON025_006 = spc.SPC_DIV_ID -- 体系
WHERE m.MON025_109 IN (1,2,3) AND m.MON025_303 = 1
<choose>
<when test="time == 1">
and DATE_FORMAT(policy.INS_MST_ACCEPT_DATE, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when test="time == 3">
and QUARTER(policy.INS_MST_ACCEPT_DATE) = QUARTER(NOW()) AND year(policy.INS_MST_ACCEPT_DATE)=year(now())
</when>
<otherwise>
and YEAR(policy.INS_MST_ACCEPT_DATE) = YEAR(now())
</otherwise>
</choose>
group by p.SAL_MST_ID;
</select>
<select id="getPractitionerRankInfoForOnline" resultMap="practitioner_rank_map">
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
count(f.id) as count,-- 保单id
sum(f.order_price) as fyp,-- 保费
sum(f.referral_amount) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and o.order_price > 0
<if test="practitionerTypeId != null">
and s.practitioner_type_id = #{practitionerTypeId}
</if>
<choose>
<when test="time == 1">
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when test="time == 3">
and QUARTER(f.order_date) = QUARTER(NOW()) AND year(f.order_date)=year(now())
</when>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
group by p.id;
</select>
<select id="getPractitionerRankInfoForSpecials" resultMap="practitioner_rank_map" resultType="java.util.List">
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
count(f.id) as count,-- 保单id
sum(f.order_price) as fyp,-- 保费
sum(f.referral_amount) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_customer c on p.customer_id = c.id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and o.order_price > 0
and c.login in
<foreach collection="mobileSpecials" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<choose>
<when test="time == 1">
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when test="time == 3">
and QUARTER(f.order_date) = QUARTER(NOW()) AND year(f.order_date)=year(now())
</when>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
group by p.id;
</select>
<resultMap id="practitioner_info_map" type="com.yd.dal.entity.customer.practitioner.PractitionerInfo">
<result column="customerId" property="customerId"/>
<result column="practitionerId" property="practitionerId"/>
<result column="name" property="name"/>
<result column="gender" property="gender"/>
<result column="practitionerType" property="practitionerType" />
<result column="levelCode" property="levelCode" />
<result column="levelName" property="levelName"/>
<result column="insurerBranchName" property="insurerBranchName"/>
<result column="subordinateId" property="subordinateId"/>
<result column="weChatId" property="weChatId"/>
<result column="qqId" property="qqId"/>
<result column="practitionerRegNo" property="practitionerRegNo"/>
</resultMap>
<select id="findPractitionerInfoByLogin" resultMap="practitioner_info_map">
select
p.customer_id as customerId,
p.id as practitionerId,
p.name as name,
p.gender as gender,
s.practitioner_type_id as practitionerType,
o.drop_option_code as levelCode,
o.drop_option_name as levelName,
b.branch_name as insurerBranchName,
p.subordinate_system_id as subordinateId,
p.wechat_id as weChatId,
p.qq_id as qqId,
p.practitioner_reg_no as practitionerRegNo
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo};
</select>
<select id="findByCustomerIdIsActive" resultType="com.yd.dal.entity.customer.AclPractitioner">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner
where customer_id = #{customerId,jdbcType=BIGINT}
and is_active = #{isActive,jdbcType=INTEGER}
</select>
</mapper>
\ No newline at end of file
......@@ -14,10 +14,11 @@
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
<result column="updator_type" jdbcType="INTEGER" property="updatorType" />
<result column="creator_type" jdbcType="INTEGER" property="creatorType" />
<result column="is_lasted" jdbcType="INTEGER" property="isLasted" />
</resultMap>
<sql id="Base_Column_List">
id, practitioner_potential_id, practitioner_assigned_id, track_status_id, notice,
is_active, created_at, created_by, updated_at, updated_by, creator_type, updator_type
is_active, created_at, created_by, updated_at, updated_by, creator_type, updator_type,is_lasted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
......@@ -33,11 +34,11 @@
insert into ag_acl_practitioner_potential_assigned_track (practitioner_potential_id, practitioner_assigned_id,
track_status_id, notice, is_active,
created_at, created_by, updated_at,
updated_by, updator_type,creator_type )
updated_by, updator_type,creator_type,is_lasted )
values (#{practitionerPotentialId,jdbcType=BIGINT}, #{practitionerAssignedId,jdbcType=BIGINT},
#{trackStatusId,jdbcType=BIGINT}, #{notice,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT},#{updatorType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER})
#{updatedBy,jdbcType=BIGINT},#{updatorType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{isLasted,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack" useGeneratedKeys="true">
insert into ag_acl_practitioner_potential_assigned_track
......@@ -100,6 +101,29 @@
</if>
</trim>
</insert>
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" >
insert into ag_acl_practitioner_potential_assigned_track(practitioner_potential_id, practitioner_assigned_id,
track_status_id, notice, is_active,
created_at, created_by, updated_at,
updated_by, updator_type,creator_type,is_lasted )
values
<foreach collection="potentialAssignedTrackList" item="item" index="index" separator=",">
(
#{item.practitionerPotentialId},
#{item.practitionerAssignedId},
#{item.trackStatusId},
#{item.notice},
#{item.isActive},
#{item.createdAt},
#{item.createdBy},
#{item.updatedAt},
#{item.updatedBy},
#{item.updatorType},
#{item.creatorType},
#{item.isLasted}
)
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack">
update ag_acl_practitioner_potential_assigned_track
<set>
......
<?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.yd.dal.mapper.customer.AclPractitionerSubordinateSystemMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclPractitionerSubordinateSystem">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="insurer_id" jdbcType="BIGINT" property="insurerId" />
<result column="insurer_branch_id" jdbcType="BIGINT" property="insurerBranchId" />
<result column="dept_id" jdbcType="BIGINT" property="deptId" />
<result column="subordinate_system_code" jdbcType="VARCHAR" property="subordinateSystemCode" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="name_en" jdbcType="VARCHAR" property="nameEn" />
<result column="owner_practitioner_id" jdbcType="BIGINT" property="ownerPractitionerId" />
<result column="contact_name" jdbcType="VARCHAR" property="contactName" />
<result column="contact_no" jdbcType="VARCHAR" property="contactNo" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<sql id="Base_Column_List">
id, insurer_id, insurer_branch_id, dept_id, subordinate_system_code, `name`, name_en,
owner_practitioner_id, contact_name, contact_no, remark, is_active, created_at, created_by,
updated_at, updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_subordinate_system
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_subordinate_system
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerSubordinateSystem" useGeneratedKeys="true">
insert into ag_acl_practitioner_subordinate_system (insurer_id, insurer_branch_id, dept_id,
subordinate_system_code, `name`, name_en,
owner_practitioner_id, contact_name, contact_no,
remark, is_active, created_at,
created_by, updated_at, updated_by
)
values (#{insurerId,jdbcType=BIGINT}, #{insurerBranchId,jdbcType=BIGINT}, #{deptId,jdbcType=BIGINT},
#{subordinateSystemCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{nameEn,jdbcType=VARCHAR},
#{ownerPractitionerId,jdbcType=BIGINT}, #{contactName,jdbcType=VARCHAR}, #{contactNo,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclPractitionerSubordinateSystem" useGeneratedKeys="true">
insert into ag_acl_practitioner_subordinate_system
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="insurerId != null">
insurer_id,
</if>
<if test="insurerBranchId != null">
insurer_branch_id,
</if>
<if test="deptId != null">
dept_id,
</if>
<if test="subordinateSystemCode != null">
subordinate_system_code,
</if>
<if test="name != null">
`name`,
</if>
<if test="nameEn != null">
name_en,
</if>
<if test="ownerPractitionerId != null">
owner_practitioner_id,
</if>
<if test="contactName != null">
contact_name,
</if>
<if test="contactNo != null">
contact_no,
</if>
<if test="remark != null">
remark,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="insurerId != null">
#{insurerId,jdbcType=BIGINT},
</if>
<if test="insurerBranchId != null">
#{insurerBranchId,jdbcType=BIGINT},
</if>
<if test="deptId != null">
#{deptId,jdbcType=BIGINT},
</if>
<if test="subordinateSystemCode != null">
#{subordinateSystemCode,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="nameEn != null">
#{nameEn,jdbcType=VARCHAR},
</if>
<if test="ownerPractitionerId != null">
#{ownerPractitionerId,jdbcType=BIGINT},
</if>
<if test="contactName != null">
#{contactName,jdbcType=VARCHAR},
</if>
<if test="contactNo != null">
#{contactNo,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="isActive != null">
#{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclPractitionerSubordinateSystem">
update ag_acl_practitioner_subordinate_system
<set>
<if test="insurerId != null">
insurer_id = #{insurerId,jdbcType=BIGINT},
</if>
<if test="insurerBranchId != null">
insurer_branch_id = #{insurerBranchId,jdbcType=BIGINT},
</if>
<if test="deptId != null">
dept_id = #{deptId,jdbcType=BIGINT},
</if>
<if test="subordinateSystemCode != null">
subordinate_system_code = #{subordinateSystemCode,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="nameEn != null">
name_en = #{nameEn,jdbcType=VARCHAR},
</if>
<if test="ownerPractitionerId != null">
owner_practitioner_id = #{ownerPractitionerId,jdbcType=BIGINT},
</if>
<if test="contactName != null">
contact_name = #{contactName,jdbcType=VARCHAR},
</if>
<if test="contactNo != null">
contact_no = #{contactNo,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclPractitionerSubordinateSystem">
update ag_acl_practitioner_subordinate_system
set insurer_id = #{insurerId,jdbcType=BIGINT},
insurer_branch_id = #{insurerBranchId,jdbcType=BIGINT},
dept_id = #{deptId,jdbcType=BIGINT},
subordinate_system_code = #{subordinateSystemCode,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
name_en = #{nameEn,jdbcType=VARCHAR},
owner_practitioner_id = #{ownerPractitionerId,jdbcType=BIGINT},
contact_name = #{contactName,jdbcType=VARCHAR},
contact_no = #{contactNo,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<resultMap id="practitioner_subordinate_map" type="com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo">
<result column="subordinateId" property="subordinateId"/>
<result column="subordinateName" property="subordinateName"/>
<result column="subordinateCode" property="subordinateCode"/>
<result column="ownerId" property="ownerId"/>
<result column="subordinateLeader" property="subordinateLeader"/>
<result column="contactName" property="contactName"/>
<result column="contactNo" property="contactNo"/>
<result column="remark" property="remark"/>
</resultMap>
<select id="findSubordinateInfo" resultMap="practitioner_subordinate_map">
SELECT
s.id as subordinateId,
s.name as subordinateName,
s.subordinate_system_code as subordinateCode,
s.owner_practitioner_id as ownerId,
p.name as subordinateLeader,
s.contact_name as contactName,
s.contact_no as contactNo,
s.remark as remark
FROM ag_acl_practitioner_subordinate_system s left join ag_acl_practitioner p on s.owner_practitioner_id = p.id
where s.is_active = 1
and s.id = #{subordinateId}
</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="com.yd.dal.mapper.practitioner.AclPractitionerMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.practitioner.AclPractitionerInfo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="insurer_id" jdbcType="BIGINT" property="insurerId" />
<result column="insurer_branch_id" jdbcType="BIGINT" property="insurerBranchId" />
<result column="dept_id" jdbcType="BIGINT" property="deptId" />
<result column="subordinate_system_id" jdbcType="BIGINT" property="subordinateSystemId" />
<result column="practitioner_code" jdbcType="VARCHAR" property="practitionerCode" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="mobile_no" jdbcType="VARCHAR" property="mobileNo" />
<result column="id_type_id" jdbcType="BIGINT" property="idTypeId" />
<result column="id_type" jdbcType="VARCHAR" property="idType" />
<result column="id_no" jdbcType="VARCHAR" property="idNo" />
<result column="practitioner_birthdate" jdbcType="DATE" property="practitionerBirthdate" />
<result column="practitioner_reg_no" jdbcType="VARCHAR" property="practitionerRegNo" />
<result column="practitioner_reg_company" jdbcType="VARCHAR" property="practitionerRegCompany" />
<result column="effective_start_date" jdbcType="DATE" property="effectiveStartDate" />
<result column="effective_end_date" jdbcType="DATE" property="effectiveEndDate" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="customer_id" jdbcType="BIGINT" property="customerId" />
<result column="employee_no" jdbcType="VARCHAR" property="employeeNo" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
<result column="province_id" jdbcType="BIGINT" property="provinceId" />
<result column="province_name" jdbcType="VARCHAR" property="provinceName" />
<result column="city_id" jdbcType="BIGINT" property="cityId" />
<result column="city_name" jdbcType="VARCHAR" property="cityName" />
<result column="cert_list" jdbcType="VARCHAR" property="certList" />
<result column="bio_intro" jdbcType="VARCHAR" property="bioIntro" />
<result column="wechat_id" jdbcType="VARCHAR" property="wechatId" />
<result column="qq_id" jdbcType="VARCHAR" property="qqId" />
<result column="is_profile_show" jdbcType="INTEGER" property="isProfileShow" />
<result column="is_name_show" jdbcType="INTEGER" property="isNameShow" />
<result column="is_mobile_show" jdbcType="INTEGER" property="isMobileShow" />
<result column="education_level" jdbcType="VARCHAR" property="educationLevel" />
<result column="mentor_id" jdbcType="BIGINT" property="mentorId" />
<result column="introducer_id" jdbcType="BIGINT" property="introducerId" />
<result column="gender" jdbcType="INTEGER" property="gender" />
</resultMap>
<sql id="Base_Column_List">
id, insurer_id, insurer_branch_id, dept_id, subordinate_system_id, practitioner_code,
`name`, mobile_no, id_type_id, id_type, id_no, practitioner_birthdate, practitioner_reg_no,
practitioner_reg_company, effective_start_date, effective_end_date, remark, customer_id,
employee_no, is_active, created_at, created_by, updated_at, updated_by, province_id,
province_name, city_id, city_name, cert_list, bio_intro, wechat_id, qq_id, is_profile_show,
is_name_show, is_mobile_show, education_level, mentor_id, introducer_id, gender
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.practitioner.AclPractitionerInfo" useGeneratedKeys="true">
insert into ag_acl_practitioner (insurer_id, insurer_branch_id, dept_id,
subordinate_system_id, practitioner_code, `name`,
mobile_no, id_type_id, id_type,
id_no, practitioner_birthdate, practitioner_reg_no,
practitioner_reg_company, effective_start_date,
effective_end_date, remark, customer_id,
employee_no, is_active, created_at,
created_by, updated_at, updated_by,
province_id, province_name, city_id,
city_name, cert_list, bio_intro,
wechat_id, qq_id, is_profile_show,
is_name_show, is_mobile_show, education_level,
mentor_id, introducer_id, gender
)
values (#{insurerId,jdbcType=BIGINT}, #{insurerBranchId,jdbcType=BIGINT}, #{deptId,jdbcType=BIGINT},
#{subordinateSystemId,jdbcType=BIGINT}, #{practitionerCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{mobileNo,jdbcType=VARCHAR}, #{idTypeId,jdbcType=BIGINT}, #{idType,jdbcType=VARCHAR},
#{idNo,jdbcType=VARCHAR}, #{practitionerBirthdate,jdbcType=DATE}, #{practitionerRegNo,jdbcType=VARCHAR},
#{practitionerRegCompany,jdbcType=VARCHAR}, #{effectiveStartDate,jdbcType=DATE},
#{effectiveEndDate,jdbcType=DATE}, #{remark,jdbcType=VARCHAR}, #{customerId,jdbcType=BIGINT},
#{employeeNo,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT},
#{provinceId,jdbcType=BIGINT}, #{provinceName,jdbcType=VARCHAR}, #{cityId,jdbcType=BIGINT},
#{cityName,jdbcType=VARCHAR}, #{certList,jdbcType=VARCHAR}, #{bioIntro,jdbcType=VARCHAR},
#{wechatId,jdbcType=VARCHAR}, #{qqId,jdbcType=VARCHAR}, #{isProfileShow,jdbcType=INTEGER},
#{isNameShow,jdbcType=INTEGER}, #{isMobileShow,jdbcType=INTEGER}, #{educationLevel,jdbcType=VARCHAR},
#{mentorId,jdbcType=BIGINT}, #{introducerId,jdbcType=BIGINT}, #{gender,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.practitioner.AclPractitionerInfo" useGeneratedKeys="true">
insert into ag_acl_practitioner
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="insurerId != null">
insurer_id,
</if>
<if test="insurerBranchId != null">
insurer_branch_id,
</if>
<if test="deptId != null">
dept_id,
</if>
<if test="subordinateSystemId != null">
subordinate_system_id,
</if>
<if test="practitionerCode != null">
practitioner_code,
</if>
<if test="name != null">
`name`,
</if>
<if test="mobileNo != null">
mobile_no,
</if>
<if test="idTypeId != null">
id_type_id,
</if>
<if test="idType != null">
id_type,
</if>
<if test="idNo != null">
id_no,
</if>
<if test="practitionerBirthdate != null">
practitioner_birthdate,
</if>
<if test="practitionerRegNo != null">
practitioner_reg_no,
</if>
<if test="practitionerRegCompany != null">
practitioner_reg_company,
</if>
<if test="effectiveStartDate != null">
effective_start_date,
</if>
<if test="effectiveEndDate != null">
effective_end_date,
</if>
<if test="remark != null">
remark,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="employeeNo != null">
employee_no,
</if>
<if test="isActive != null">
is_active,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="updatedBy != null">
updated_by,
</if>
<if test="provinceId != null">
province_id,
</if>
<if test="provinceName != null">
province_name,
</if>
<if test="cityId != null">
city_id,
</if>
<if test="cityName != null">
city_name,
</if>
<if test="certList != null">
cert_list,
</if>
<if test="bioIntro != null">
bio_intro,
</if>
<if test="wechatId != null">
wechat_id,
</if>
<if test="qqId != null">
qq_id,
</if>
<if test="isProfileShow != null">
is_profile_show,
</if>
<if test="isNameShow != null">
is_name_show,
</if>
<if test="isMobileShow != null">
is_mobile_show,
</if>
<if test="educationLevel != null">
education_level,
</if>
<if test="mentorId != null">
mentor_id,
</if>
<if test="introducerId != null">
introducer_id,
</if>
<if test="gender != null">
gender,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="insurerId != null">
#{insurerId,jdbcType=BIGINT},
</if>
<if test="insurerBranchId != null">
#{insurerBranchId,jdbcType=BIGINT},
</if>
<if test="deptId != null">
#{deptId,jdbcType=BIGINT},
</if>
<if test="subordinateSystemId != null">
#{subordinateSystemId,jdbcType=BIGINT},
</if>
<if test="practitionerCode != null">
#{practitionerCode,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="mobileNo != null">
#{mobileNo,jdbcType=VARCHAR},
</if>
<if test="idTypeId != null">
#{idTypeId,jdbcType=BIGINT},
</if>
<if test="idType != null">
#{idType,jdbcType=VARCHAR},
</if>
<if test="idNo != null">
#{idNo,jdbcType=VARCHAR},
</if>
<if test="practitionerBirthdate != null">
#{practitionerBirthdate,jdbcType=DATE},
</if>
<if test="practitionerRegNo != null">
#{practitionerRegNo,jdbcType=VARCHAR},
</if>
<if test="practitionerRegCompany != null">
#{practitionerRegCompany,jdbcType=VARCHAR},
</if>
<if test="effectiveStartDate != null">
#{effectiveStartDate,jdbcType=DATE},
</if>
<if test="effectiveEndDate != null">
#{effectiveEndDate,jdbcType=DATE},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
#{customerId,jdbcType=BIGINT},
</if>
<if test="employeeNo != null">
#{employeeNo,jdbcType=VARCHAR},
</if>
<if test="isActive != null">
#{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=BIGINT},
</if>
<if test="provinceId != null">
#{provinceId,jdbcType=BIGINT},
</if>
<if test="provinceName != null">
#{provinceName,jdbcType=VARCHAR},
</if>
<if test="cityId != null">
#{cityId,jdbcType=BIGINT},
</if>
<if test="cityName != null">
#{cityName,jdbcType=VARCHAR},
</if>
<if test="certList != null">
#{certList,jdbcType=VARCHAR},
</if>
<if test="bioIntro != null">
#{bioIntro,jdbcType=VARCHAR},
</if>
<if test="wechatId != null">
#{wechatId,jdbcType=VARCHAR},
</if>
<if test="qqId != null">
#{qqId,jdbcType=VARCHAR},
</if>
<if test="isProfileShow != null">
#{isProfileShow,jdbcType=INTEGER},
</if>
<if test="isNameShow != null">
#{isNameShow,jdbcType=INTEGER},
</if>
<if test="isMobileShow != null">
#{isMobileShow,jdbcType=INTEGER},
</if>
<if test="educationLevel != null">
#{educationLevel,jdbcType=VARCHAR},
</if>
<if test="mentorId != null">
#{mentorId,jdbcType=BIGINT},
</if>
<if test="introducerId != null">
#{introducerId,jdbcType=BIGINT},
</if>
<if test="gender != null">
#{gender,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.practitioner.AclPractitionerInfo">
update ag_acl_practitioner
<set>
<if test="insurerId != null">
insurer_id = #{insurerId,jdbcType=BIGINT},
</if>
<if test="insurerBranchId != null">
insurer_branch_id = #{insurerBranchId,jdbcType=BIGINT},
</if>
<if test="deptId != null">
dept_id = #{deptId,jdbcType=BIGINT},
</if>
<if test="subordinateSystemId != null">
subordinate_system_id = #{subordinateSystemId,jdbcType=BIGINT},
</if>
<if test="practitionerCode != null">
practitioner_code = #{practitionerCode,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="mobileNo != null">
mobile_no = #{mobileNo,jdbcType=VARCHAR},
</if>
<if test="idTypeId != null">
id_type_id = #{idTypeId,jdbcType=BIGINT},
</if>
<if test="idType != null">
id_type = #{idType,jdbcType=VARCHAR},
</if>
<if test="idNo != null">
id_no = #{idNo,jdbcType=VARCHAR},
</if>
<if test="practitionerBirthdate != null">
practitioner_birthdate = #{practitionerBirthdate,jdbcType=DATE},
</if>
<if test="practitionerRegNo != null">
practitioner_reg_no = #{practitionerRegNo,jdbcType=VARCHAR},
</if>
<if test="practitionerRegCompany != null">
practitioner_reg_company = #{practitionerRegCompany,jdbcType=VARCHAR},
</if>
<if test="effectiveStartDate != null">
effective_start_date = #{effectiveStartDate,jdbcType=DATE},
</if>
<if test="effectiveEndDate != null">
effective_end_date = #{effectiveEndDate,jdbcType=DATE},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=BIGINT},
</if>
<if test="employeeNo != null">
employee_no = #{employeeNo,jdbcType=VARCHAR},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
<if test="provinceId != null">
province_id = #{provinceId,jdbcType=BIGINT},
</if>
<if test="provinceName != null">
province_name = #{provinceName,jdbcType=VARCHAR},
</if>
<if test="cityId != null">
city_id = #{cityId,jdbcType=BIGINT},
</if>
<if test="cityName != null">
city_name = #{cityName,jdbcType=VARCHAR},
</if>
<if test="certList != null">
cert_list = #{certList,jdbcType=VARCHAR},
</if>
<if test="bioIntro != null">
bio_intro = #{bioIntro,jdbcType=VARCHAR},
</if>
<if test="wechatId != null">
wechat_id = #{wechatId,jdbcType=VARCHAR},
</if>
<if test="qqId != null">
qq_id = #{qqId,jdbcType=VARCHAR},
</if>
<if test="isProfileShow != null">
is_profile_show = #{isProfileShow,jdbcType=INTEGER},
</if>
<if test="isNameShow != null">
is_name_show = #{isNameShow,jdbcType=INTEGER},
</if>
<if test="isMobileShow != null">
is_mobile_show = #{isMobileShow,jdbcType=INTEGER},
</if>
<if test="educationLevel != null">
education_level = #{educationLevel,jdbcType=VARCHAR},
</if>
<if test="mentorId != null">
mentor_id = #{mentorId,jdbcType=BIGINT},
</if>
<if test="introducerId != null">
introducer_id = #{introducerId,jdbcType=BIGINT},
</if>
<if test="gender != null">
gender = #{gender,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.practitioner.AclPractitionerInfo">
update ag_acl_practitioner
set insurer_id = #{insurerId,jdbcType=BIGINT},
insurer_branch_id = #{insurerBranchId,jdbcType=BIGINT},
dept_id = #{deptId,jdbcType=BIGINT},
subordinate_system_id = #{subordinateSystemId,jdbcType=BIGINT},
practitioner_code = #{practitionerCode,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
mobile_no = #{mobileNo,jdbcType=VARCHAR},
id_type_id = #{idTypeId,jdbcType=BIGINT},
id_type = #{idType,jdbcType=VARCHAR},
id_no = #{idNo,jdbcType=VARCHAR},
practitioner_birthdate = #{practitionerBirthdate,jdbcType=DATE},
practitioner_reg_no = #{practitionerRegNo,jdbcType=VARCHAR},
practitioner_reg_company = #{practitionerRegCompany,jdbcType=VARCHAR},
effective_start_date = #{effectiveStartDate,jdbcType=DATE},
effective_end_date = #{effectiveEndDate,jdbcType=DATE},
remark = #{remark,jdbcType=VARCHAR},
customer_id = #{customerId,jdbcType=BIGINT},
employee_no = #{employeeNo,jdbcType=VARCHAR},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT},
province_id = #{provinceId,jdbcType=BIGINT},
province_name = #{provinceName,jdbcType=VARCHAR},
city_id = #{cityId,jdbcType=BIGINT},
city_name = #{cityName,jdbcType=VARCHAR},
cert_list = #{certList,jdbcType=VARCHAR},
bio_intro = #{bioIntro,jdbcType=VARCHAR},
wechat_id = #{wechatId,jdbcType=VARCHAR},
qq_id = #{qqId,jdbcType=VARCHAR},
is_profile_show = #{isProfileShow,jdbcType=INTEGER},
is_name_show = #{isNameShow,jdbcType=INTEGER},
is_mobile_show = #{isMobileShow,jdbcType=INTEGER},
education_level = #{educationLevel,jdbcType=VARCHAR},
mentor_id = #{mentorId,jdbcType=BIGINT},
introducer_id = #{introducerId,jdbcType=BIGINT},
gender = #{gender,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="findByCustomerIdIsActive" resultType="com.yd.dal.entity.customer.AclPractitioner">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner
where customer_id = #{customerId,jdbcType=BIGINT}
and is_active = #{isActive,jdbcType=INTEGER}
</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="com.yd.dal.mapper.practitioner.PractitionerMapper">
<resultMap id="base_result_map_practitioner_info" type="com.yd.dal.entity.practitioner.PractitionerBasicInfo">
<result column="customerId" property="customerId"/>
<result column="practitionerIdForOnline" property="practitionerIdForOnline"/>
<result column="practitionerId" property="practitionerId"/>
<result column="name" property="name"/>
<result column="titleCode" property="titleCode" />
<!-- <result column="mobile_no" property="titleCode" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>-->
<result column="titleName" property="titleName"/>
<result column="gender" property="gender"/>
</resultMap>
<select id="getPractitionerInfoByMobileNoForOffline" resultMap="base_result_map_practitioner_info">
SELECT
p.SAL_MST_ID as practitionerId,
p.SAL_MST_NAME as name,
p.SAL_MST_GENDER as gender,
md.DRP_TITLE_LEVEL as titleCode,
md.DRP_TITLE_NAME as titleName
FROM sal001 p left join DRP003 md on md.DRP_TITLE_CODE = p.FK_DRP_TITLE_CODE
where p.SAL_MST_MOBILE = #{mobileNo}
</select>
<select id="getPractitionerInfoByMobileNoForOnline" resultMap="base_result_map_practitioner_info">
select
p.customer_id as customerId,
p.id as practitionerIdForOnline,
p.name as name,
o.drop_option_code as titleCode,
o.drop_option_name as titleName,
p.gender as gender
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo};
</select>
<resultMap id="practitioner_rank_map" type="com.yd.dal.entity.practitioner.PractitionerRankInfo">
<result column="customerId" property="customerId"/>
<result column="practitionerIdForOnLine" property="practitionerIdForOnLine"/>
<result column="practitionerId" property="practitionerId"/>
<result column="name" property="name"/>
<result column="titleCode" property="titleCode" />
<result column="titleName" property="titleName"/>
<result column="count" property="count"/>
<result column="fyp" property="fyp"/>
<result column="fyc" property="fyc"/>
</resultMap>
<select id="getPractitionerRankInfoForOffline" resultMap="practitioner_rank_map" resultType="java.lang.Integer">
SELECT
p.SAL_MST_ID as practitionerId ,
p.SAL_MST_NAME as name ,-- 姓名
md.DRP_TITLE_LEVEL as titleCode,-- 职称code
md.DRP_TITLE_NAME as titleName,-- 职称名称
spc.SPC_DIV_NAME as spcDivName,-- 体系id
count(m.MON025_002) as count,-- 保单id
sum(m.MON025_401) as fyp,-- 保费
sum(m.MON025_405) as fyc -- 应发佣金
FROM MON025 m INNER JOIN sal001 p on m.MON025_007 = p.SAL_MST_ID -- 业务员id
left join DRP003 md on p.FK_DRP_TITLE_CODE = md.DRP_TITLE_CODE
inner JOIN ins001 policy on m.MON025_002 = policy.INS_MST_ID -- 保单id
inner join spc004 spc on m.MON025_006 = spc.SPC_DIV_ID -- 体系
WHERE m.MON025_109 IN (1,2,3) AND m.MON025_303 = 1
<choose>
<when test="time == 1">
and DATE_FORMAT(policy.INS_MST_ACCEPT_DATE, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when test="time == 3">
and QUARTER(policy.INS_MST_ACCEPT_DATE) = QUARTER(NOW()) AND year(policy.INS_MST_ACCEPT_DATE)=year(now())
</when>
<otherwise>
and YEAR(policy.INS_MST_ACCEPT_DATE) = YEAR(now())
</otherwise>
</choose>
group by p.SAL_MST_ID;
</select>
<select id="getPractitionerRankInfoForOnline" resultMap="practitioner_rank_map">
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
count(f.id) as count,-- 保单id
sum(f.order_price) as fyp,-- 保费
sum(f.referral_amount) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and o.order_price > 0
<if test="practitionerTypeId != null">
and s.practitioner_type_id = #{practitionerTypeId}
</if>
<choose>
<when test="time == 1">
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when test="time == 3">
and QUARTER(f.order_date) = QUARTER(NOW()) AND year(f.order_date)=year(now())
</when>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
group by p.id;
</select>
<select id="getPractitionerRankInfoForSpecials" resultMap="practitioner_rank_map" resultType="java.util.List">
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
count(f.id) as count,-- 保单id
sum(f.order_price) as fyp,-- 保费
sum(f.referral_amount) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_customer c on p.customer_id = c.id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and o.order_price > 0
and c.login in
<foreach collection="mobileSpecials" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<choose>
<when test="time == 1">
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when test="time == 3">
and QUARTER(f.order_date) = QUARTER(NOW()) AND year(f.order_date)=year(now())
</when>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
group by p.id;
</select>
<resultMap id="practitioner_info_map" type="com.yd.dal.entity.practitioner.PractitionerInfo">
<result column="customerId" property="customerId"/>
<result column="practitionerId" property="practitionerId"/>
<result column="name" property="name"/>
<result column="gender" property="gender"/>
<result column="practitionerType" property="practitionerType" />
<result column="levelCode" property="levelCode" />
<result column="levelName" property="levelName"/>
<result column="insurerBranchName" property="insurerBranchName"/>
<result column="subordinateId" property="subordinateId"/>
<result column="weChatId" property="weChatId"/>
<result column="qqId" property="qqId"/>
<result column="practitionerRegNo" property="practitionerRegNo"/>
</resultMap>
<select id="findPractitionerInfoByLogin" resultMap="practitioner_info_map">
select
p.customer_id as customerId,
p.id as practitionerId,
p.name as name,
p.gender as gender,
s.practitioner_type_id as practitionerType,
o.drop_option_code as levelCode,
o.drop_option_name as levelName,
b.branch_name as insurerBranchName,
p.subordinate_system_id as subordinateId,
p.wechat_id as weChatId,
p.qq_id as qqId,
p.practitioner_reg_no as practitionerRegNo
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo};
</select>
</mapper>
<?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.yd.dal.mapper.practitioner.PractitionerSubordinateMapper">
<resultMap id="practitioner_subordinate_map" type="com.yd.dal.entity.practitioner.PractitionerSubordinateInfo">
<result column="subordinateId" property="subordinateId"/>
<result column="subordinateName" property="subordinateName"/>
<result column="subordinateCode" property="subordinateCode"/>
<result column="ownerId" property="ownerId"/>
<result column="subordinateLeader" property="subordinateLeader"/>
<result column="contactName" property="contactName"/>
<result column="contactNo" property="contactNo"/>
<result column="remark" property="remark"/>
</resultMap>
<select id="findSubordinateInfo" resultMap="practitioner_subordinate_map">
SELECT
s.id as subordinateId,
s.name as subordinateName,
s.subordinate_system_code as subordinateCode,
s.owner_practitioner_id as ownerId,
p.name as subordinateLeader,
s.contact_name as contactName,
s.contact_no as contactNo,
s.remark as remark
FROM ag_acl_practitioner_subordinate_system s left join ag_acl_practitioner p on s.owner_practitioner_id = p.id
where s.is_active = 1
and s.id = #{subordinateId}
</select>
</mapper>
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