Commit bb366d4d by yao.xiao

增加-经纪人申请专家支持,发送邮件

parent b5d62d86
...@@ -160,6 +160,29 @@ ...@@ -160,6 +160,29 @@
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<!-- <version>1.5.3</version> -->
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dm</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -472,4 +472,18 @@ public class PractitionerController { ...@@ -472,4 +472,18 @@ public class PractitionerController {
result.addResult(responseVO); result.addResult(responseVO);
return result; return result;
} }
/**
* 申请专家支持
* @param requestVO 请求信息
* @return 返回信息
*/
@PostMapping(value = "/applyForExpertSupport")
public Object applyForExpertSupport(@RequestBody ApplyForExpertSupportRequestVO requestVO){
JsonResult result = new JsonResult();
ApplyForExpertSupportResponseVO responseVO = practitionerService.applyForExpertSupport(requestVO);
result.setData(responseVO);
result.addResult(responseVO);
return result;
}
} }
package com.yd.api.practitioner.service; package com.yd.api.practitioner.service;
import com.yd.api.practitioner.vo.opportunity.ApplyForExpertSupportRequestVO;
import com.yd.api.practitioner.vo.opportunity.ApplyForExpertSupportResponseVO;
import com.yd.api.practitioner.vo.payscale.PayScalePdfRequestVO; import com.yd.api.practitioner.vo.payscale.PayScalePdfRequestVO;
import com.yd.api.practitioner.vo.payscale.PayScalePdfResponseVO; import com.yd.api.practitioner.vo.payscale.PayScalePdfResponseVO;
import com.yd.api.practitioner.vo.payscale.PayScaleQueryRequestVO; import com.yd.api.practitioner.vo.payscale.PayScaleQueryRequestVO;
...@@ -39,4 +41,5 @@ public interface PractitionerBasicInfoService { ...@@ -39,4 +41,5 @@ public interface PractitionerBasicInfoService {
* @return 响应信息 * @return 响应信息
*/ */
PayScalePdfResponseVO payScalePdf(PayScalePdfRequestVO requestVO); PayScalePdfResponseVO payScalePdf(PayScalePdfRequestVO requestVO);
} }
...@@ -209,4 +209,11 @@ public interface PractitionerService { ...@@ -209,4 +209,11 @@ public interface PractitionerService {
* @return 响应数据 * @return 响应数据
*/ */
SalesScoreDetailQueryResponseVO salesScoreDetailQuery(SalesScoreDetailQueryRequestVO requestVO); SalesScoreDetailQueryResponseVO salesScoreDetailQuery(SalesScoreDetailQueryRequestVO requestVO);
/**
* 申请专家支持
* @param requestVO 请求信息
* @return 响应信息
*/
ApplyForExpertSupportResponseVO applyForExpertSupport(ApplyForExpertSupportRequestVO requestVO);
} }
package com.yd.api.practitioner.service.impl; package com.yd.api.practitioner.service.impl;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.yd.api.practitioner.vo.opportunity.ApplyForExpertSupportRequestVO;
import com.yd.api.practitioner.vo.opportunity.ApplyForExpertSupportResponseVO;
import com.yd.api.practitioner.vo.payscale.PayScalePdfRequestVO; import com.yd.api.practitioner.vo.payscale.PayScalePdfRequestVO;
import com.yd.api.practitioner.service.PractitionerBasicInfoService; import com.yd.api.practitioner.service.PractitionerBasicInfoService;
import com.yd.api.practitioner.vo.payscale.PayScaleInfo; import com.yd.api.practitioner.vo.payscale.PayScaleInfo;
......
...@@ -48,6 +48,7 @@ import com.yd.dal.service.user.AclUserDALService; ...@@ -48,6 +48,7 @@ import com.yd.dal.service.user.AclUserDALService;
import com.yd.dal.entity.customer.practitioner.*; import com.yd.dal.entity.customer.practitioner.*;
import com.yd.dal.service.meta.MdCodeDALService; import com.yd.dal.service.meta.MdCodeDALService;
import com.yd.dal.service.meta.MdDropOptionsDALService; import com.yd.dal.service.meta.MdDropOptionsDALService;
import com.yd.rmi.ali.mail.service.MailService;
import com.yd.rmi.ali.oss.service.OssService; import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.cache.SystemConfigService; import com.yd.rmi.cache.SystemConfigService;
import com.yd.rmi.tencent.wechat.service.WechatService; import com.yd.rmi.tencent.wechat.service.WechatService;
...@@ -151,6 +152,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -151,6 +152,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private MdGoalsCalculateExpressionDALService mdGoalsCalculateExpressionDALService; private MdGoalsCalculateExpressionDALService mdGoalsCalculateExpressionDALService;
@Autowired @Autowired
private AclPractitionerPotentialGoalsActionsDALService aclPractitionerPotentialGoalsActionsDALService; private AclPractitionerPotentialGoalsActionsDALService aclPractitionerPotentialGoalsActionsDALService;
@Autowired
private MktLeadsExpertRequestDALService mktLeadsExpertRequestDALService;
@Autowired
private MailService mailService;
@Override @Override
public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) { public PractitionerLoginResponseVO practitionerLogin(PractitionerLoginRequestVO requestVO) {
...@@ -2978,4 +2983,35 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2978,4 +2983,35 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
List<AclFileUpload> aclFileUploadList = aclFileUploadDALService.findByAclFileUpload(aclFileUpload); List<AclFileUpload> aclFileUploadList = aclFileUploadDALService.findByAclFileUpload(aclFileUpload);
return aclFileUploadList.size()+1; return aclFileUploadList.size()+1;
} }
@Override
public ApplyForExpertSupportResponseVO applyForExpertSupport(ApplyForExpertSupportRequestVO requestVO) {
ApplyForExpertSupportResponseVO resp = new ApplyForExpertSupportResponseVO();
//申请专家支持
//保存ag_mkt_leads_expert_request
MktLeadsExpertRequest mktLeadsExpertRequest = new MktLeadsExpertRequest();
mktLeadsExpertRequest.setLeadsAssignedId(requestVO.getLeadsAssignedId());
mktLeadsExpertRequest.setIsActive(1);
mktLeadsExpertRequest.setCreatedAt(new Date());
mktLeadsExpertRequest.setUpdatedAt(new Date());
mktLeadsExpertRequest.setCreatedBy(requestVO.getPractitionerId());
mktLeadsExpertRequest.setUpdatedBy(requestVO.getPractitionerId());
mktLeadsExpertRequestDALService.save(mktLeadsExpertRequest);
//发邮件
//发送邮件给客服,同步跟进
String toAddress = systemConfigService.getSingleConfigValue("CommentNotifyToAddress");
List<String> ccList = systemConfigService.getListConfigValue("CommentNotifyCCAddresses");
String[] ccAddresses = new String[ccList.size()];
ccList.toArray(ccAddresses);
String subject = "申请专家支持";
String messageText = "尊敬的管理员,您好!";
messageText += "申请专家支持";
mailService.sysNotify(toAddress,ccAddresses,subject,messageText);
resp.setCommonResult(new CommonResult(true,ZHBErrorConfig.getErrorInfo("800000")));
return resp;
}
} }
package com.yd.api.practitioner.vo.opportunity;
import lombok.Data;
@Data
public class ApplyForExpertSupportRequestVO {
/**
* 商机指派id
*/
private Long leadsAssignedId;
/**
* 申请经纪人id
*/
private Long practitionerId;
}
package com.yd.api.practitioner.vo.opportunity;
import com.yd.api.result.CommonResult;
import lombok.Data;
@Data
public class ApplyForExpertSupportResponseVO {
private CommonResult commonResult;
}
package com.yd.dal.entity.marketing;
import java.util.Date;
import lombok.Data;
/**
* 指派专家给经纪人辅助开发商机
*/
@Data
public class MktLeadsExpertAssign {
/**
* serial id
*/
private Long id;
/**
* FK ag_mkt_leads_expert_request.id 专家申请表id
*/
private Long leadsExpertRequestId;
/**
* 经纪人id(专家)
*/
private Long expertPractitionerId;
/**
* 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;
}
\ No newline at end of file
package com.yd.dal.entity.marketing;
import java.util.Date;
import lombok.Data;
/**
* 经纪人申请专家辅助开发商机
*/
@Data
public class MktLeadsExpertRequest {
/**
* serial id
*/
private Long id;
/**
* FK ag_mkt_leads_assigneds.id 商机指派表id
*/
private Long leadsAssignedId;
/**
* 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;
}
\ No newline at end of file
package com.yd.dal.mapper.marketing;
import com.yd.dal.entity.marketing.MktLeadsExpertAssign;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MktLeadsExpertAssignMapper {
int deleteByPrimaryKey(Long id);
int insert(MktLeadsExpertAssign record);
int insertSelective(MktLeadsExpertAssign record);
MktLeadsExpertAssign selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(MktLeadsExpertAssign record);
int updateByPrimaryKey(MktLeadsExpertAssign record);
int updateBatch(List<MktLeadsExpertAssign> list);
int updateBatchSelective(List<MktLeadsExpertAssign> list);
int batchInsert(@Param("list") List<MktLeadsExpertAssign> list);
}
\ No newline at end of file
package com.yd.dal.mapper.marketing;
import com.yd.dal.entity.marketing.MktLeadsExpertRequest;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MktLeadsExpertRequestMapper {
int deleteByPrimaryKey(Long id);
int insert(MktLeadsExpertRequest record);
int insertSelective(MktLeadsExpertRequest record);
MktLeadsExpertRequest selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(MktLeadsExpertRequest record);
int updateByPrimaryKey(MktLeadsExpertRequest record);
int updateBatch(List<MktLeadsExpertRequest> list);
int updateBatchSelective(List<MktLeadsExpertRequest> list);
int batchInsert(@Param("list") List<MktLeadsExpertRequest> list);
}
\ No newline at end of file
package com.yd.dal.service.marketing.Impl;
import com.yd.dal.entity.marketing.MktLeadsExpertRequest;
import com.yd.dal.mapper.marketing.MktLeadsExpertRequestMapper;
import com.yd.dal.service.marketing.MktLeadsExpertRequestDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service("mktLeadsExpertRequestDALService")
public class MktLeadsExpertRequestDALServiceImpl implements MktLeadsExpertRequestDALService {
@Resource
private MktLeadsExpertRequestMapper mktLeadsExpertRequestMapper;
@Override
public int save(MktLeadsExpertRequest mktLeadsExpertRequest) {
return mktLeadsExpertRequestMapper.insert(mktLeadsExpertRequest);
}
}
package com.yd.dal.service.marketing;
import com.yd.dal.entity.marketing.MktLeadsExpertRequest;
public interface MktLeadsExpertRequestDALService {
int save(MktLeadsExpertRequest mktLeadsExpertRequest);
}
package com.yd.rmi.ali.mail.service;
import com.yd.rmi.ali.mail.vo.SendMailRequestVO;
public interface MailService {
public void sendMail(SendMailRequestVO sendMailRequestVO);
public void sysWarning(String warningSubject,String warningMessage);
public void sysNotify(String toAddress,String[] ccAddress,String notifySubject,String notifyMessage);
public void sysException(String warningSubject,String warningMessage);
}
package com.yd.rmi.ali.mail.service.impl;
import com.yd.rmi.ali.mail.service.MailService;
import com.yd.rmi.ali.mail.vo.SendMailRequestVO;
import com.yd.rmi.ali.mailinterf.service.AliMailInterfService;
import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil;
import com.yd.util.SpringContextUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("mailService")
public class MailServiceImpl implements MailService {
@Autowired
private AliMailInterfService aliMailInterfService;
@Autowired
private SystemConfigService systemConfigService;
@Override
public void sendMail(SendMailRequestVO sendMailRequestVO) {
String sendType = sendMailRequestVO.getSendType();
String toAddress = sendMailRequestVO.getToAddress();
String[] ccAddresses = sendMailRequestVO.getCcAddresses();
String subject = sendMailRequestVO.getSubject();
String messageHtml = sendMailRequestVO.getMessageHtml();
String messageText = sendMailRequestVO.getMessageText();
String templateName = sendMailRequestVO.getTemplateName();
String receiversName = sendMailRequestVO.getReceiversName();
List<String> attachmentFiles = sendMailRequestVO.getAttachmentFiles();
String imageFile = sendMailRequestVO.getImageFile();
try {
if("1".equals(sendType)){
aliMailInterfService.singleSend(toAddress, subject, messageHtml, messageText);
}else if("2".equals(sendType)){
aliMailInterfService.batchSend(templateName, receiversName);
}else if("3".equals(sendType)){
aliMailInterfService.smtpSend(toAddress,ccAddresses, subject, messageText, attachmentFiles, imageFile);
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void sysWarning(String warningSubject,String warningMessage) {
String toAddress = "simon.cheng@ydinsurance.cn";
List<String> ccList = systemConfigService.getListConfigValue("SysWarningCCAddress");
String[] ccAddresses = new String[ccList.size()];
ccList.toArray(ccAddresses);
// String[] ccAddress = new String[]{"water.wang@autogeneral.cn","sweet.zhang@autogeneral.cn","jerold.chen@autogeneral.cn"};
String subject = "【"+ SpringContextUtil.getEnvironmentName()+"环境】"+warningSubject;
String messageText = CommonUtil.currentIP()+" "+warningMessage;
String imageFile = null;
try {
aliMailInterfService.smtpSend(toAddress, ccAddresses,subject, messageText, null, imageFile);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void sysNotify(String toAddress, String[] ccAddress, String notifySubject, String notifyMessage) {
try {
aliMailInterfService.smtpSend(toAddress, ccAddress, notifySubject, notifyMessage, null, null);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void sysException(String warningSubject, String warningMessage) {
// if("prod".equals(SpringContextUtil.getActiveProfile())){
String toAddress = "water.wang@ydinsurance.cn";//"simon.cheng@autogeneral.cn";
List<String> ccList = systemConfigService.getListConfigValue("SysWarningCCAddress");
String[] ccAddresses = new String[ccList.size()];
ccList.toArray(ccAddresses);
// String[] ccAddress = new String[]{"water.wang@autogeneral.cn","sweet.zhang@autogeneral.cn","jerold.chen@autogeneral.cn"};
String subject = "【"+SpringContextUtil.getEnvironmentName()+"环境】"+warningSubject;
String messageText = CommonUtil.currentIP()+" "+warningMessage;
String imageFile = null;
try {
aliMailInterfService.smtpSend(toAddress, ccAddresses,subject, messageText, null, imageFile);
} catch (Exception e) {
e.printStackTrace();
}
// }
}
}
package com.yd.rmi.ali.mail.vo;
import java.util.List;
public class SendMailRequestVO {
private String toAddress;//收件人邮箱
private String[] ccAddresses;//抄送人邮箱
private String subject;//邮件标题
private String messageText;//邮件TEXT正文
private String messageHtml;//邮件HTML正文
private List<String> attachmentFiles;//邮件附件
private String imageFile;//邮件图片
private String templateName;//模板名称,阿里云配置
private String receiversName;//收件人列表,阿里云配置
private String sendType;//发送类型: 1 single ; 2 batch ; 3 smpt
public String getToAddress() {
return toAddress;
}
public void setToAddress(String toAddress) {
this.toAddress = toAddress;
}
public String[] getCcAddresses() {
return ccAddresses;
}
public void setCcAddresses(String[] ccAddresses) {
this.ccAddresses = ccAddresses;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getMessageText() {
return messageText;
}
public void setMessageText(String messageText) {
this.messageText = messageText;
}
public String getMessageHtml() {
return messageHtml;
}
public void setMessageHtml(String messageHtml) {
this.messageHtml = messageHtml;
}
public String getImageFile() {
return imageFile;
}
public void setImageFile(String imageFile) {
this.imageFile = imageFile;
}
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public String getReceiversName() {
return receiversName;
}
public void setReceiversName(String receiversName) {
this.receiversName = receiversName;
}
public String getSendType() {
return sendType;
}
public void setSendType(String sendType) {
this.sendType = sendType;
}
public List<String> getAttachmentFiles() {
return attachmentFiles;
}
public void setAttachmentFiles(List<String> attachmentFiles) {
this.attachmentFiles = attachmentFiles;
}
}
\ No newline at end of file
package com.yd.rmi.ali.mailinterf.service;
import java.io.UnsupportedEncodingException;
import java.util.List;
public interface AliMailInterfService {
/**
* 单封邮件发送
* @param toAddress
* @param subject
* @param messageHtml
* @param messageText
*/
public void singleSend(String toAddress,
String subject,
String messageHtml,
String messageText);
/**
* 批量邮件发送
* @param templateName 邮件模板:"成功投保模板"
* @param receiversName 收件人列表:"测试控制台发邮件"
*/
public void batchSend(String templateName,String receiversName);
/**
* SMTP邮件发送
* @param toAddress 收件人地址
* @param ccAddresses 抄送人地址数组
* @param subject 邮件标题
* @param messageText 邮件正文文本
* @param attachmentFiles 附件路径
* @param imageFile 图片路径
*/
public void smtpSend(String toAddress,
String[] ccAddresses,
String subject,
String messageText,
List<String> attachmentFiles,
String imageFile) throws UnsupportedEncodingException, Exception;
}
<?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.marketing.MktLeadsExpertRequestMapper">
<resultMap id="BaseResultMap" type="com.yd.dal.entity.marketing.MktLeadsExpertRequest">
<!--@mbg.generated-->
<!--@Table ag_mkt_leads_expert_request-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="leads_assigned_id" jdbcType="BIGINT" property="leadsAssignedId" />
<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">
<!--@mbg.generated-->
id, leads_assigned_id, is_active, 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_mkt_leads_expert_request
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from ag_mkt_leads_expert_request
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.marketing.MktLeadsExpertRequest" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_mkt_leads_expert_request (leads_assigned_id, is_active, created_at,
created_by, updated_at, updated_by
)
values (#{leadsAssignedId,jdbcType=BIGINT}, #{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.marketing.MktLeadsExpertRequest" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_mkt_leads_expert_request
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="leadsAssignedId != null">
leads_assigned_id,
</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="leadsAssignedId != null">
#{leadsAssignedId,jdbcType=BIGINT},
</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.marketing.MktLeadsExpertRequest">
<!--@mbg.generated-->
update ag_mkt_leads_expert_request
<set>
<if test="leadsAssignedId != null">
leads_assigned_id = #{leadsAssignedId,jdbcType=BIGINT},
</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.marketing.MktLeadsExpertRequest">
<!--@mbg.generated-->
update ag_mkt_leads_expert_request
set leads_assigned_id = #{leadsAssignedId,jdbcType=BIGINT},
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>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update ag_mkt_leads_expert_request
<trim prefix="set" suffixOverrides=",">
<trim prefix="leads_assigned_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.leadsAssignedId,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="is_active = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.isActive,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="created_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="created_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="updated_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="updated_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=BIGINT}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update ag_mkt_leads_expert_request
<trim prefix="set" suffixOverrides=",">
<trim prefix="leads_assigned_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.leadsAssignedId != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.leadsAssignedId,jdbcType=BIGINT}
</if>
</foreach>
</trim>
<trim prefix="is_active = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.isActive != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.isActive,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="created_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createdAt != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="created_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createdBy != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
</if>
</foreach>
</trim>
<trim prefix="updated_at = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updatedAt != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="updated_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updatedBy != null">
when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=BIGINT}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_mkt_leads_expert_request
(leads_assigned_id, is_active, created_at, created_by, updated_at, updated_by)
values
<foreach collection="list" item="item" separator=",">
(#{item.leadsAssignedId,jdbcType=BIGINT}, #{item.isActive,jdbcType=INTEGER}, #{item.createdAt,jdbcType=TIMESTAMP},
#{item.createdBy,jdbcType=BIGINT}, #{item.updatedAt,jdbcType=TIMESTAMP}, #{item.updatedBy,jdbcType=BIGINT}
)
</foreach>
</insert>
</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