Commit 024049dc by yao.xiao

Merge branch 'dev_20210413_xxy_article' into dev

parents 0d5a0caf 440e7299
...@@ -44,10 +44,15 @@ public class AgmsPractitionerServiceImpl implements AgmsPractitionerService { ...@@ -44,10 +44,15 @@ public class AgmsPractitionerServiceImpl implements AgmsPractitionerService {
if (!CommonUtil.isNullOrBlank(requestVO.getMdDropOptionId())){ if (!CommonUtil.isNullOrBlank(requestVO.getMdDropOptionId())){
mdDropOptionIds=(Long[]) ConvertUtils.convert(requestVO.getMdDropOptionId().split(","),Long.class); mdDropOptionIds=(Long[]) ConvertUtils.convert(requestVO.getMdDropOptionId().split(","),Long.class);
} }
PageInfo<PractitionerFileSharing> practitionerFileShares = agmsPractitionerDALService.practitionerFileSharingList(mdDropOptionIds, PageInfo<PractitionerFileSharing> practitionerFileShares = agmsPractitionerDALService.practitionerFileSharingList(requestVO.getId(),
requestVO.getPractitionerId(),
requestVO.getShareCode(),
mdDropOptionIds,
requestVO.getIsActive(), requestVO.getIsActive(),
requestVO.getPractitionerFileShares().getPageNum(), requestVO.getPractitionerFileShares().getPageNum(),
requestVO.getPractitionerFileShares().getPageSize()); requestVO.getPractitionerFileShares().getPageSize());
SharePractitionerInfo sharePractitionerInfo = agmsPractitionerDALService.findSharePractitioner(requestVO.getShareCode());
responseVO.setSharePractitionerInfo(sharePractitionerInfo);
responseVO.setPractitionerFileShares(practitionerFileShares); responseVO.setPractitionerFileShares(practitionerFileShares);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO; return responseVO;
......
...@@ -64,6 +64,10 @@ public class PractitionerFileSharing { ...@@ -64,6 +64,10 @@ public class PractitionerFileSharing {
*/ */
private String coverUrl; private String coverUrl;
private Long totalNum;
private Long num;
/** /**
* 获取 serial id * 获取 serial id
...@@ -317,11 +321,27 @@ public class PractitionerFileSharing { ...@@ -317,11 +321,27 @@ public class PractitionerFileSharing {
this.coverUrl = coverUrl; this.coverUrl = coverUrl;
} }
public Long getTotalNum() {
return totalNum;
}
public void setTotalNum(Long totalNum) {
this.totalNum = totalNum;
}
public Long getNum() {
return num;
}
public void setNum(Long num) {
this.num = num;
}
@Override @Override
public String toString() { public String toString() {
return "PractitionerFileSharing{" + return "PractitionerFileSharing{" +
"id=" + id + "id=" + id +
", mdDropOptionId=" + mdDropOptionId + ", mdDropOptionId='" + mdDropOptionId + '\'' +
", fileContent='" + fileContent + '\'' + ", fileContent='" + fileContent + '\'' +
", isActive=" + isActive + ", isActive=" + isActive +
", createdAt='" + createdAt + '\'' + ", createdAt='" + createdAt + '\'' +
...@@ -334,6 +354,8 @@ public class PractitionerFileSharing { ...@@ -334,6 +354,8 @@ public class PractitionerFileSharing {
", digest='" + digest + '\'' + ", digest='" + digest + '\'' +
", author='" + author + '\'' + ", author='" + author + '\'' +
", coverUrl='" + coverUrl + '\'' + ", coverUrl='" + coverUrl + '\'' +
", totalNum=" + totalNum +
", num=" + num +
'}'; '}';
} }
} }
...@@ -7,10 +7,16 @@ import com.github.pagehelper.PageInfo; ...@@ -7,10 +7,16 @@ import com.github.pagehelper.PageInfo;
*/ */
public class PractitionerFileSharingListRequestVO { public class PractitionerFileSharingListRequestVO {
private Long id;
private String shareCode;
private String mdDropOptionId; private String mdDropOptionId;
private Integer isActive; private Integer isActive;
private Long practitionerId;
private PageInfo<PractitionerFileSharing> practitionerFileShares; private PageInfo<PractitionerFileSharing> practitionerFileShares;
/** /**
...@@ -67,11 +73,38 @@ public class PractitionerFileSharingListRequestVO { ...@@ -67,11 +73,38 @@ public class PractitionerFileSharingListRequestVO {
this.practitionerFileShares = practitionerFileShares; this.practitionerFileShares = practitionerFileShares;
} }
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getShareCode() {
return shareCode;
}
public void setShareCode(String shareCode) {
this.shareCode = shareCode;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
@Override @Override
public String toString() { public String toString() {
return "PractitionerFileSharingListRequestVO{" + return "PractitionerFileSharingListRequestVO{" +
"mdDropOptionId=" + mdDropOptionId + "id=" + id +
", shareCode='" + shareCode + '\'' +
", mdDropOptionId='" + mdDropOptionId + '\'' +
", isActive=" + isActive + ", isActive=" + isActive +
", practitionerId=" + practitionerId +
", practitionerFileShares=" + practitionerFileShares + ", practitionerFileShares=" + practitionerFileShares +
'}'; '}';
} }
......
...@@ -10,6 +10,8 @@ import java.util.List; ...@@ -10,6 +10,8 @@ import java.util.List;
*/ */
public class PractitionerFileSharingListResponseVO { public class PractitionerFileSharingListResponseVO {
private SharePractitionerInfo sharePractitionerInfo;
private PageInfo<PractitionerFileSharing> practitionerFileShares; private PageInfo<PractitionerFileSharing> practitionerFileShares;
private CommonResult commonResult; private CommonResult commonResult;
...@@ -51,10 +53,19 @@ public class PractitionerFileSharingListResponseVO { ...@@ -51,10 +53,19 @@ public class PractitionerFileSharingListResponseVO {
this.commonResult = commonResult; this.commonResult = commonResult;
} }
public SharePractitionerInfo getSharePractitionerInfo() {
return sharePractitionerInfo;
}
public void setSharePractitionerInfo(SharePractitionerInfo sharePractitionerInfo) {
this.sharePractitionerInfo = sharePractitionerInfo;
}
@Override @Override
public String toString() { public String toString() {
return "PractitionerFileSharingListResponseVO{" + return "PractitionerFileSharingListResponseVO{" +
"practitionerFileShares=" + practitionerFileShares + "sharePractitionerInfo=" + sharePractitionerInfo +
", practitionerFileShares=" + practitionerFileShares +
", commonResult=" + commonResult + ", commonResult=" + commonResult +
'}'; '}';
} }
......
package com.yd.api.agms.vo.practitioner;
public class SharePractitionerInfo {
private Long customerId;
private Long practitionerId;
private String mobileNo;
private String headImagePath;
private String name;
private String qrCodePath;
private String insurerBranchName;
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
public String getHeadImagePath() {
return headImagePath;
}
public void setHeadImagePath(String headImagePath) {
this.headImagePath = headImagePath;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getQrCodePath() {
return qrCodePath;
}
public void setQrCodePath(String qrCodePath) {
this.qrCodePath = qrCodePath;
}
public String getInsurerBranchName() {
return insurerBranchName;
}
public void setInsurerBranchName(String insurerBranchName) {
this.insurerBranchName = insurerBranchName;
}
@Override
public String toString() {
return "SharePractitionerInfo{" +
"customerId=" + customerId +
", practitionerId=" + practitionerId +
", mobileNo='" + mobileNo + '\'' +
", headImagePath='" + headImagePath + '\'' +
", name='" + name + '\'' +
", qrCodePath='" + qrCodePath + '\'' +
", insurerBranchName='" + insurerBranchName + '\'' +
'}';
}
}
package com.yd.api.practitioner;
import com.yd.api.practitioner.service.PractitionerArticleService;
import com.yd.api.practitioner.vo.ArticleTrackSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveRequestVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackQueryResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackSaveRequestVO;
import com.yd.api.result.JsonResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("/practitionerArticle")
public class PractitionerArticleController {
@Autowired
private PractitionerArticleService practitionerArticleService;
/**
* 分享文章保存
*/
@RequestMapping("/articleShareCodeSave")
public Object articleShareCodeSave(@RequestBody ArticleShareCodeSaveRequestVO requestVO){
JsonResult result = new JsonResult();
ArticleShareCodeSaveResponseVO responseVO = practitionerArticleService.articleShareCodeSave(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/**
* 客户文章跟踪信息保存
*/
@RequestMapping("/articleTrackSave")
public Object articleTrackSave(@RequestBody ArticleTrackSaveRequestVO requestVO){
JsonResult result = new JsonResult();
ArticleTrackSaveResponseVO responseVO = practitionerArticleService.articleTrackSave(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/**
* 客户文章跟踪信息查询
*/
@RequestMapping(value = "/articleTrackQuery",method = RequestMethod.GET)
public Object articleTrackQuery(@RequestParam("practitionerId") Long practitionerId,
@RequestParam("sharingId") Long sharingId ){
JsonResult result = new JsonResult();
ArticleTrackQueryResponseVO responseVO = practitionerArticleService.articleTrackQuery(practitionerId,sharingId);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
}
package com.yd.api.practitioner.service;
import com.yd.api.practitioner.vo.ArticleTrackSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveRequestVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackQueryResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackSaveRequestVO;
public interface PractitionerArticleService {
ArticleShareCodeSaveResponseVO articleShareCodeSave(ArticleShareCodeSaveRequestVO requestVO);
ArticleTrackSaveResponseVO articleTrackSave(ArticleTrackSaveRequestVO requestVO);
ArticleTrackQueryResponseVO articleTrackQuery(Long practitionerId,Long sharingId);
}
package com.yd.api.practitioner.service.impl;
import com.yd.api.practitioner.service.PractitionerArticleService;
import com.yd.api.practitioner.vo.ArticleTrackSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveRequestVO;
import com.yd.api.practitioner.vo.article.ArticleShareCodeSaveResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackQueryResponseVO;
import com.yd.api.practitioner.vo.article.ArticleTrackSaveRequestVO;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.AclCustomerObjectShare;
import com.yd.dal.entity.customer.AclCustomerObjectShareTrack;
import com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo;
import com.yd.dal.service.customer.AclCustomerObjectShareDALService;
import com.yd.dal.service.customer.AclCustomerObjectShareTrackDALService;
import com.yd.dal.service.practitioner.PractitionerArticleDALService;
import com.yd.util.CommonUtil;
import com.yd.util.config.ZHBErrorConfig;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Date;
import java.util.List;
@Service("practitionerArticleService")
public class PractitionerArticleServiceImpl implements PractitionerArticleService {
@Autowired
private AclCustomerObjectShareDALService aclCustomerObjectShareDALService;
@Autowired
private AclCustomerObjectShareTrackDALService aclCustomerObjectShareTrackDALService;
@Autowired
private PractitionerArticleDALService practitionerArticleDALService;
@Override
public ArticleShareCodeSaveResponseVO articleShareCodeSave(ArticleShareCodeSaveRequestVO requestVO) {
ArticleShareCodeSaveResponseVO responseVO = new ArticleShareCodeSaveResponseVO();
AclCustomerObjectShare objectShare = new AclCustomerObjectShare();
BeanUtils.copyProperties(requestVO,objectShare);
objectShare.setItemType(1);
objectShare.setCreatedAt(new Date());
objectShare.setCreatedBy(-1L);
Long id = aclCustomerObjectShareDALService.save(objectShare);
responseVO.setId(id);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
@Override
public ArticleTrackSaveResponseVO articleTrackSave(ArticleTrackSaveRequestVO requestVO) {
ArticleTrackSaveResponseVO responseVO = new ArticleTrackSaveResponseVO();
AclCustomerObjectShareTrack shareTrack = new AclCustomerObjectShareTrack();
BeanUtils.copyProperties(requestVO,shareTrack);
shareTrack.setCreatedAt(new Date());
shareTrack.setCreatedBy(-1L);
Long id = requestVO.getId();
if (CommonUtil.isNullOrZero(id)){
String shareCode = shareTrack.getShareCode();
Long shareCodeId = aclCustomerObjectShareDALService.findIdByShareCode(shareCode);
shareTrack.setShareId(shareCodeId);
shareTrack.setTrackInTime(new Date());
id = aclCustomerObjectShareTrackDALService.save(shareTrack);
}else {
shareTrack.setTrackOutTime(new Date());
aclCustomerObjectShareTrackDALService.update(shareTrack);
}
responseVO.setId(id);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
@Override
public ArticleTrackQueryResponseVO articleTrackQuery(Long practitionerId,Long sharingId) {
ArticleTrackQueryResponseVO responseVO = new ArticleTrackQueryResponseVO();
//通过经纪人id和文章id查询 客户跟踪信息
List<ArticleTrackQueryInfo> articleTrackQueryInfos = practitionerArticleDALService.articleTrackQuery(practitionerId,sharingId);
if (articleTrackQueryInfos.isEmpty()){
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
articleTrackQueryInfos.forEach(a -> {
try {
if ((a.getNickName() != null)) {
a.setNickName(URLDecoder.decode(a.getNickName(), "utf-8"));
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
});
responseVO.setArticleTrackQueryInfos(articleTrackQueryInfos);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
}
...@@ -210,6 +210,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -210,6 +210,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
CustomerFileUpload fileUpload = aclFileUploadDALService.findFilePathInfo(targetType,targetUseFor,practitionerId); CustomerFileUpload fileUpload = aclFileUploadDALService.findFilePathInfo(targetType,targetUseFor,practitionerId);
String imagePath = (fileUpload != null) ? fileUpload.getFilePath() : null; String imagePath = (fileUpload != null) ? fileUpload.getFilePath() : null;
basicInfo.setHeadImagePath(imagePath); basicInfo.setHeadImagePath(imagePath);
//获取二维码
targetUseFor = 9;
fileUpload = aclFileUploadDALService.findFilePathInfo(targetType,targetUseFor,practitionerId);
String qrCodePath = (fileUpload != null) ? fileUpload.getFilePath() : null;
basicInfo.setQrCodePath(qrCodePath);
//获取体系信息 //获取体系信息
Long subordinateId = practitionerInfo.getSubordinateId(); Long subordinateId = practitionerInfo.getSubordinateId();
if(subordinateId != null){ if(subordinateId != null){
......
package com.yd.api.practitioner.vo;
import com.yd.api.result.CommonResult;
public class ArticleTrackSaveResponseVO {
private Long id;
private CommonResult commonResult;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.article;
import java.util.Date;
public class ArticleShareCodeSaveRequestVO {
/**
* 分类类别id
*/
private Long itemId;
/**
* 经纪人ID
*/
private Long practitionerId;
/**
* 分享码
*/
private String shareCode;
/**
* FK ag_acl_customer.id
*/
private Long customerId;
/**
* 1. ios, 2.android 3.windows 4. mac os 5. Linux 6. other
*/
private Integer os;
/**
* 1. wechat 2. wechat friend 3.QQ 4. QZone 5.weibo
*/
private Integer channel;
/**
* entire url of shared link
*/
private String url;
public Long getItemId() {
return itemId;
}
public void setItemId(Long itemId) {
this.itemId = itemId;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public String getShareCode() {
return shareCode;
}
public void setShareCode(String shareCode) {
this.shareCode = shareCode;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Integer getOs() {
return os;
}
public void setOs(Integer os) {
this.os = os;
}
public Integer getChannel() {
return channel;
}
public void setChannel(Integer channel) {
this.channel = channel;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
package com.yd.api.practitioner.vo.article;
import com.yd.api.result.CommonResult;
public class ArticleShareCodeSaveResponseVO {
private Long id;
private CommonResult commonResult;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.article;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo;
import java.util.List;
public class ArticleTrackQueryResponseVO {
private List<ArticleTrackQueryInfo> articleTrackQueryInfos;
private CommonResult commonResult;
public List<ArticleTrackQueryInfo> getArticleTrackQueryInfos() {
return articleTrackQueryInfos;
}
public void setArticleTrackQueryInfos(List<ArticleTrackQueryInfo> articleTrackQueryInfos) {
this.articleTrackQueryInfos = articleTrackQueryInfos;
}
public CommonResult getCommonResult() {
return commonResult;
}
public void setCommonResult(CommonResult commonResult) {
this.commonResult = commonResult;
}
}
package com.yd.api.practitioner.vo.article;
import java.util.Date;
public class ArticleTrackSaveRequestVO {
/**
* serial id
*/
private Long id;
/**
* 分享ID FK ag_acl_customer_object_share.id
*/
private Long shareId;
/**
* 分享码 FK ag_acl_customer_object_share.share_code
*/
private String shareCode;
/**
* 微信昵称
*/
private String nickname;
/**
* 1=Male, 2=Female
*/
private Integer gender;
/**
* 微信头像
*/
private String imagePath;
/**
* 地域
*/
private String region;
/**
* 来源
*/
private String sourceFrom;
/**
* 入口页面
*/
private String entryPage;
/**
* 访问功能ID
*/
private String buttonId;
/**
* 锚点ID
*/
private String anchorId;
/**
* 行为动作类型enter、close、buttonclick
*/
private String actionType;
/**
* 设备类型
*/
private String deviceType;
/**
* 访问IP
*/
private String ipAddress;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getShareId() {
return shareId;
}
public void setShareId(Long shareId) {
this.shareId = shareId;
}
public String getShareCode() {
return shareCode;
}
public void setShareCode(String shareCode) {
this.shareCode = shareCode;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public String getImagePath() {
return imagePath;
}
public void setImagePath(String imagePath) {
this.imagePath = imagePath;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public String getSourceFrom() {
return sourceFrom;
}
public void setSourceFrom(String sourceFrom) {
this.sourceFrom = sourceFrom;
}
public String getEntryPage() {
return entryPage;
}
public void setEntryPage(String entryPage) {
this.entryPage = entryPage;
}
public String getButtonId() {
return buttonId;
}
public void setButtonId(String buttonId) {
this.buttonId = buttonId;
}
public String getAnchorId() {
return anchorId;
}
public void setAnchorId(String anchorId) {
this.anchorId = anchorId;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
}
...@@ -8,6 +8,7 @@ public class PractitionerLoginBasicInfo { ...@@ -8,6 +8,7 @@ public class PractitionerLoginBasicInfo {
private String insurerBranchName;//分公司名称 private String insurerBranchName;//分公司名称
private String subordinateName;//体系名 private String subordinateName;//体系名
private String subordinateLeader;//团队长 private String subordinateLeader;//团队长
private String qrCodePath;//二维码地址
public String getName() { public String getName() {
return name; return name;
...@@ -64,4 +65,12 @@ public class PractitionerLoginBasicInfo { ...@@ -64,4 +65,12 @@ public class PractitionerLoginBasicInfo {
public void setSubordinateLeader(String subordinateLeader) { public void setSubordinateLeader(String subordinateLeader) {
this.subordinateLeader = subordinateLeader; this.subordinateLeader = subordinateLeader;
} }
public String getQrCodePath() {
return qrCodePath;
}
public void setQrCodePath(String qrCodePath) {
this.qrCodePath = qrCodePath;
}
} }
package com.yd.dal.entity.customer;
import java.util.Date;
/**
* customer object share record = referral record
*/
public class AclCustomerObjectShare {
/**
* serial id
*/
private Long id;
/**
* 分享分类 1-文章 2-其他
*/
private Integer itemType;
/**
* 分类类别id
*/
private Long itemId;
/**
* 经纪人ID
*/
private Long practitionerId;
/**
* 分享码
*/
private String shareCode;
/**
* FK ag_acl_customer.id
*/
private Long customerId;
/**
* 1. ios, 2.android 3.windows 4. mac os 5. Linux 6. other
*/
private Integer os;
/**
* 1. wechat 2. wechat friend 3.QQ 4. QZone 5.weibo
*/
private Integer channel;
/**
* entire url of shared link
*/
private String url;
/**
* 参数过多直接存参数的JSON字符串
*/
private String jsonParams;
/**
* 存试算结果的JSON字符串tableRateDetails
*/
private String jsonParamsCoverageInfo;
/**
* 创建时间
*/
private Date createdAt;
/**
* 创建人
*/
private Long createdBy;
/**
* 修改时间
*/
private Date updatedAt;
/**
* 修改人
*/
private Long updatedBy;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getItemType() {
return itemType;
}
public void setItemType(Integer itemType) {
this.itemType = itemType;
}
public Long getItemId() {
return itemId;
}
public void setItemId(Long itemId) {
this.itemId = itemId;
}
public Long getPractitionerId() {
return practitionerId;
}
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public String getShareCode() {
return shareCode;
}
public void setShareCode(String shareCode) {
this.shareCode = shareCode;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Integer getOs() {
return os;
}
public void setOs(Integer os) {
this.os = os;
}
public Integer getChannel() {
return channel;
}
public void setChannel(Integer channel) {
this.channel = channel;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getJsonParams() {
return jsonParams;
}
public void setJsonParams(String jsonParams) {
this.jsonParams = jsonParams;
}
public String getJsonParamsCoverageInfo() {
return jsonParamsCoverageInfo;
}
public void setJsonParamsCoverageInfo(String jsonParamsCoverageInfo) {
this.jsonParamsCoverageInfo = jsonParamsCoverageInfo;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Long getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy;
}
}
\ No newline at end of file
package com.yd.dal.entity.customer;
import java.util.Date;
/**
* 用户浏览分享跟踪表
*/
public class AclCustomerObjectShareTrack {
/**
* serial id
*/
private Long id;
/**
* 分享ID FK ag_acl_customer_object_share.id
*/
private Long shareId;
/**
* 分享码 FK ag_acl_customer_object_share.share_code
*/
private String shareCode;
/**
* 微信昵称
*/
private String nickname;
/**
* 1=Male, 2=Female
*/
private Integer gender;
/**
* 微信头像
*/
private String imagePath;
/**
* 跟踪开始时间
*/
private Date trackInTime;
/**
* 跟踪结束时间
*/
private Date trackOutTime;
/**
* 地域
*/
private String region;
/**
* 来源
*/
private String sourceFrom;
/**
* 入口页面
*/
private String entryPage;
/**
* 访问功能ID
*/
private String buttonId;
/**
* 锚点ID
*/
private String anchorId;
/**
* 行为动作类型enter、close、buttonclick
*/
private String actionType;
/**
* 设备类型
*/
private String deviceType;
/**
* 访问IP
*/
private String ipAddress;
private Date createdAt;
private Long createdBy;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getShareId() {
return shareId;
}
public void setShareId(Long shareId) {
this.shareId = shareId;
}
public String getShareCode() {
return shareCode;
}
public void setShareCode(String shareCode) {
this.shareCode = shareCode;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Integer getGender() {
return gender;
}
public void setGender(Integer gender) {
this.gender = gender;
}
public String getImagePath() {
return imagePath;
}
public void setImagePath(String imagePath) {
this.imagePath = imagePath;
}
public Date getTrackInTime() {
return trackInTime;
}
public void setTrackInTime(Date trackInTime) {
this.trackInTime = trackInTime;
}
public Date getTrackOutTime() {
return trackOutTime;
}
public void setTrackOutTime(Date trackOutTime) {
this.trackOutTime = trackOutTime;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public String getSourceFrom() {
return sourceFrom;
}
public void setSourceFrom(String sourceFrom) {
this.sourceFrom = sourceFrom;
}
public String getEntryPage() {
return entryPage;
}
public void setEntryPage(String entryPage) {
this.entryPage = entryPage;
}
public String getButtonId() {
return buttonId;
}
public void setButtonId(String buttonId) {
this.buttonId = buttonId;
}
public String getAnchorId() {
return anchorId;
}
public void setAnchorId(String anchorId) {
this.anchorId = anchorId;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
}
\ No newline at end of file
package com.yd.dal.entity.practitioner.article;
public class ArticleTrackQueryInfo {
private String imagePath;
private String nickName;
private String trackInTime;
private Long gender;
public String getImagePath() {
return imagePath;
}
public void setImagePath(String imagePath) {
this.imagePath = imagePath;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getTrackInTime() {
return trackInTime;
}
public void setTrackInTime(String trackInTime) {
this.trackInTime = trackInTime;
}
public Long getGender() {
return gender;
}
public void setGender(Long gender) {
this.gender = gender;
}
}
...@@ -2,6 +2,7 @@ package com.yd.dal.mapper.agms; ...@@ -2,6 +2,7 @@ package com.yd.dal.mapper.agms;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.yd.api.agms.vo.practitioner.PractitionerFileSharing; import com.yd.api.agms.vo.practitioner.PractitionerFileSharing;
import com.yd.api.agms.vo.practitioner.SharePractitionerInfo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
...@@ -14,5 +15,11 @@ public interface AgmsPractitionerMapper { ...@@ -14,5 +15,11 @@ public interface AgmsPractitionerMapper {
* @param isActive 是否启用 * @param isActive 是否启用
* @return * @return
*/ */
Page<PractitionerFileSharing> practitionerFileSharingList(@Param("mdDropOptionIds") Long[] mdDropOptionIds ,@Param("isActive") Integer isActive); Page<PractitionerFileSharing> practitionerFileSharingList(@Param("id")Long id,
@Param("practitionerId") Long practitionerId,
@Param("shareCode") String shareCode,
@Param("mdDropOptionIds") Long[] mdDropOptionIds ,
@Param("isActive") Integer isActive);
SharePractitionerInfo findSharePractitioner(String shareCode);
} }
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclCustomerObjectShare;
import org.apache.ibatis.annotations.Param;
public interface AclCustomerObjectShareMapper {
int deleteByPrimaryKey(Long id);
int insert(AclCustomerObjectShare record);
int insertSelective(AclCustomerObjectShare record);
AclCustomerObjectShare selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclCustomerObjectShare record);
int updateByPrimaryKey(AclCustomerObjectShare record);
Long findIdByShareCode(@Param("shareCode") String shareCode);
}
\ No newline at end of file
package com.yd.dal.mapper.customer;
import com.yd.dal.entity.customer.AclCustomerObjectShareTrack;
public interface AclCustomerObjectShareTrackMapper {
int deleteByPrimaryKey(Long id);
int insert(AclCustomerObjectShareTrack record);
int insertSelective(AclCustomerObjectShareTrack record);
AclCustomerObjectShareTrack selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(AclCustomerObjectShareTrack record);
int updateByPrimaryKey(AclCustomerObjectShareTrack record);
}
\ No newline at end of file
package com.yd.dal.mapper.practitioner;
import com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface PractitionerArticleMapper {
List<ArticleTrackQueryInfo> articleTrackQuery(@Param("practitionerId") Long practitionerId,@Param("sharingId") Long sharingId);
}
...@@ -2,6 +2,7 @@ package com.yd.dal.service.agms; ...@@ -2,6 +2,7 @@ package com.yd.dal.service.agms;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yd.api.agms.vo.practitioner.PractitionerFileSharing; import com.yd.api.agms.vo.practitioner.PractitionerFileSharing;
import com.yd.api.agms.vo.practitioner.SharePractitionerInfo;
/** /**
* @author xxy * @author xxy
...@@ -15,5 +16,7 @@ public interface AgmsPractitionerDALService { ...@@ -15,5 +16,7 @@ public interface AgmsPractitionerDALService {
* @param size 每页的数量 * @param size 每页的数量
* @return 查询结果 * @return 查询结果
*/ */
PageInfo<PractitionerFileSharing> practitionerFileSharingList(Long[] mdDropOptionId, Integer isActive, int pageNum, int size); PageInfo<PractitionerFileSharing> practitionerFileSharingList(Long id ,Long practitionerId,String shareCode,Long[] mdDropOptionId, Integer isActive, int pageNum, int size);
SharePractitionerInfo findSharePractitioner(String shareCode);
} }
...@@ -4,8 +4,10 @@ import com.github.pagehelper.Page; ...@@ -4,8 +4,10 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yd.api.agms.vo.practitioner.PractitionerFileSharing; import com.yd.api.agms.vo.practitioner.PractitionerFileSharing;
import com.yd.api.agms.vo.practitioner.SharePractitionerInfo;
import com.yd.dal.mapper.agms.AgmsPractitionerMapper; import com.yd.dal.mapper.agms.AgmsPractitionerMapper;
import com.yd.dal.service.agms.AgmsPractitionerDALService; import com.yd.dal.service.agms.AgmsPractitionerDALService;
import com.yd.util.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -18,10 +20,17 @@ public class AgmsPractitionerDALServiceImpl implements AgmsPractitionerDALServic ...@@ -18,10 +20,17 @@ public class AgmsPractitionerDALServiceImpl implements AgmsPractitionerDALServic
@Autowired @Autowired
private AgmsPractitionerMapper mapper; private AgmsPractitionerMapper mapper;
@Override @Override
public PageInfo<PractitionerFileSharing> practitionerFileSharingList(Long[] mdDropOptionIds, Integer isActive, int pageNum, int size) { public PageInfo<PractitionerFileSharing> practitionerFileSharingList(Long id ,Long practitionerId ,String shareCode,Long[] mdDropOptionIds, Integer isActive, int pageNum, int size) {
PageHelper.startPage(pageNum, size); PageHelper.startPage(pageNum, size);
Page<PractitionerFileSharing> practitionerFileShares = mapper.practitionerFileSharingList(mdDropOptionIds,isActive); Page<PractitionerFileSharing> practitionerFileShares = mapper.practitionerFileSharingList(id,practitionerId,shareCode,mdDropOptionIds,isActive);
PageInfo<PractitionerFileSharing> pageInfo = new PageInfo<>(practitionerFileShares); return new PageInfo<>(practitionerFileShares);
return pageInfo; }
@Override
public SharePractitionerInfo findSharePractitioner(String shareCode) {
if (CommonUtil.isNullOrBlank(shareCode)){
return null;
}
return mapper.findSharePractitioner(shareCode);
} }
} }
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclCustomerObjectShare;
public interface AclCustomerObjectShareDALService {
Long save(AclCustomerObjectShare objectShare);
Long findIdByShareCode(String shareCode);
}
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclCustomerObjectShareTrack;
public interface AclCustomerObjectShareTrackDALService {
Long save(AclCustomerObjectShareTrack shareTrack);
void update(AclCustomerObjectShareTrack shareTrack);
}
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclCustomerObjectShare;
import com.yd.dal.mapper.customer.AclCustomerMembershipMapper;
import com.yd.dal.mapper.customer.AclCustomerObjectShareMapper;
import com.yd.dal.service.customer.AclCustomerObjectShareDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("aclCustomerObjectShareDALService")
public class AclCustomerObjectShareDALServiceImpl implements AclCustomerObjectShareDALService {
@Autowired
private AclCustomerObjectShareMapper mapper;
@Override
public Long save(AclCustomerObjectShare objectShare) {
mapper.insertSelective(objectShare);
return objectShare.getId();
}
@Override
public Long findIdByShareCode(String shareCode) {
return mapper.findIdByShareCode(shareCode);
}
}
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclCustomerObjectShareTrack;
import com.yd.dal.mapper.customer.AclCustomerObjectShareTrackMapper;
import com.yd.dal.service.customer.AclCustomerObjectShareTrackDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("aclCustomerObjectShareTrackDALService")
public class AclCustomerObjectShareTrackDALServiceImpl implements AclCustomerObjectShareTrackDALService {
@Autowired
private AclCustomerObjectShareTrackMapper mapper;
@Override
public Long save(AclCustomerObjectShareTrack shareTrack) {
mapper.insertSelective(shareTrack);
return shareTrack.getId();
}
@Override
public void update(AclCustomerObjectShareTrack shareTrack) {
mapper.updateByPrimaryKeySelective(shareTrack);
}
}
package com.yd.dal.service.practitioner;
import com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo;
import java.util.List;
public interface PractitionerArticleDALService {
List<ArticleTrackQueryInfo> articleTrackQuery(Long practitionerId, Long sharingId);
}
package com.yd.dal.service.practitioner.impl;
import com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo;
import com.yd.dal.mapper.practitioner.PractitionerArticleMapper;
import com.yd.dal.service.practitioner.PractitionerArticleDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("practitionerArticleDALService")
public class PractitionerArticleDALServiceImpl implements PractitionerArticleDALService {
@Resource
private PractitionerArticleMapper mapper;
@Override
public List<ArticleTrackQueryInfo> articleTrackQuery(Long practitionerId, Long sharingId) {
return mapper.articleTrackQuery(practitionerId,sharingId);
}
}
...@@ -3,34 +3,84 @@ ...@@ -3,34 +3,84 @@
<mapper namespace="com.yd.dal.mapper.agms.AgmsPractitionerMapper"> <mapper namespace="com.yd.dal.mapper.agms.AgmsPractitionerMapper">
<select id="practitionerFileSharingList" resultType="com.yd.api.agms.vo.practitioner.PractitionerFileSharing"> <select id="practitionerFileSharingList" resultType="com.yd.api.agms.vo.practitioner.PractitionerFileSharing">
select s.id id, SELECT s.id id,
s.md_drop_option_id mdDropOptionId, s.md_drop_option_id mdDropOptionId,
s.file_content fileContent, s.file_content fileContent,
s.is_active isActive, s.is_active isActive,
s.created_at createdAt, date_format(s.created_at, '%Y-%m-%d %H:%i:%s')createdAt,
s.created_by createdBy, s.created_by createdBy,
uc.name createdName, uc.name createdName,
s.updated_at updatedAt, date_format(s.updated_at, '%Y-%m-%d %H:%i:%s') updatedAt,
s.updated_by updatedBy, s.updated_by updatedBy,
uu.name updatedName, uu.name updatedName,
s.title title, s.title title,
s.digest digest, s.digest digest,
s.author author, s.author author,
s.cover_url coverUrl s.cover_url coverUrl,
from ag_acl_practitioner_file_sharing s count(ost.id) totalNum
left join ag_md_drop_options o on o.id = s.md_drop_option_id <if test="practitionerId != null">
left join ag_acl_user uc on uc.id = s.created_by ,(SELECT count(aost.id)
left join ag_acl_user uu on uu.id = s.created_by FROM ag_acl_customer_object_share_track aost
WHERE aost.share_id IN (
SELECT aos.id
FROM ag_acl_customer_object_share aos
WHERE aos.item_id = s.id
AND aos.item_type = 1
AND aos.practitioner_id = #{practitionerId,jdbcType=BIGINT}
)) num
</if>
FROM ag_acl_practitioner_file_sharing s
LEFT JOIN ag_md_drop_options o on o.id = s.md_drop_option_id
LEFT JOIN ag_acl_user uc on uc.id = s.created_by
LEFT JOIN ag_acl_user uu on uu.id = s.created_by
LEFT JOIN ag_acl_customer_object_share os
LEFT JOIN ag_acl_customer_object_share_track ost ON ost.share_id = os.id
ON os.item_id = s.id
<where> <where>
<if test="mdDropOptionIds != null"> <if test="mdDropOptionIds != null">
<foreach collection="mdDropOptionIds" item="mdDropOptionId" index="index" separator="or"> <foreach collection="mdDropOptionIds" item="mdDropOptionId" index="index" open="(" close=")" separator="or">
find_in_set (#{mdDropOptionId,jdbcType=BIGINT},s.md_drop_option_id) find_in_set (#{mdDropOptionId,jdbcType=BIGINT},s.md_drop_option_id)
</foreach> </foreach>
</if> </if>
<if test="id != null">
AND s.id = #{id,jdbcType=BIGINT}
</if>
<if test="shareCode != null">
AND os.item_type = 1
AND os.share_code = #{shareCode,jdbcType=VARCHAR}
</if>
<if test="isActive != null"> <if test="isActive != null">
and s.is_active = #{isActive,jdbcType=INTEGER} AND s.is_active = #{isActive,jdbcType=INTEGER}
</if> </if>
</where> </where>
ORDER BY s.id desc GROUP BY s.id
ORDER BY s.id DESC
</select>
<resultMap id="BaseResultMap" type="com.yd.api.agms.vo.practitioner.SharePractitionerInfo">
<result column="customerId" jdbcType="BIGINT" property="customerId" />
<result column="practitionerId" jdbcType="BIGINT" property="practitionerId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="mobileNo" jdbcType="VARCHAR" property="mobileNo" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>
<result column="insurerBranchName" jdbcType="VARCHAR" property="insurerBranchName" />
<result column="headImagePath" jdbcType="VARCHAR" property="headImagePath" />
<result column="qrCodePath" jdbcType="VARCHAR" property="qrCodePath" />
</resultMap>
<select id="findSharePractitioner" resultMap="BaseResultMap">
SELECT p.customer_id customerId,
p.id practitionerId,
p.name name,
p.mobile_no mobileNo,
b.branch_name insurerBranchName,
uh.file_path headImagePath,
uw.file_path qrCodePath
FROM ag_acl_customer_object_share os
LEFT JOIN ag_acl_practitioner p
LEFT JOIN ag_acl_insurer_branch b ON b.id = p.insurer_branch_id
LEFT JOIN ag_acl_file_upload uh
ON uh.target_type = 1 AND uh.target_id = p.id AND uh.is_active = 1 AND uh.file_type = 1
LEFT JOIN ag_acl_file_upload uw
ON uh.target_type = 1 AND uh.target_id = p.id AND uh.is_active = 1 AND uh.file_type = 9
ON p.id = os.practitioner_id
WHERE os.share_code = #{shareCode,jdbcType=VARCHAR}
</select> </select>
</mapper> </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.customer.AclCustomerObjectShareMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclCustomerObjectShare">
<!--@mbg.generated-->
<!--@Table ag_acl_customer_object_share-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="item_type" jdbcType="INTEGER" property="itemType" />
<result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="share_code" jdbcType="VARCHAR" property="shareCode" />
<result column="customer_id" jdbcType="BIGINT" property="customerId" />
<result column="os" jdbcType="INTEGER" property="os" />
<result column="channel" jdbcType="INTEGER" property="channel" />
<result column="url" jdbcType="LONGVARCHAR" property="url" />
<result column="json_params" jdbcType="LONGVARCHAR" property="jsonParams" />
<result column="json_params_coverage_info" jdbcType="LONGVARCHAR" property="jsonParamsCoverageInfo" />
<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">
<!--@mbg.generated-->
id, item_type, item_id, practitioner_id, share_code, customer_id, os, channel, url,
json_params, json_params_coverage_info, created_at, created_by, updated_at, updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from ag_acl_customer_object_share
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from ag_acl_customer_object_share
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerObjectShare" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_acl_customer_object_share (item_type, item_id, practitioner_id,
share_code, customer_id, os,
channel, url, json_params,
json_params_coverage_info, created_at,
created_by, updated_at, updated_by
)
values (#{itemType,jdbcType=INTEGER}, #{itemId,jdbcType=BIGINT}, #{practitionerId,jdbcType=BIGINT},
#{shareCode,jdbcType=VARCHAR}, #{customerId,jdbcType=BIGINT}, #{os,jdbcType=INTEGER},
#{channel,jdbcType=INTEGER}, #{url,jdbcType=LONGVARCHAR}, #{jsonParams,jdbcType=LONGVARCHAR},
#{jsonParamsCoverageInfo,jdbcType=LONGVARCHAR}, #{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.AclCustomerObjectShare" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_acl_customer_object_share
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="itemType != null">
item_type,
</if>
<if test="itemId != null">
item_id,
</if>
<if test="practitionerId != null">
practitioner_id,
</if>
<if test="shareCode != null">
share_code,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="os != null">
os,
</if>
<if test="channel != null">
channel,
</if>
<if test="url != null">
url,
</if>
<if test="jsonParams != null">
json_params,
</if>
<if test="jsonParamsCoverageInfo != null">
json_params_coverage_info,
</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="itemType != null">
#{itemType,jdbcType=INTEGER},
</if>
<if test="itemId != null">
#{itemId,jdbcType=BIGINT},
</if>
<if test="practitionerId != null">
#{practitionerId,jdbcType=BIGINT},
</if>
<if test="shareCode != null">
#{shareCode,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
#{customerId,jdbcType=BIGINT},
</if>
<if test="os != null">
#{os,jdbcType=INTEGER},
</if>
<if test="channel != null">
#{channel,jdbcType=INTEGER},
</if>
<if test="url != null">
#{url,jdbcType=LONGVARCHAR},
</if>
<if test="jsonParams != null">
#{jsonParams,jdbcType=LONGVARCHAR},
</if>
<if test="jsonParamsCoverageInfo != null">
#{jsonParamsCoverageInfo,jdbcType=LONGVARCHAR},
</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.AclCustomerObjectShare">
<!--@mbg.generated-->
update ag_acl_customer_object_share
<set>
<if test="itemType != null">
item_type = #{itemType,jdbcType=INTEGER},
</if>
<if test="itemId != null">
item_id = #{itemId,jdbcType=BIGINT},
</if>
<if test="practitionerId != null">
practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if>
<if test="shareCode != null">
share_code = #{shareCode,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=BIGINT},
</if>
<if test="os != null">
os = #{os,jdbcType=INTEGER},
</if>
<if test="channel != null">
channel = #{channel,jdbcType=INTEGER},
</if>
<if test="url != null">
url = #{url,jdbcType=LONGVARCHAR},
</if>
<if test="jsonParams != null">
json_params = #{jsonParams,jdbcType=LONGVARCHAR},
</if>
<if test="jsonParamsCoverageInfo != null">
json_params_coverage_info = #{jsonParamsCoverageInfo,jdbcType=LONGVARCHAR},
</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.AclCustomerObjectShare">
<!--@mbg.generated-->
update ag_acl_customer_object_share
set item_type = #{itemType,jdbcType=INTEGER},
item_id = #{itemId,jdbcType=BIGINT},
practitioner_id = #{practitionerId,jdbcType=BIGINT},
share_code = #{shareCode,jdbcType=VARCHAR},
customer_id = #{customerId,jdbcType=BIGINT},
os = #{os,jdbcType=INTEGER},
channel = #{channel,jdbcType=INTEGER},
url = #{url,jdbcType=LONGVARCHAR},
json_params = #{jsonParams,jdbcType=LONGVARCHAR},
json_params_coverage_info = #{jsonParamsCoverageInfo,jdbcType=LONGVARCHAR},
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>
<select id="findIdByShareCode" resultType="java.lang.Long">
select
id
from ag_acl_customer_object_share
where share_code = #{shareCode,jdbcType=VARCHAR}
</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.customer.AclCustomerObjectShareTrackMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclCustomerObjectShareTrack">
<!--@mbg.generated-->
<!--@Table ag_acl_customer_object_share_track-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="share_id" jdbcType="BIGINT" property="shareId" />
<result column="share_code" jdbcType="VARCHAR" property="shareCode" />
<result column="nickname" jdbcType="LONGVARCHAR" property="nickname" />
<result column="gender" jdbcType="INTEGER" property="gender" />
<result column="image_path" jdbcType="LONGVARCHAR" property="imagePath" />
<result column="track_in_time" jdbcType="TIMESTAMP" property="trackInTime" />
<result column="track_out_time" jdbcType="TIMESTAMP" property="trackOutTime" />
<result column="region" jdbcType="VARCHAR" property="region" />
<result column="source_from" jdbcType="LONGVARCHAR" property="sourceFrom" />
<result column="entry_page" jdbcType="LONGVARCHAR" property="entryPage" />
<result column="button_id" jdbcType="VARCHAR" property="buttonId" />
<result column="anchor_id" jdbcType="VARCHAR" property="anchorId" />
<result column="action_type" jdbcType="VARCHAR" property="actionType" />
<result column="device_type" jdbcType="VARCHAR" property="deviceType" />
<result column="ip_address" jdbcType="VARCHAR" property="ipAddress" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, share_id, share_code, nickname, gender, image_path, track_in_time, track_out_time,
region, source_from, entry_page, button_id, anchor_id, action_type, device_type,
ip_address, created_at, created_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from ag_acl_customer_object_share_track
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from ag_acl_customer_object_share_track
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerObjectShareTrack" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_acl_customer_object_share_track (share_id, share_code, nickname,
gender, image_path, track_in_time,
track_out_time, region, source_from,
entry_page, button_id, anchor_id,
action_type, device_type, ip_address,
created_at, created_by)
values (#{shareId,jdbcType=BIGINT}, #{shareCode,jdbcType=VARCHAR}, #{nickname,jdbcType=LONGVARCHAR},
#{gender,jdbcType=INTEGER}, #{imagePath,jdbcType=LONGVARCHAR}, #{trackInTime,jdbcType=TIMESTAMP},
#{trackOutTime,jdbcType=TIMESTAMP}, #{region,jdbcType=VARCHAR}, #{sourceFrom,jdbcType=LONGVARCHAR},
#{entryPage,jdbcType=LONGVARCHAR}, #{buttonId,jdbcType=VARCHAR}, #{anchorId,jdbcType=VARCHAR},
#{actionType,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR}, #{ipAddress,jdbcType=VARCHAR},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerObjectShareTrack" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_acl_customer_object_share_track
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="shareId != null">
share_id,
</if>
<if test="shareCode != null">
share_code,
</if>
<if test="nickname != null">
nickname,
</if>
<if test="gender != null">
gender,
</if>
<if test="imagePath != null">
image_path,
</if>
<if test="trackInTime != null">
track_in_time,
</if>
<if test="trackOutTime != null">
track_out_time,
</if>
<if test="region != null">
region,
</if>
<if test="sourceFrom != null">
source_from,
</if>
<if test="entryPage != null">
entry_page,
</if>
<if test="buttonId != null">
button_id,
</if>
<if test="anchorId != null">
anchor_id,
</if>
<if test="actionType != null">
action_type,
</if>
<if test="deviceType != null">
device_type,
</if>
<if test="ipAddress != null">
ip_address,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="createdBy != null">
created_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="shareId != null">
#{shareId,jdbcType=BIGINT},
</if>
<if test="shareCode != null">
#{shareCode,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
#{nickname,jdbcType=LONGVARCHAR},
</if>
<if test="gender != null">
#{gender,jdbcType=INTEGER},
</if>
<if test="imagePath != null">
#{imagePath,jdbcType=LONGVARCHAR},
</if>
<if test="trackInTime != null">
#{trackInTime,jdbcType=TIMESTAMP},
</if>
<if test="trackOutTime != null">
#{trackOutTime,jdbcType=TIMESTAMP},
</if>
<if test="region != null">
#{region,jdbcType=VARCHAR},
</if>
<if test="sourceFrom != null">
#{sourceFrom,jdbcType=LONGVARCHAR},
</if>
<if test="entryPage != null">
#{entryPage,jdbcType=LONGVARCHAR},
</if>
<if test="buttonId != null">
#{buttonId,jdbcType=VARCHAR},
</if>
<if test="anchorId != null">
#{anchorId,jdbcType=VARCHAR},
</if>
<if test="actionType != null">
#{actionType,jdbcType=VARCHAR},
</if>
<if test="deviceType != null">
#{deviceType,jdbcType=VARCHAR},
</if>
<if test="ipAddress != null">
#{ipAddress,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclCustomerObjectShareTrack">
<!--@mbg.generated-->
update ag_acl_customer_object_share_track
<set>
<if test="shareId != null">
share_id = #{shareId,jdbcType=BIGINT},
</if>
<if test="shareCode != null">
share_code = #{shareCode,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
nickname = #{nickname,jdbcType=LONGVARCHAR},
</if>
<if test="gender != null">
gender = #{gender,jdbcType=INTEGER},
</if>
<if test="imagePath != null">
image_path = #{imagePath,jdbcType=LONGVARCHAR},
</if>
<if test="trackInTime != null">
track_in_time = #{trackInTime,jdbcType=TIMESTAMP},
</if>
<if test="trackOutTime != null">
track_out_time = #{trackOutTime,jdbcType=TIMESTAMP},
</if>
<if test="region != null">
region = #{region,jdbcType=VARCHAR},
</if>
<if test="sourceFrom != null">
source_from = #{sourceFrom,jdbcType=LONGVARCHAR},
</if>
<if test="entryPage != null">
entry_page = #{entryPage,jdbcType=LONGVARCHAR},
</if>
<if test="buttonId != null">
button_id = #{buttonId,jdbcType=VARCHAR},
</if>
<if test="anchorId != null">
anchor_id = #{anchorId,jdbcType=VARCHAR},
</if>
<if test="actionType != null">
action_type = #{actionType,jdbcType=VARCHAR},
</if>
<if test="deviceType != null">
device_type = #{deviceType,jdbcType=VARCHAR},
</if>
<if test="ipAddress != null">
ip_address = #{ipAddress,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclCustomerObjectShareTrack">
<!--@mbg.generated-->
update ag_acl_customer_object_share_track
set share_id = #{shareId,jdbcType=BIGINT},
share_code = #{shareCode,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=LONGVARCHAR},
gender = #{gender,jdbcType=INTEGER},
image_path = #{imagePath,jdbcType=LONGVARCHAR},
track_in_time = #{trackInTime,jdbcType=TIMESTAMP},
track_out_time = #{trackOutTime,jdbcType=TIMESTAMP},
region = #{region,jdbcType=VARCHAR},
source_from = #{sourceFrom,jdbcType=LONGVARCHAR},
entry_page = #{entryPage,jdbcType=LONGVARCHAR},
button_id = #{buttonId,jdbcType=VARCHAR},
anchor_id = #{anchorId,jdbcType=VARCHAR},
action_type = #{actionType,jdbcType=VARCHAR},
device_type = #{deviceType,jdbcType=VARCHAR},
ip_address = #{ipAddress,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</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.PractitionerArticleMapper">
<select id="articleTrackQuery" resultType="com.yd.dal.entity.practitioner.article.ArticleTrackQueryInfo">
SELECT ost.image_path imagePath,
ost.nickname nickName,
date_format(ost.track_in_time,'%Y-%m-%d %H:%i:%s') trackInTime,
ost.gender gender
FROM ag_acl_customer_object_share_track ost
WHERE share_id IN (SELECT os.id
FROM ag_acl_customer_object_share os
WHERE os.practitioner_id = #{practitionerId,jdbcType=BIGINT}
AND item_type = 1
AND item_id = #{sharingId,jdbcType=BIGINT})
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment