Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
b3d10881
Commit
b3d10881
authored
May 07, 2020
by
yao.xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加-经纪人查询商机详情
parent
d124ac74
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
876 additions
and
6 deletions
+876
-6
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
+89
-6
yd-api/src/main/java/com/yd/dal/entity/customer/AclCustomerMembership.java
+79
-0
yd-api/src/main/java/com/yd/dal/entity/survey/SurveyCustomerAnswers.java
+78
-0
yd-api/src/main/java/com/yd/dal/mapper/customer/AclCustomerMembershipMapper.java
+22
-0
yd-api/src/main/java/com/yd/dal/mapper/survey/SurveyCustomerAnswersMapper.java
+23
-0
yd-api/src/main/java/com/yd/dal/service/customer/AclCustomerMembershipDALService.java
+7
-0
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclCustomerMembershipDALServiceImpl.java
+27
-0
yd-api/src/main/java/com/yd/dal/service/order/Impl/PoOrderDALServiceImpl.java
+5
-0
yd-api/src/main/java/com/yd/dal/service/order/PoOrderDALService.java
+2
-0
yd-api/src/main/java/com/yd/dal/service/survey/SurveyCustomerAnswersDALService.java
+9
-0
yd-api/src/main/java/com/yd/dal/service/survey/SurveyCustomerAnswersDALServiceImpl.java
+19
-0
yd-api/src/main/resources/mapper/customer/AclCustomerMembershipMapper.xml
+258
-0
yd-api/src/main/resources/mapper/survey/SurveyCustomerAnswersMapper.xml
+258
-0
No files found.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
View file @
b3d10881
...
@@ -21,10 +21,8 @@ import com.yd.dal.entity.meta.ObjectCollectionTagged;
...
@@ -21,10 +21,8 @@ import com.yd.dal.entity.meta.ObjectCollectionTagged;
import
com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo
;
import
com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo
;
import
com.yd.dal.entity.order.PoOrder
;
import
com.yd.dal.entity.order.PoOrder
;
import
com.yd.dal.entity.practitioner.*
;
import
com.yd.dal.entity.practitioner.*
;
import
com.yd.dal.service.customer.AclCustomerDALService
;
import
com.yd.dal.entity.survey.SurveyCustomerAnswers
;
import
com.yd.dal.service.customer.AclCustomerLogDALService
;
import
com.yd.dal.service.customer.*
;
import
com.yd.dal.service.customer.AclCustomerShareDALService
;
import
com.yd.dal.service.customer.AclFileUploadDALService
;
import
com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService
;
import
com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService
;
import
com.yd.dal.service.marketing.MktLeadsAssignedsDALService
;
import
com.yd.dal.service.marketing.MktLeadsAssignedsDALService
;
import
com.yd.dal.service.meta.MdCodeDALService
;
import
com.yd.dal.service.meta.MdCodeDALService
;
...
@@ -34,6 +32,7 @@ import com.yd.dal.service.meta.ObjectCollectionTaggedDALService;
...
@@ -34,6 +32,7 @@ import com.yd.dal.service.meta.ObjectCollectionTaggedDALService;
import
com.yd.dal.service.order.PoOrderDALService
;
import
com.yd.dal.service.order.PoOrderDALService
;
import
com.yd.dal.service.practitioner.PractitionerDALService
;
import
com.yd.dal.service.practitioner.PractitionerDALService
;
import
com.yd.dal.service.practitioner.PractitionerSubordinateDALService
;
import
com.yd.dal.service.practitioner.PractitionerSubordinateDALService
;
import
com.yd.dal.service.survey.SurveyCustomerAnswersDALService
;
import
com.yd.rmi.ali.oss.service.OssService
;
import
com.yd.rmi.ali.oss.service.OssService
;
import
com.yd.rmi.tencent.wechat.service.WechatService
;
import
com.yd.rmi.tencent.wechat.service.WechatService
;
import
com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest
;
import
com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest
;
...
@@ -93,6 +92,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -93,6 +92,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private
MktLeadsAssignedTrackDALService
mktLeadsAssignedTrackDALService
;
private
MktLeadsAssignedTrackDALService
mktLeadsAssignedTrackDALService
;
@Autowired
@Autowired
private
MdTagDALService
mdTagDALService
;
private
MdTagDALService
mdTagDALService
;
@Autowired
private
AclCustomerMembershipDALService
aclCustomerMembershipDALService
;
@Autowired
private
SurveyCustomerAnswersDALService
surveyCustomerAnswersDALService
;
@Override
@Override
public
PractitionerLoginResponseVO
practitionerLogin
(
PractitionerLoginRequestVO
requestVO
)
{
public
PractitionerLoginResponseVO
practitionerLogin
(
PractitionerLoginRequestVO
requestVO
)
{
PractitionerLoginResponseVO
responseVO
=
new
PractitionerLoginResponseVO
();
PractitionerLoginResponseVO
responseVO
=
new
PractitionerLoginResponseVO
();
...
@@ -473,6 +476,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -473,6 +476,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return
responseVO
;
return
responseVO
;
}
}
/**
* 商机客户基本信息
* @param requestVO
* @return
*/
private
OpportunityBasicInformationInfo
getOpportunityBasicInformation
(
OwnOpportunityDetailQueryRequestVO
requestVO
)
{
private
OpportunityBasicInformationInfo
getOpportunityBasicInformation
(
OwnOpportunityDetailQueryRequestVO
requestVO
)
{
OpportunityBasicInformationInfo
info
=
new
OpportunityBasicInformationInfo
();
OpportunityBasicInformationInfo
info
=
new
OpportunityBasicInformationInfo
();
Long
customerId
=
requestVO
.
getOpportunityId
();
Long
customerId
=
requestVO
.
getOpportunityId
();
...
@@ -511,6 +519,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -511,6 +519,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return
info
;
return
info
;
}
}
/**
* 客户标签查询
* @param customerId
* @return
*/
private
List
<
OpportunityCustomerTag
>
OpportunityCustomerTags
(
Long
customerId
)
{
private
List
<
OpportunityCustomerTag
>
OpportunityCustomerTags
(
Long
customerId
)
{
List
<
OpportunityCustomerTag
>
tags
=
new
ArrayList
<>();
List
<
OpportunityCustomerTag
>
tags
=
new
ArrayList
<>();
ObjectCollectionTagged
objectCollectionTagged
=
new
ObjectCollectionTagged
();
ObjectCollectionTagged
objectCollectionTagged
=
new
ObjectCollectionTagged
();
...
@@ -534,12 +547,82 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -534,12 +547,82 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return
tags
;
return
tags
;
}
}
/**
* 调查问卷答案,咨询服务
* @param requestVO
* @return
*/
private
OpportunityConsultationInfo
getOpportunityConsultation
(
OwnOpportunityDetailQueryRequestVO
requestVO
)
{
private
OpportunityConsultationInfo
getOpportunityConsultation
(
OwnOpportunityDetailQueryRequestVO
requestVO
)
{
return
null
;
OpportunityConsultationInfo
info
=
new
OpportunityConsultationInfo
();
Long
orderId
=
requestVO
.
getOrderId
();
if
(
CommonUtil
.
isNullOrZero
(
orderId
)){
return
info
;
}
info
.
setOrderId
(
orderId
);
PoOrder
poOrder
=
poOrderDALService
.
findByOrderId
(
requestVO
.
getOrderId
());
Long
planId
=
poOrder
.
getPlanId
();
if
(
planId
==
453L
||
planId
==
464L
)
{
info
.
setIsCompletedQuestionnaire
(
3L
);
}
else
{
AclCustomerMembership
membership
=
aclCustomerMembershipDALService
.
findByOrderId
(
requestVO
.
getOrderId
());
info
.
setIsCompletedQuestionnaire
(
(
membership
.
getApproveDate
()
!=
null
)
?
3L
:
1L
);
}
info
.
setOpportunitySurveyAnswersList
(
findSurveyAnswers
(
requestVO
));
return
info
;
}
/**
* 问卷答案
* @param requestVO
* @return
*/
private
List
<
OpportunitySurveyAnswers
>
findSurveyAnswers
(
OwnOpportunityDetailQueryRequestVO
requestVO
)
{
Long
customerId
=
requestVO
.
getOpportunityId
();
Long
orderId
=
requestVO
.
getOrderId
();
SurveyCustomerAnswers
surveyCustomerAnswersQuery
=
new
SurveyCustomerAnswers
();
surveyCustomerAnswersQuery
.
setOrderId
(
orderId
);
surveyCustomerAnswersQuery
.
setCustomerId
(
customerId
);
List
<
SurveyCustomerAnswers
>
surveyCustomerAnswersList
=
surveyCustomerAnswersDALService
.
findByObjGroupByOrderBy
(
surveyCustomerAnswersQuery
,
null
,
null
);
List
<
SurveyCustomerAnswers
>
surveyQuestionsList
=
surveyCustomerAnswersDALService
.
findByObjGroupByOrderBy
(
surveyCustomerAnswersQuery
,
"question_name"
,
"id"
);
List
<
OpportunitySurveyAnswers
>
req
=
new
ArrayList
<>();
for
(
SurveyCustomerAnswers
surveyQuestions
:
surveyQuestionsList
)
{
String
questionName
=
surveyQuestions
.
getQuestionName
();
BeanPropertyValueEqualsPredicate
predicateClause
=
new
BeanPropertyValueEqualsPredicate
(
"questionName"
,
questionName
);
List
<
SurveyCustomerAnswers
>
mainRisks
=
(
List
<
SurveyCustomerAnswers
>)
CollectionUtils
.
select
(
surveyCustomerAnswersList
,
predicateClause
);
OpportunitySurveyAnswers
surveyAnswers
=
new
OpportunitySurveyAnswers
();
surveyAnswers
.
setQuestionName
(
surveyQuestions
.
getQuestionName
());
List
<
String
>
optionNameList
=
new
ArrayList
<>();
for
(
SurveyCustomerAnswers
surveyCustomerAnswers
:
mainRisks
)
{
if
(
surveyCustomerAnswers
.
getOptionName
()
!=
null
)
{
optionNameList
.
add
(
surveyCustomerAnswers
.
getOptionName
());
}
if
(
surveyCustomerAnswers
.
getCustomerInput
()
!=
null
){
optionNameList
.
add
(
surveyCustomerAnswers
.
getCustomerInput
());
}
}
surveyAnswers
.
setOptionName
(
optionNameList
);
req
.
add
(
surveyAnswers
);
}
return
req
;
}
}
private
List
<
OpportunityRecordInfo
>
getOpportunityRecords
(
OwnOpportunityDetailQueryRequestVO
requestVO
)
{
private
List
<
OpportunityRecordInfo
>
getOpportunityRecords
(
OwnOpportunityDetailQueryRequestVO
requestVO
)
{
return
null
;
Long
practitionerId
=
requestVO
.
getPractitionerId
();
Long
customerId
=
requestVO
.
getOpportunityId
();
List
<
OpportunityRecordInfo
>
infos
=
new
ArrayList
<>();
MktLeadsAssignedTrack
mktLeadsAssignedTrack
=
new
MktLeadsAssignedTrack
();
mktLeadsAssignedTrack
.
setPractitionerId
(
practitionerId
);
mktLeadsAssignedTrack
.
setCustomerId
(
customerId
);
PageHelper
.
orderBy
(
"created_at DESC , updated_at DESC"
);
List
<
MktLeadsAssignedTrack
>
mktLeadsAssignedTracks
=
mktLeadsAssignedTrackDALService
.
findByMktLeadsAssignedTrack
(
mktLeadsAssignedTrack
);
for
(
MktLeadsAssignedTrack
track:
mktLeadsAssignedTracks
)
{
OpportunityRecordInfo
info
=
new
OpportunityRecordInfo
();
CommonUtil
.
simpleObjectCopy
(
track
,
info
);
info
.
setOpportunityId
(
track
.
getCustomerId
());
info
.
setNoticeDate
(
CommonUtil
.
dateParseString
(
track
.
getCreatedAt
(),
"yyyy-MM-dd"
));
infos
.
add
(
info
);
}
return
infos
;
}
}
private
CommonResult
paramCheck
(
SettingSaveRequestVO
requestVO
)
{
private
CommonResult
paramCheck
(
SettingSaveRequestVO
requestVO
)
{
...
...
yd-api/src/main/java/com/yd/dal/entity/customer/AclCustomerMembership.java
0 → 100644
View file @
b3d10881
package
com
.
yd
.
dal
.
entity
.
customer
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
lombok.Data
;
/**
* ag_acl_customer_membership
* @author
*/
@Data
public
class
AclCustomerMembership
implements
Serializable
{
/**
* serial id
*/
private
Long
id
;
/**
* FK ag_acl_customer.id
*/
private
Long
customerId
;
/**
* 购买客户姓名
*/
private
String
customerName
;
/**
* FK ag_md_member_voucher.id
*/
private
Long
voucherId
;
/**
* 购买或兑换时间
*/
private
Date
purchaseDate
;
/**
* 推送方案给enduser的时间
*/
private
Date
approveDate
;
/**
* 购买金额
*/
private
BigDecimal
purchaseAmount
;
/**
* 会员资格有效起日
*/
private
Date
validFrom
;
/**
* 会员资格有效终日
*/
private
Date
validTo
;
/**
* 0=No 1=Yes
*/
private
Integer
isActive
;
private
Date
createdAt
;
private
Long
createdBy
;
/**
* FK ag_po_order.id
*/
private
Long
orderId
;
private
Integer
customerLevel
;
private
Long
planId
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/entity/survey/SurveyCustomerAnswers.java
0 → 100644
View file @
b3d10881
package
com
.
yd
.
dal
.
entity
.
survey
;
import
java.util.Date
;
import
lombok.Data
;
/**
* 用户提交的答卷
*/
@Data
public
class
SurveyCustomerAnswers
{
private
Long
id
;
/**
* FK ag_acl_customer.id,收集用户手机注册用户
*/
private
Long
customerId
;
/**
* ag_survey_pages.id
*/
private
Long
pageId
;
/**
* FK ag_po_order.id,调查问卷跟着49块钱的订单走,一单至多一个问卷
*/
private
Long
orderId
;
/**
* ag_survey_questions.id
*/
private
Long
questionId
;
/**
* 选项FK ag_survey_questions.question_name,孩子可能有多个孩子年龄2,孩子年龄3
*/
private
String
questionName
;
/**
* 选项FK ag_survey_options.option_name
*/
private
String
optionName
;
/**
* 用户选择的选项ID,FK ag_survey_options.id
*/
private
Long
optionIdSelected
;
/**
* 档ag_survey_question.option_type为3,4用户输入时
*/
private
String
customerInput
;
/**
* 0=No, 1=Yes
*/
private
Integer
isActive
;
/**
* 创建时间
*/
private
Date
createdAt
;
/**
* 创建人
*/
private
Long
createdBy
;
/**
* 修改时间
*/
private
Date
updatedAt
;
/**
* 修改人
*/
private
Long
updatedBy
;
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/mapper/customer/AclCustomerMembershipMapper.java
0 → 100644
View file @
b3d10881
package
com
.
yd
.
dal
.
mapper
.
customer
;
import
com.yd.dal.entity.customer.AclCustomerMembership
;
import
java.util.List
;
public
interface
AclCustomerMembershipMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
AclCustomerMembership
record
);
int
insertSelective
(
AclCustomerMembership
record
);
AclCustomerMembership
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
AclCustomerMembership
record
);
int
updateByPrimaryKey
(
AclCustomerMembership
record
);
List
<
AclCustomerMembership
>
selectByCustomerMembership
(
AclCustomerMembership
aclCustomerMembership
);
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/mapper/survey/SurveyCustomerAnswersMapper.java
0 → 100644
View file @
b3d10881
package
com
.
yd
.
dal
.
mapper
.
survey
;
import
com.yd.dal.entity.survey.SurveyCustomerAnswers
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
SurveyCustomerAnswersMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
SurveyCustomerAnswers
record
);
int
insertSelective
(
SurveyCustomerAnswers
record
);
SurveyCustomerAnswers
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
SurveyCustomerAnswers
record
);
int
updateByPrimaryKey
(
SurveyCustomerAnswers
record
);
List
<
SurveyCustomerAnswers
>
findByObjGroupByOrderBy
(
@Param
(
"info"
)
SurveyCustomerAnswers
surveyCustomerAnswersQuery
,
@Param
(
"groupBy"
)
String
groupBy
,
@Param
(
"orderBy"
)
String
orderBy
);
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/service/customer/AclCustomerMembershipDALService.java
0 → 100644
View file @
b3d10881
package
com
.
yd
.
dal
.
service
.
customer
;
import
com.yd.dal.entity.customer.AclCustomerMembership
;
public
interface
AclCustomerMembershipDALService
{
AclCustomerMembership
findByOrderId
(
Long
orderId
);
}
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclCustomerMembershipDALServiceImpl.java
0 → 100644
View file @
b3d10881
package
com
.
yd
.
dal
.
service
.
customer
.
impl
;
import
com.yd.dal.entity.customer.AclCustomerMembership
;
import
com.yd.dal.mapper.customer.AclCustomerMembershipMapper
;
import
com.yd.dal.service.customer.AclCustomerMembershipDALService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
(
"aclCustomerMembershipDALService"
)
public
class
AclCustomerMembershipDALServiceImpl
implements
AclCustomerMembershipDALService
{
@Resource
private
AclCustomerMembershipMapper
aclCustomerMembershipMapper
;
@Override
public
AclCustomerMembership
findByOrderId
(
Long
orderId
)
{
AclCustomerMembership
aclCustomerMembership
=
new
AclCustomerMembership
();
aclCustomerMembership
.
setOrderId
(
orderId
);
List
<
AclCustomerMembership
>
list
=
aclCustomerMembershipMapper
.
selectByCustomerMembership
(
aclCustomerMembership
);
if
(
list
.
isEmpty
()){
return
aclCustomerMembership
;
}
else
{
return
list
.
get
(
0
);
}
}
}
yd-api/src/main/java/com/yd/dal/service/order/Impl/PoOrderDALServiceImpl.java
View file @
b3d10881
...
@@ -17,4 +17,9 @@ public class PoOrderDALServiceImpl implements PoOrderDALService {
...
@@ -17,4 +17,9 @@ public class PoOrderDALServiceImpl implements PoOrderDALService {
public
List
<
PoOrder
>
findByStatusAndShareCodeInGroupByCustomerId
(
int
status
,
List
<
String
>
customerShareCodes
)
{
public
List
<
PoOrder
>
findByStatusAndShareCodeInGroupByCustomerId
(
int
status
,
List
<
String
>
customerShareCodes
)
{
return
poOrderMapper
.
findByStatusAndShareCodeInGroupByCustomerId
(
status
,
customerShareCodes
);
return
poOrderMapper
.
findByStatusAndShareCodeInGroupByCustomerId
(
status
,
customerShareCodes
);
}
}
@Override
public
PoOrder
findByOrderId
(
Long
orderId
)
{
return
poOrderMapper
.
selectByPrimaryKey
(
orderId
);
}
}
}
yd-api/src/main/java/com/yd/dal/service/order/PoOrderDALService.java
View file @
b3d10881
...
@@ -6,4 +6,6 @@ import java.util.List;
...
@@ -6,4 +6,6 @@ import java.util.List;
public
interface
PoOrderDALService
{
public
interface
PoOrderDALService
{
List
<
PoOrder
>
findByStatusAndShareCodeInGroupByCustomerId
(
int
status
,
List
<
String
>
customerShareCodes
);
List
<
PoOrder
>
findByStatusAndShareCodeInGroupByCustomerId
(
int
status
,
List
<
String
>
customerShareCodes
);
PoOrder
findByOrderId
(
Long
orderId
);
}
}
yd-api/src/main/java/com/yd/dal/service/survey/SurveyCustomerAnswersDALService.java
0 → 100644
View file @
b3d10881
package
com
.
yd
.
dal
.
service
.
survey
;
import
com.yd.dal.entity.survey.SurveyCustomerAnswers
;
import
java.util.List
;
public
interface
SurveyCustomerAnswersDALService
{
List
<
SurveyCustomerAnswers
>
findByObjGroupByOrderBy
(
SurveyCustomerAnswers
surveyCustomerAnswersQuery
,
String
groupBy
,
String
orderBy
);
}
yd-api/src/main/java/com/yd/dal/service/survey/SurveyCustomerAnswersDALServiceImpl.java
0 → 100644
View file @
b3d10881
package
com
.
yd
.
dal
.
service
.
survey
;
import
com.yd.dal.entity.survey.SurveyCustomerAnswers
;
import
com.yd.dal.mapper.survey.SurveyCustomerAnswersMapper
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
(
"surveyCustomerAnswersDALService"
)
public
class
SurveyCustomerAnswersDALServiceImpl
implements
SurveyCustomerAnswersDALService
{
@Resource
private
SurveyCustomerAnswersMapper
surveyCustomerAnswersMapper
;
@Override
public
List
<
SurveyCustomerAnswers
>
findByObjGroupByOrderBy
(
SurveyCustomerAnswers
surveyCustomerAnswersQuery
,
String
groupBy
,
String
orderBy
)
{
return
surveyCustomerAnswersMapper
.
findByObjGroupByOrderBy
(
surveyCustomerAnswersQuery
,
groupBy
,
orderBy
);
}
}
yd-api/src/main/resources/mapper/customer/AclCustomerMembershipMapper.xml
0 → 100644
View file @
b3d10881
<?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.AclCustomerMembershipMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yd.dal.entity.customer.AclCustomerMembership"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"customer_id"
jdbcType=
"BIGINT"
property=
"customerId"
/>
<result
column=
"customer_name"
jdbcType=
"VARCHAR"
property=
"customerName"
/>
<result
column=
"voucher_id"
jdbcType=
"BIGINT"
property=
"voucherId"
/>
<result
column=
"purchase_date"
jdbcType=
"TIMESTAMP"
property=
"purchaseDate"
/>
<result
column=
"approve_date"
jdbcType=
"TIMESTAMP"
property=
"approveDate"
/>
<result
column=
"purchase_amount"
jdbcType=
"DECIMAL"
property=
"purchaseAmount"
/>
<result
column=
"valid_from"
jdbcType=
"DATE"
property=
"validFrom"
/>
<result
column=
"valid_to"
jdbcType=
"DATE"
property=
"validTo"
/>
<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=
"order_id"
jdbcType=
"BIGINT"
property=
"orderId"
/>
<result
column=
"customer_level"
jdbcType=
"INTEGER"
property=
"customerLevel"
/>
<result
column=
"plan_id"
jdbcType=
"BIGINT"
property=
"planId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, customer_id, customer_name, voucher_id, purchase_date, approve_date, purchase_amount,
valid_from, valid_to, is_active, created_at, created_by, order_id, customer_level,
plan_id
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_acl_customer_membership
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from ag_acl_customer_membership
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.customer.AclCustomerMembership"
useGeneratedKeys=
"true"
>
insert into ag_acl_customer_membership (customer_id, customer_name, voucher_id,
purchase_date, approve_date, purchase_amount,
valid_from, valid_to, is_active,
created_at, created_by, order_id,
customer_level, plan_id)
values (#{customerId,jdbcType=BIGINT}, #{customerName,jdbcType=VARCHAR}, #{voucherId,jdbcType=BIGINT},
#{purchaseDate,jdbcType=TIMESTAMP}, #{approveDate,jdbcType=TIMESTAMP}, #{purchaseAmount,jdbcType=DECIMAL},
#{validFrom,jdbcType=DATE}, #{validTo,jdbcType=DATE}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT},
#{customerLevel,jdbcType=INTEGER}, #{planId,jdbcType=BIGINT})
</insert>
<insert
id=
"insertSelective"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.customer.AclCustomerMembership"
useGeneratedKeys=
"true"
>
insert into ag_acl_customer_membership
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"customerId != null"
>
customer_id,
</if>
<if
test=
"customerName != null"
>
customer_name,
</if>
<if
test=
"voucherId != null"
>
voucher_id,
</if>
<if
test=
"purchaseDate != null"
>
purchase_date,
</if>
<if
test=
"approveDate != null"
>
approve_date,
</if>
<if
test=
"purchaseAmount != null"
>
purchase_amount,
</if>
<if
test=
"validFrom != null"
>
valid_from,
</if>
<if
test=
"validTo != null"
>
valid_to,
</if>
<if
test=
"isActive != null"
>
is_active,
</if>
<if
test=
"createdAt != null"
>
created_at,
</if>
<if
test=
"createdBy != null"
>
created_by,
</if>
<if
test=
"orderId != null"
>
order_id,
</if>
<if
test=
"customerLevel != null"
>
customer_level,
</if>
<if
test=
"planId != null"
>
plan_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"customerId != null"
>
#{customerId,jdbcType=BIGINT},
</if>
<if
test=
"customerName != null"
>
#{customerName,jdbcType=VARCHAR},
</if>
<if
test=
"voucherId != null"
>
#{voucherId,jdbcType=BIGINT},
</if>
<if
test=
"purchaseDate != null"
>
#{purchaseDate,jdbcType=TIMESTAMP},
</if>
<if
test=
"approveDate != null"
>
#{approveDate,jdbcType=TIMESTAMP},
</if>
<if
test=
"purchaseAmount != null"
>
#{purchaseAmount,jdbcType=DECIMAL},
</if>
<if
test=
"validFrom != null"
>
#{validFrom,jdbcType=DATE},
</if>
<if
test=
"validTo != null"
>
#{validTo,jdbcType=DATE},
</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=
"orderId != null"
>
#{orderId,jdbcType=BIGINT},
</if>
<if
test=
"customerLevel != null"
>
#{customerLevel,jdbcType=INTEGER},
</if>
<if
test=
"planId != null"
>
#{planId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.yd.dal.entity.customer.AclCustomerMembership"
>
update ag_acl_customer_membership
<set>
<if
test=
"customerId != null"
>
customer_id = #{customerId,jdbcType=BIGINT},
</if>
<if
test=
"customerName != null"
>
customer_name = #{customerName,jdbcType=VARCHAR},
</if>
<if
test=
"voucherId != null"
>
voucher_id = #{voucherId,jdbcType=BIGINT},
</if>
<if
test=
"purchaseDate != null"
>
purchase_date = #{purchaseDate,jdbcType=TIMESTAMP},
</if>
<if
test=
"approveDate != null"
>
approve_date = #{approveDate,jdbcType=TIMESTAMP},
</if>
<if
test=
"purchaseAmount != null"
>
purchase_amount = #{purchaseAmount,jdbcType=DECIMAL},
</if>
<if
test=
"validFrom != null"
>
valid_from = #{validFrom,jdbcType=DATE},
</if>
<if
test=
"validTo != null"
>
valid_to = #{validTo,jdbcType=DATE},
</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=
"orderId != null"
>
order_id = #{orderId,jdbcType=BIGINT},
</if>
<if
test=
"customerLevel != null"
>
customer_level = #{customerLevel,jdbcType=INTEGER},
</if>
<if
test=
"planId != null"
>
plan_id = #{planId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.yd.dal.entity.customer.AclCustomerMembership"
>
update ag_acl_customer_membership
set customer_id = #{customerId,jdbcType=BIGINT},
customer_name = #{customerName,jdbcType=VARCHAR},
voucher_id = #{voucherId,jdbcType=BIGINT},
purchase_date = #{purchaseDate,jdbcType=TIMESTAMP},
approve_date = #{approveDate,jdbcType=TIMESTAMP},
purchase_amount = #{purchaseAmount,jdbcType=DECIMAL},
valid_from = #{validFrom,jdbcType=DATE},
valid_to = #{validTo,jdbcType=DATE},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
order_id = #{orderId,jdbcType=BIGINT},
customer_level = #{customerLevel,jdbcType=INTEGER},
plan_id = #{planId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"selectByCustomerMembership"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_acl_customer_membership
<where>
<if
test=
"id != null"
>
id = #{id,jdbcType=BIGINT}
</if>
<if
test=
"customerId != null"
>
and customer_id = #{customerId,jdbcType=BIGINT}
</if>
<if
test=
"customerName != null"
>
and customer_name = #{customerName,jdbcType=VARCHAR}
</if>
<if
test=
"voucherId != null"
>
and voucher_id = #{voucherId,jdbcType=BIGINT}
</if>
<if
test=
"purchaseDate != null"
>
and purchase_date = #{purchaseDate,jdbcType=TIMESTAMP}
</if>
<if
test=
"approveDate != null"
>
and approve_date = #{approveDate,jdbcType=TIMESTAMP}
</if>
<if
test=
"purchaseAmount != null"
>
and purchase_amount = #{purchaseAmount,jdbcType=DECIMAL}
</if>
<if
test=
"validFrom != null"
>
and valid_from = #{validFrom,jdbcType=DATE}
</if>
<if
test=
"validTo != null"
>
and valid_to = #{validTo,jdbcType=DATE}
</if>
<if
test=
"isActive != null"
>
and is_active = #{isActive,jdbcType=INTEGER}
</if>
<if
test=
"createdAt != null"
>
and created_at = #{createdAt,jdbcType=TIMESTAMP}
</if>
<if
test=
"createdBy != null"
>
and created_by = #{createdBy,jdbcType=BIGINT}
</if>
<if
test=
"orderId != null"
>
and order_id = #{orderId,jdbcType=BIGINT}
</if>
<if
test=
"customerLevel != null"
>
and customer_level = #{customerLevel,jdbcType=INTEGER}
</if>
<if
test=
"planId != null"
>
and plan_id = #{planId,jdbcType=BIGINT}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
yd-api/src/main/resources/mapper/survey/SurveyCustomerAnswersMapper.xml
0 → 100644
View file @
b3d10881
<?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.survey.SurveyCustomerAnswersMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yd.dal.entity.survey.SurveyCustomerAnswers"
>
<!--@mbg.generated-->
<!--@Table ag_survey_customer_answers-->
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"customer_id"
jdbcType=
"BIGINT"
property=
"customerId"
/>
<result
column=
"page_id"
jdbcType=
"BIGINT"
property=
"pageId"
/>
<result
column=
"order_id"
jdbcType=
"BIGINT"
property=
"orderId"
/>
<result
column=
"question_id"
jdbcType=
"BIGINT"
property=
"questionId"
/>
<result
column=
"question_name"
jdbcType=
"VARCHAR"
property=
"questionName"
/>
<result
column=
"option_name"
jdbcType=
"VARCHAR"
property=
"optionName"
/>
<result
column=
"option_id_selected"
jdbcType=
"BIGINT"
property=
"optionIdSelected"
/>
<result
column=
"customer_input"
jdbcType=
"VARCHAR"
property=
"customerInput"
/>
<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, customer_id, page_id, order_id, question_id, question_name, option_name, option_id_selected,
customer_input, 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_survey_customer_answers
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
<!--@mbg.generated-->
delete from ag_survey_customer_answers
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.survey.SurveyCustomerAnswers"
useGeneratedKeys=
"true"
>
<!--@mbg.generated-->
insert into ag_survey_customer_answers (customer_id, page_id, order_id,
question_id, question_name, option_name,
option_id_selected, customer_input, is_active,
created_at, created_by, updated_at,
updated_by)
values (#{customerId,jdbcType=BIGINT}, #{pageId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT},
#{questionId,jdbcType=BIGINT}, #{questionName,jdbcType=VARCHAR}, #{optionName,jdbcType=VARCHAR},
#{optionIdSelected,jdbcType=BIGINT}, #{customerInput,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.survey.SurveyCustomerAnswers"
useGeneratedKeys=
"true"
>
<!--@mbg.generated-->
insert into ag_survey_customer_answers
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"customerId != null"
>
customer_id,
</if>
<if
test=
"pageId != null"
>
page_id,
</if>
<if
test=
"orderId != null"
>
order_id,
</if>
<if
test=
"questionId != null"
>
question_id,
</if>
<if
test=
"questionName != null"
>
question_name,
</if>
<if
test=
"optionName != null"
>
option_name,
</if>
<if
test=
"optionIdSelected != null"
>
option_id_selected,
</if>
<if
test=
"customerInput != null"
>
customer_input,
</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=
"customerId != null"
>
#{customerId,jdbcType=BIGINT},
</if>
<if
test=
"pageId != null"
>
#{pageId,jdbcType=BIGINT},
</if>
<if
test=
"orderId != null"
>
#{orderId,jdbcType=BIGINT},
</if>
<if
test=
"questionId != null"
>
#{questionId,jdbcType=BIGINT},
</if>
<if
test=
"questionName != null"
>
#{questionName,jdbcType=VARCHAR},
</if>
<if
test=
"optionName != null"
>
#{optionName,jdbcType=VARCHAR},
</if>
<if
test=
"optionIdSelected != null"
>
#{optionIdSelected,jdbcType=BIGINT},
</if>
<if
test=
"customerInput != null"
>
#{customerInput,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.survey.SurveyCustomerAnswers"
>
<!--@mbg.generated-->
update ag_survey_customer_answers
<set>
<if
test=
"customerId != null"
>
customer_id = #{customerId,jdbcType=BIGINT},
</if>
<if
test=
"pageId != null"
>
page_id = #{pageId,jdbcType=BIGINT},
</if>
<if
test=
"orderId != null"
>
order_id = #{orderId,jdbcType=BIGINT},
</if>
<if
test=
"questionId != null"
>
question_id = #{questionId,jdbcType=BIGINT},
</if>
<if
test=
"questionName != null"
>
question_name = #{questionName,jdbcType=VARCHAR},
</if>
<if
test=
"optionName != null"
>
option_name = #{optionName,jdbcType=VARCHAR},
</if>
<if
test=
"optionIdSelected != null"
>
option_id_selected = #{optionIdSelected,jdbcType=BIGINT},
</if>
<if
test=
"customerInput != null"
>
customer_input = #{customerInput,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.survey.SurveyCustomerAnswers"
>
<!--@mbg.generated-->
update ag_survey_customer_answers
set customer_id = #{customerId,jdbcType=BIGINT},
page_id = #{pageId,jdbcType=BIGINT},
order_id = #{orderId,jdbcType=BIGINT},
question_id = #{questionId,jdbcType=BIGINT},
question_name = #{questionName,jdbcType=VARCHAR},
option_name = #{optionName,jdbcType=VARCHAR},
option_id_selected = #{optionIdSelected,jdbcType=BIGINT},
customer_input = #{customerInput,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>
<select
id=
"findByObjGroupByOrderBy"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_survey_customer_answers
<where>
<if
test=
"info.id != null"
>
id = #{info.id,jdbcType=BIGINT}
</if>
<if
test=
"info.customerId != null"
>
and customer_id = #{info.customerId,jdbcType=BIGINT}
</if>
<if
test=
"info.pageId != null"
>
and page_id = #{info.pageId,jdbcType=BIGINT}
</if>
<if
test=
"info.orderId != null"
>
and order_id = #{info.orderId,jdbcType=BIGINT}
</if>
<if
test=
"info.questionId != null"
>
and question_id = #{info.questionId,jdbcType=BIGINT}
</if>
<if
test=
"info.questionName != null"
>
and question_name = #{info.questionName,jdbcType=VARCHAR}
</if>
<if
test=
"info.optionName != null"
>
and option_name = #{info.optionName,jdbcType=VARCHAR}
</if>
<if
test=
"info.optionIdSelected != null"
>
and option_id_selected = #{info.optionIdSelected,jdbcType=BIGINT}
</if>
<if
test=
"info.customerInput != null"
>
and customer_input = #{info.customerInput,jdbcType=VARCHAR}
</if>
<if
test=
"info.isActive != null"
>
and is_active = #{info.isActive,jdbcType=INTEGER}
</if>
<if
test=
"info.createdAt != null"
>
and created_at = #{info.createdAt,jdbcType=TIMESTAMP}
</if>
<if
test=
"info.createdBy != null"
>
and created_by = #{info.createdBy,jdbcType=BIGINT}
</if>
<if
test=
"info.updatedAt != null"
>
and updated_at = #{info.updatedAt,jdbcType=TIMESTAMP}
</if>
<if
test=
"info.updatedBy != null"
>
and updated_by = #{info.updatedBy,jdbcType=BIGINT}
</if>
</where>
<if
test=
"groupBy != null"
>
GROUP BY ${groupBy}
</if>
<if
test=
"orderBy != null"
>
ORDER BY ${orderBy}
</if>
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment