Commit d201f492 by yao.xiao

增加-团队长查询分数/预测销售额及保存目标区分团队,个人

parent 3e16d24c
......@@ -96,8 +96,8 @@ public class PractitionerController {
/**
* 微信-上传多媒体文件
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/mediaGet")
public Object mediaGet(@RequestBody MediaGetReqVO requestVO){
......@@ -110,8 +110,8 @@ public class PractitionerController {
/***
* 经纪人-经纪人查询自己的商机
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/ownOpportunityQuery")
public Object ownOpportunityQuery(@RequestBody OwnOpportunityQueryRequestVO requestVO){
......@@ -137,8 +137,8 @@ public class PractitionerController {
/***
* 经纪人-经纪人查询自己的商机详情查询
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/ownOpportunityDetailQuery")
public Object ownOpportunityDetailQuery(@RequestBody OwnOpportunityDetailQueryRequestVO requestVO){
......@@ -192,8 +192,8 @@ public class PractitionerController {
/**
* 经纪人-修改商机基本信息
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/ownOpportunityBasicInformationSave")
public Object ownOpportunityBasicInformationSave(@RequestBody OwnOpportunityBasicInformationSaveRequestVO requestVO){
......@@ -206,8 +206,8 @@ public class PractitionerController {
/**
* 经纪人-保存商机跟进,修改商机基本信息
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/ownOpportunityRecordSave")
public Object ownOpportunityRecordSave(@RequestBody OwnOpportunityRecordSaveRequestVO requestVO){
......@@ -220,8 +220,8 @@ public class PractitionerController {
/**
* 经纪人-ydLife查询此经纪人总分数 按年月周日 分别统计 新增商机个数 达成率
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/opportunityStatistics")
public Object OpportunityStatistics(@RequestBody OpportunityStatisticsRequestVO requestVO){
......@@ -234,8 +234,8 @@ public class PractitionerController {
/**
* 经纪人-保存销售目标
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/salesTargetSave")
public Object salesTargetSave(@RequestBody SalesTargetSaveRequestVO requestVO){
......@@ -248,8 +248,8 @@ public class PractitionerController {
/**
* 经纪人-查询销售目标
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/salesTargetQuery")
public Object salesTargetQuery(@RequestBody SalesTargetQueryRequestVO requestVO){
......@@ -262,8 +262,8 @@ public class PractitionerController {
/**
* 经纪人-保存月均目标
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/salesTargetMonthSave")
public Object salesTargetMonthSave(@RequestBody SalesTargetMonthSaveRequestVO requestVO){
......@@ -276,8 +276,8 @@ public class PractitionerController {
/**
* 团队长-查看组员得分均值
* @param requestVO
* @return
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping("/teamActionsAverageQuery")
public Object teamActionsAverageQuery(@RequestBody TeamActionsAverageQueryRequestVO requestVO){
......
......@@ -7,5 +7,9 @@ import java.util.List;
@Data
public class SalesTargetMonthSaveRequestVO {
private Long practitionerId;
/**
* 目标类型:1:经纪人指标,2:团队指标
*/
private Integer goalsType;
private List<SalesTargetActions> salesTargetActionsList;
}
......@@ -5,4 +5,5 @@ import lombok.Data;
@Data
public class SalesTargetQueryRequestVO {
private Long practitionerId;
private Integer goalsType;
}
......@@ -22,5 +22,9 @@ public class SalesTargetSaveRequestVO {
* 均价
*/
private Integer pieceAveragePremium;
/**
* 目标类型:1:经纪人指标,2:团队指标
*/
private Integer goalsType;
private List<SalesTargetMonth> salesTargetMonths;
}
......@@ -6,8 +6,57 @@ import lombok.Data;
@Data
public class TeamActionsAverageQueryResponseVO {
/**
* 天均分
*/
private Double scoreDayAverage;
/**
* 天均分
*/
private Double scoreWeekAverage;
/**
* 月均分
*/
private Double scoreMonthAverage;
/**
* 本周新增商机
*/
private Integer opportunitiesNum;
/**
* 月平均保费
*/
private Double premiumMonthAverage;
/**
* 月平均佣金
*/
private Double commissionMonthAverage;
/**
* 月平均件数
*/
private Double piecesMonthAverage;
/**
* 季度平均保费
*/
private Double premiumQuarterAverage;
/**
* 季度平均佣金
*/
private Double commissionQuarterAverage;
/**
* 季度平均件数
*/
private Double piecesQuarterAverage;
/**
* 年平均保费
*/
private Double premiumYearAverage;
/**
* 年平均佣金
*/
private Double commissionYearAverage;
/**
* 年平均件数
*/
private Double piecesYearAverage;
private CommonResult commonResult;
}
......@@ -4,7 +4,7 @@ import java.util.Date;
import lombok.Data;
/**
* 经纪人商机目标设定
* 经纪人(或团队长)商机目标设定
*/
@Data
public class MktLeadsGoals {
......@@ -14,11 +14,26 @@ public class MktLeadsGoals {
private Long id;
/**
* FK ag_acl_practitioner.id 经纪人
* 目标类型:1:经纪人指标,2:团队指标
*/
private Integer goalsType;
/**
* FK ag_acl_practitioner.id 经纪人(或团队长)
*/
private Long practitionerId;
/**
* FK ag_acl_practitioner_subordinate_system.id 团队ID
*/
private Long subordinateSystemId;
/**
* FK ag_acl_practitioner_subordinate_system.name 团队Name
*/
private String subordinateSystemName;
/**
* 目标所属年度
*/
private Integer currentYear;
......
......@@ -4,7 +4,7 @@ import java.util.Date;
import lombok.Data;
/**
* 经纪人商机活动量分摊细化设置
* 经纪人(或团队长)商机活动量分摊细化设置
*/
@Data
public class MktLeadsGoalsActions {
......@@ -14,7 +14,12 @@ public class MktLeadsGoalsActions {
private Long id;
/**
* FK ag_acl_practitioner.id 经纪人
* 目标类型:1:经纪人指标,2:团队指标
*/
private Integer goalsType;
/**
* FK ag_acl_practitioner.id 经纪人(或团队长)
*/
private Long practitionerId;
......
......@@ -17,4 +17,6 @@ public interface AclPractitionerSubordinateSystemMapper {
int updateByPrimaryKey(AclPractitionerSubordinateSystem record);
PractitionerSubordinateInfo findSubordinateInfo(Long subordinateId);
AclPractitionerSubordinateSystem findByPractitionerId(Long practitionerId);
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package com.yd.dal.mapper.marketing;
import com.github.pagehelper.Page;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
public interface MktLeadsAssignedTrackMapper {
......@@ -22,5 +24,5 @@ public interface MktLeadsAssignedTrackMapper {
List<MktLeadsAssignedTrack> findByTrackTimeForNew(MktLeadsAssignedTrack mktLeadsAssignedTrack);
List<Integer> totalStatisticsForTeam(List<Long> practitionerIds);
HashMap<String, BigDecimal> totalStatisticsForTeam(List<Long> practitionerIds);
}
\ No newline at end of file
package com.yd.dal.mapper.marketing;
import com.yd.dal.entity.marketing.MktLeadsAssigneds;import java.util.List;
import com.yd.dal.entity.marketing.MktLeadsAssigneds;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
public interface MktLeadsAssignedsMapper {
int deleteByPrimaryKey(Long id);
......@@ -18,4 +23,8 @@ public interface MktLeadsAssignedsMapper {
List<MktLeadsAssigneds> findByMktLeadsAssigneds(MktLeadsAssigneds mktLeadsAssigneds);
List<MktLeadsAssigneds> findByPractitionerIdAndThisWeek(Long practitionerId);
Integer countPractitionerIdsAndThisWeek(List<Long> practitionerIds);
HashMap<String, BigDecimal> performanceForecastForTeam(@Param("practitionerIds") List<Long> practitionerIds,@Param("refusedId") Long refusedId);
}
\ No newline at end of file
package com.yd.dal.mapper.marketing;
import com.yd.dal.entity.marketing.MktLeadsGoalsActions;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import com.yd.dal.entity.marketing.MktLeadsGoalsActions;import org.apache.ibatis.annotations.Param;import java.util.List;
public interface MktLeadsGoalsActionsMapper {
int deleteByPrimaryKey(Long id);
......@@ -18,7 +15,7 @@ public interface MktLeadsGoalsActionsMapper {
int updateByPrimaryKey(MktLeadsGoalsActions record);
void updateIsActiveIsNull(@Param("practitionerId") Long practitionerId,@Param("year") Integer year);
void updateIsActiveIsNull(@Param("practitionerId") Long practitionerId, @Param("year") Integer year, @Param("goalsType") Integer goalsType);
List<MktLeadsGoalsActions> findByMktLeadsGoalsActions(MktLeadsGoalsActions mktLeadsGoalsActions);
}
\ No newline at end of file
package com.yd.dal.mapper.marketing;
import com.yd.dal.entity.marketing.MktLeadsGoals;import org.apache.ibatis.annotations.Param;
import java.util.List;
import com.yd.dal.entity.marketing.MktLeadsGoals;import org.apache.ibatis.annotations.Param;import java.util.List;
public interface MktLeadsGoalsMapper {
int deleteByPrimaryKey(Long id);
......@@ -17,7 +15,7 @@ public interface MktLeadsGoalsMapper {
int updateByPrimaryKey(MktLeadsGoals record);
void updateIsActiveIsNull(@Param("practitionerId") Long practitionerId, @Param("year") Integer year);
void updateIsActiveIsNull(@Param("practitionerId") Long practitionerId, @Param("year") Integer year, @Param("goalsType") Integer goalsType);
List<MktLeadsGoals> selectByMktLeadsGoals(MktLeadsGoals mktLeadsGoals);
}
\ No newline at end of file
package com.yd.dal.service.customer;
import com.yd.dal.entity.customer.AclPractitionerSubordinateSystem;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
import org.springframework.stereotype.Service;
@Service("aclPractitionerSubordinateSystemDALService")
public interface AclPractitionerSubordinateSystemDALService {
PractitionerSubordinateInfo findSubordinateInfo(Long subordinateId);
AclPractitionerSubordinateSystem findByPractitionerId(Long practitionerId);
}
package com.yd.dal.service.customer.impl;
import com.yd.dal.entity.customer.AclPractitionerSubordinateSystem;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
import com.yd.dal.mapper.customer.AclPractitionerSubordinateSystemMapper;
import com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService;
......@@ -24,4 +25,9 @@ public class AclPractitionerSubordinateSystemDALServiceImpl implements AclPracti
}
return subordinateInfo;
}
@Override
public AclPractitionerSubordinateSystem findByPractitionerId(Long practitionerId) {
return aclPractitionerSubordinateSystemMapper.findByPractitionerId(practitionerId);
}
}
......@@ -8,6 +8,8 @@ import com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
@Service("mktLeadsAssignedTrackDALService")
......@@ -39,7 +41,7 @@ public class MktLeadsAssignedTrackDALServiceImpl implements MktLeadsAssignedTrac
}
@Override
public List<Integer> totalStatisticsForTeam(List<Long> practitionerIds) {
public HashMap<String, BigDecimal> totalStatisticsForTeam(List<Long> practitionerIds) {
return mktLeadsAssignedTrackMapper.totalStatisticsForTeam(practitionerIds);
}
}
......@@ -6,6 +6,8 @@ import com.yd.dal.service.marketing.MktLeadsAssignedsDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
@Service("mktLeadsAssignedsDALService")
......@@ -37,4 +39,14 @@ public class MktLeadsAssignedsDALServiceImpl implements MktLeadsAssignedsDALServ
public List<MktLeadsAssigneds> findByPractitionerIdAndThisWeek(Long practitionerId) {
return mktLeadsAssignedsMapper.findByPractitionerIdAndThisWeek(practitionerId);
}
@Override
public Integer countPractitionerIdsAndThisWeek(List<Long> practitionerIds) {
return mktLeadsAssignedsMapper.countPractitionerIdsAndThisWeek(practitionerIds);
}
@Override
public HashMap<String, BigDecimal> performanceForecastForTeam(List<Long> practitionerIds,Long refusedId) {
return mktLeadsAssignedsMapper.performanceForecastForTeam(practitionerIds,refusedId);
}
}
......@@ -20,8 +20,8 @@ public class MktLeadsGoalsActionsDALServiceImpl implements MktLeadsGoalsActionsD
}
@Override
public void updateIsActiveIsNull(Long practitionerId, int year) {
mktLeadsGoalsActionsMapper.updateIsActiveIsNull(practitionerId, year);
public void updateIsActiveIsNull(Long practitionerId, int year,Integer goalsType) {
mktLeadsGoalsActionsMapper.updateIsActiveIsNull(practitionerId, year,goalsType);
}
@Override
......
......@@ -6,6 +6,8 @@ import com.yd.dal.service.marketing.MktLeadsGoalsDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
@Service("mktLeadsGoalsDALService")
......@@ -20,12 +22,13 @@ public class MktLeadsGoalsDALServiceImpl implements MktLeadsGoalsDALService {
}
@Override
public void updateIsActiveIsNull(Long practitionerId, Integer year) {
mktLeadsGoalsMapper.updateIsActiveIsNull(practitionerId, year) ;
public void updateIsActiveIsNull(Long practitionerId, Integer year,Integer goalsType) {
mktLeadsGoalsMapper.updateIsActiveIsNull(practitionerId, year,goalsType) ;
}
@Override
public List<MktLeadsGoals> findByMktLeadsGoals(MktLeadsGoals mktLeadsGoals) {
return mktLeadsGoalsMapper.selectByMktLeadsGoals(mktLeadsGoals);
}
}
......@@ -2,6 +2,8 @@ package com.yd.dal.service.marketing;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
public interface MktLeadsAssignedTrackDALService {
......@@ -13,5 +15,10 @@ public interface MktLeadsAssignedTrackDALService {
List<MktLeadsAssignedTrack> findByTrackTimeForNew(MktLeadsAssignedTrack mktLeadsAssignedTrack);
List<Integer> totalStatisticsForTeam(List<Long> practitionerIds);
/**
* 计算经纪人得分统计
* @param practitionerIds 经纪人id的list
* @return 返回他们的分数统计 1.天得分 2.周得分 3.月得分
*/
HashMap<String, BigDecimal> totalStatisticsForTeam(List<Long> practitionerIds);
}
......@@ -2,6 +2,8 @@ package com.yd.dal.service.marketing;
import com.yd.dal.entity.marketing.MktLeadsAssigneds;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
public interface MktLeadsAssignedsDALService {
......@@ -14,4 +16,15 @@ public interface MktLeadsAssignedsDALService {
void save(MktLeadsAssigneds assigneds);
List<MktLeadsAssigneds> findByPractitionerIdAndThisWeek(Long practitionerId);
/**
* 统计这些经纪人id本周一共新增多少商机
*/
Integer countPractitionerIdsAndThisWeek(List<Long> practitionerIds);
/**
* 计算年/季/月 首年保费(premium)/佣金(commission)/件数(pieces) 均取至指派表ag_mkt_leads_assigneds
* ag_mkt_leads_assigned_track跟进记录不可有"拒绝" md_drop_option_id = 102 (传入)
*/
HashMap<String, BigDecimal> performanceForecastForTeam(List<Long> practitionerIds,Long refusedId);
}
......@@ -7,7 +7,7 @@ import java.util.List;
public interface MktLeadsGoalsActionsDALService {
void save(MktLeadsGoalsActions mktLeadsGoalsActions);
void updateIsActiveIsNull(Long practitionerId, int year);
void updateIsActiveIsNull(Long practitionerId, int year,Integer goalsType);
List<MktLeadsGoalsActions> findByMktLeadsGoalsActions(MktLeadsGoalsActions mktLeadsGoalsActions);
}
......@@ -2,12 +2,15 @@ package com.yd.dal.service.marketing;
import com.yd.dal.entity.marketing.MktLeadsGoals;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
public interface MktLeadsGoalsDALService {
void saveMktLeadsGoals(MktLeadsGoals mktLeadsGoals);
void updateIsActiveIsNull(Long practitionerId, Integer year);
void updateIsActiveIsNull(Long practitionerId, Integer year,Integer goalsType);
List<MktLeadsGoals> findByMktLeadsGoals(MktLeadsGoals mktLeadsGoals);
}
......@@ -242,4 +242,10 @@
and s.id = #{subordinateId}
</select>
<select id="findByPractitionerId" resultMap="BaseResultMap">
select s.*
from ag_acl_practitioner_subordinate_system s
left join ag_acl_practitioner p on p.subordinate_system_id = s.id
where p.id = #{practitionerId,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
......@@ -323,30 +323,13 @@
</if>
</where>
</select>
<select id="totalStatisticsForTeam" resultType="integer">
SELECT sum(track_score) as scoreToday
FROM ag_mkt_leads_assigned_track
where is_active = 1
and to_days(track_time) = to_days(now())
and practitioner_id in
<foreach collection="list" item="practitionerId" index="index" open="(" close=")" separator=",">
#{practitionerId,jdbcType=BIGINT}
</foreach>
UNION all
SELECT sum(track_score) as scoreWeek
FROM ag_mkt_leads_assigned_track
where is_active = 1
and YEARWEEK(date_format(track_time,'%Y-%m-%d')) = YEARWEEK(now())
and practitioner_id in
<foreach collection="list" item="practitionerId" index="index" open="(" close=")" separator=",">
#{practitionerId,jdbcType=BIGINT}
</foreach>
UNION all
SELECT sum(track_score) as scoreMonth
FROM ag_mkt_leads_assigned_track
where is_active = 1
and date_format(track_time,'%Y-%m')=date_format(now(),'%Y-%m')
and practitioner_id in
<select id="totalStatisticsForTeam" resultType="hashmap">
select sum(case when to_days(track_time) = to_days(now()) then track_score end) scoreToday,
sum(case when YEARWEEK(date_format(track_time,'%Y-%m-%d')) = YEARWEEK(now()) then track_score end) scoreWeek,
sum(case when date_format(track_time,'%Y-%m')=date_format(now(),'%Y-%m') then track_score end) scoreMonth
from ag_mkt_leads_assigned_track
where is_active = 1
and practitioner_id in
<foreach collection="list" item="practitionerId" index="index" open="(" close=")" separator=",">
#{practitionerId,jdbcType=BIGINT}
</foreach>
......
......@@ -243,4 +243,40 @@
assigned_practitioner_id = #{practitionerId,jdbcType=BIGINT}
and YEARWEEK(date_format(created_at,'%Y-%m-%d')) = YEARWEEK(now())
</select>
<select id="countPractitionerIdsAndThisWeek" resultType="integer">
select
count(*)
from ag_mkt_leads_assigneds
where
assigned_practitioner_id in
<foreach collection="list" item="practitionerId" index="index" open="(" close=")" separator=",">
#{practitionerId,jdbcType=BIGINT}
</foreach>
and YEARWEEK(date_format(created_at,'%Y-%m-%d')) = YEARWEEK(now())
</select>
<select id="performanceForecastForTeam" resultType="hashmap">
select sum(case when date_format(time_to_close,'%Y-%m')=date_format(now(),'%Y-%m') then FYC end) totalFYCMonth,
sum(case when date_format(time_to_close,'%Y-%m')=date_format(now(),'%Y-%m') then FYP end) totalFYPMonth,
sum(case when date_format(time_to_close,'%Y-%m')=date_format(now(),'%Y-%m') then pieces end) totalPiecesMonth,
sum(case when QUARTER(time_to_close)=QUARTER(now()) then FYC end) totalFYCQuarter,
sum(case when QUARTER(time_to_close)=QUARTER(now()) then FYP end) totalFYPQuarter,
sum(case when QUARTER(time_to_close)=QUARTER(now()) then pieces end) totalPiecesQuarter,
sum(case when YEAR(time_to_close)=YEAR(NOW()) then FYC end) totalFYCYear,
sum(case when YEAR(time_to_close)=YEAR(NOW()) then FYP end) totalFYPYear,
sum(case when YEAR(time_to_close)=YEAR(NOW()) then pieces end) totalPiecesYear
from ag_mkt_leads_assigneds a
where a.is_active=1
and a.assigned_practitioner_id in
<foreach collection="practitionerIds" item="practitionerId" index="index" open="(" close=")" separator=",">
#{practitionerId,jdbcType=BIGINT}
</foreach>
and not EXISTS (select t.leads_assigned_id
from ag_mkt_leads_assigned_track t
where t.md_drop_option_id = #{refusedId,jdbcType=BIGINT}
and t.practitioner_id in
<foreach collection="practitionerIds" item="practitionerId" index="index" open="(" close=")" separator=",">
#{practitionerId,jdbcType=BIGINT}
</foreach>
and a.id = t.leads_assigned_id)
</select>
</mapper>
\ No newline at end of file
......@@ -5,6 +5,7 @@
<!--@mbg.generated-->
<!--@Table ag_mkt_leads_goals_actions-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="goals_type" jdbcType="INTEGER" property="goalsType" />
<result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="current_year" jdbcType="INTEGER" property="currentYear" />
<result column="statistic_time_unit" jdbcType="INTEGER" property="statisticTimeUnit" />
......@@ -20,9 +21,9 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, practitioner_id, current_year, statistic_time_unit, leads_action_id, leads_action_name,
action_standards, current_version, is_active, created_at, created_by, updated_at,
updated_by
id, goals_type, practitioner_id, current_year, statistic_time_unit, leads_action_id,
leads_action_name, action_standards, current_version, is_active, created_at, created_by,
updated_at, updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
......@@ -38,21 +39,24 @@
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.marketing.MktLeadsGoalsActions" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_mkt_leads_goals_actions (practitioner_id, current_year, statistic_time_unit,
leads_action_id, leads_action_name, action_standards,
current_version, is_active, created_at,
created_by, updated_at, updated_by
)
values (#{practitionerId,jdbcType=BIGINT}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER},
#{leadsActionId,jdbcType=BIGINT}, #{leadsActionName,jdbcType=VARCHAR}, #{actionStandards,jdbcType=INTEGER},
#{currentVersion,jdbcType=TIMESTAMP}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}
)
insert into ag_mkt_leads_goals_actions (goals_type, practitioner_id, current_year,
statistic_time_unit, leads_action_id, leads_action_name,
action_standards, current_version, is_active,
created_at, created_by, updated_at,
updated_by)
values (#{goalsType,jdbcType=INTEGER}, #{practitionerId,jdbcType=BIGINT}, #{currentYear,jdbcType=INTEGER},
#{statisticTimeUnit,jdbcType=INTEGER}, #{leadsActionId,jdbcType=BIGINT}, #{leadsActionName,jdbcType=VARCHAR},
#{actionStandards,jdbcType=INTEGER}, #{currentVersion,jdbcType=TIMESTAMP}, #{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.MktLeadsGoalsActions" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_mkt_leads_goals_actions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="goalsType != null">
goals_type,
</if>
<if test="practitionerId != null">
practitioner_id,
</if>
......@@ -91,6 +95,9 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="goalsType != null">
#{goalsType,jdbcType=INTEGER},
</if>
<if test="practitionerId != null">
#{practitionerId,jdbcType=BIGINT},
</if>
......@@ -133,6 +140,9 @@
<!--@mbg.generated-->
update ag_mkt_leads_goals_actions
<set>
<if test="goalsType != null">
goals_type = #{goalsType,jdbcType=INTEGER},
</if>
<if test="practitionerId != null">
practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if>
......@@ -175,7 +185,8 @@
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.marketing.MktLeadsGoalsActions">
<!--@mbg.generated-->
update ag_mkt_leads_goals_actions
set practitioner_id = #{practitionerId,jdbcType=BIGINT},
set goals_type = #{goalsType,jdbcType=INTEGER},
practitioner_id = #{practitionerId,jdbcType=BIGINT},
current_year = #{currentYear,jdbcType=INTEGER},
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
leads_action_id = #{leadsActionId,jdbcType=BIGINT},
......@@ -196,6 +207,7 @@
where
practitioner_id = #{practitionerId,jdbcType=BIGINT}
and current_year = #{year,jdbcType=INTEGER}
and goals_type = #{goalsType,jdbcType=INTEGER}
and is_active =1;
</update>
<select id="findByMktLeadsGoalsActions" resultMap="BaseResultMap">
......
......@@ -5,7 +5,10 @@
<!--@mbg.generated-->
<!--@Table ag_mkt_leads_goals-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="goals_type" jdbcType="INTEGER" property="goalsType" />
<result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="subordinate_system_id" jdbcType="BIGINT" property="subordinateSystemId" />
<result column="subordinate_system_name" jdbcType="VARCHAR" property="subordinateSystemName" />
<result column="current_year" jdbcType="INTEGER" property="currentYear" />
<result column="statistic_time_unit" jdbcType="INTEGER" property="statisticTimeUnit" />
<result column="seq_time" jdbcType="INTEGER" property="seqTime" />
......@@ -22,9 +25,9 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, practitioner_id, current_year, statistic_time_unit, seq_time, premium, commission,
pieces, piece_average_premium, current_version, is_active, created_at, created_by,
updated_at, updated_by
id, goals_type, practitioner_id, subordinate_system_id, subordinate_system_name,
current_year, statistic_time_unit, seq_time, premium, commission, pieces, piece_average_premium,
current_version, is_active, created_at, created_by, updated_at, updated_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
......@@ -40,12 +43,14 @@
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.marketing.MktLeadsGoals" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into ag_mkt_leads_goals (practitioner_id, current_year, statistic_time_unit,
insert into ag_mkt_leads_goals (goals_type, practitioner_id, subordinate_system_id,
subordinate_system_name, current_year, statistic_time_unit,
seq_time, premium, commission,
pieces, piece_average_premium, current_version,
is_active, created_at, created_by,
updated_at, updated_by)
values (#{practitionerId,jdbcType=BIGINT}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER},
values (#{goalsType,jdbcType=INTEGER}, #{practitionerId,jdbcType=BIGINT}, #{subordinateSystemId,jdbcType=BIGINT},
#{subordinateSystemName,jdbcType=VARCHAR}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER},
#{seqTime,jdbcType=INTEGER}, #{premium,jdbcType=INTEGER}, #{commission,jdbcType=INTEGER},
#{pieces,jdbcType=INTEGER}, #{pieceAveragePremium,jdbcType=INTEGER}, #{currentVersion,jdbcType=TIMESTAMP},
#{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT},
......@@ -55,9 +60,18 @@
<!--@mbg.generated-->
insert into ag_mkt_leads_goals
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="goalsType != null">
goals_type,
</if>
<if test="practitionerId != null">
practitioner_id,
</if>
<if test="subordinateSystemId != null">
subordinate_system_id,
</if>
<if test="subordinateSystemName != null">
subordinate_system_name,
</if>
<if test="currentYear != null">
current_year,
</if>
......@@ -99,9 +113,18 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="goalsType != null">
#{goalsType,jdbcType=INTEGER},
</if>
<if test="practitionerId != null">
#{practitionerId,jdbcType=BIGINT},
</if>
<if test="subordinateSystemId != null">
#{subordinateSystemId,jdbcType=BIGINT},
</if>
<if test="subordinateSystemName != null">
#{subordinateSystemName,jdbcType=VARCHAR},
</if>
<if test="currentYear != null">
#{currentYear,jdbcType=INTEGER},
</if>
......@@ -147,9 +170,18 @@
<!--@mbg.generated-->
update ag_mkt_leads_goals
<set>
<if test="goalsType != null">
goals_type = #{goalsType,jdbcType=INTEGER},
</if>
<if test="practitionerId != null">
practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if>
<if test="subordinateSystemId != null">
subordinate_system_id = #{subordinateSystemId,jdbcType=BIGINT},
</if>
<if test="subordinateSystemName != null">
subordinate_system_name = #{subordinateSystemName,jdbcType=VARCHAR},
</if>
<if test="currentYear != null">
current_year = #{currentYear,jdbcType=INTEGER},
</if>
......@@ -195,7 +227,10 @@
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.marketing.MktLeadsGoals">
<!--@mbg.generated-->
update ag_mkt_leads_goals
set practitioner_id = #{practitionerId,jdbcType=BIGINT},
set goals_type = #{goalsType,jdbcType=INTEGER},
practitioner_id = #{practitionerId,jdbcType=BIGINT},
subordinate_system_id = #{subordinateSystemId,jdbcType=BIGINT},
subordinate_system_name = #{subordinateSystemName,jdbcType=VARCHAR},
current_year = #{currentYear,jdbcType=INTEGER},
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
seq_time = #{seqTime,jdbcType=INTEGER},
......@@ -216,6 +251,7 @@
SET is_active = 0
WHERE practitioner_id = #{practitionerId,jdbcType=BIGINT}
AND current_year = #{year,jdbcType=INTEGER}
and goals_type = #{goalsType,jdbcType=INTEGER}
AND is_active = 1;
</update>
<select id="selectByMktLeadsGoals" resultMap="BaseResultMap">
......
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