Commit 51d92659 by yao.xiao

增加-经纪人商机目标设置

parent a69ffa0b
...@@ -9,8 +9,7 @@ import com.yd.api.practitioner.vo.opportunity.*; ...@@ -9,8 +9,7 @@ import com.yd.api.practitioner.vo.opportunity.*;
import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO; import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO; import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO;
import com.yd.api.practitioner.vo.recruit.*; import com.yd.api.practitioner.vo.recruit.*;
import com.yd.api.practitioner.vo.salestarget.SalesTargetSaveRequestVO; import com.yd.api.practitioner.vo.salestarget.*;
import com.yd.api.practitioner.vo.salestarget.SalesTargetSaveResponseVO;
import com.yd.api.practitioner.vo.setting.*; import com.yd.api.practitioner.vo.setting.*;
import com.yd.api.result.JsonResult; import com.yd.api.result.JsonResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -233,4 +232,28 @@ public class PractitionerController { ...@@ -233,4 +232,28 @@ public class PractitionerController {
result.setData(responseVO); result.setData(responseVO);
return result; return result;
} }
/**
* 查询销售目标
*/
@RequestMapping("/salesTargetQuery")
public Object salesTargetQuery(@RequestBody SalesTargetQueryRequestVO requestVO){
JsonResult result = new JsonResult();
SalesTargetQueryResponseVO responseVO = practitionerService.salesTargetQuery(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
/**
* 保存月均目标
*/
@RequestMapping("/salesTargetMonthSave")
public Object salesTargetMonthSave(@RequestBody SalesTargetMonthSaveRequestVO requestVO){
JsonResult result = new JsonResult();
SalesTargetMonthSaveResponseVO responseVO = practitionerService.salesTargetMonthSave(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
} }
...@@ -8,8 +8,7 @@ import com.yd.api.practitioner.vo.opportunity.*; ...@@ -8,8 +8,7 @@ import com.yd.api.practitioner.vo.opportunity.*;
import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO; import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO; import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO;
import com.yd.api.practitioner.vo.recruit.*; import com.yd.api.practitioner.vo.recruit.*;
import com.yd.api.practitioner.vo.salestarget.SalesTargetSaveRequestVO; import com.yd.api.practitioner.vo.salestarget.*;
import com.yd.api.practitioner.vo.salestarget.SalesTargetSaveResponseVO;
import com.yd.api.practitioner.vo.setting.*; import com.yd.api.practitioner.vo.setting.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -125,4 +124,18 @@ public interface PractitionerService { ...@@ -125,4 +124,18 @@ public interface PractitionerService {
* @return * @return
*/ */
SalesTargetSaveResponseVO salesTargetSave(SalesTargetSaveRequestVO requestVO); SalesTargetSaveResponseVO salesTargetSave(SalesTargetSaveRequestVO requestVO);
/**
* 查询销售目标
* @param requestVO
* @return
*/
SalesTargetQueryResponseVO salesTargetQuery(SalesTargetQueryRequestVO requestVO);
/**
* 保存月均目标
* @param requestVO
* @return
*/
SalesTargetMonthSaveResponseVO salesTargetMonthSave(SalesTargetMonthSaveRequestVO requestVO);
} }
...@@ -15,10 +15,7 @@ import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO; ...@@ -15,10 +15,7 @@ import com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO;
import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO; import com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO;
import com.yd.api.practitioner.vo.rank.PractitionerInfoForAchievement; import com.yd.api.practitioner.vo.rank.PractitionerInfoForAchievement;
import com.yd.api.practitioner.vo.recruit.*; import com.yd.api.practitioner.vo.recruit.*;
import com.yd.api.practitioner.vo.salestarget.SalesTargetActions; import com.yd.api.practitioner.vo.salestarget.*;
import com.yd.api.practitioner.vo.salestarget.SalesTargetMonth;
import com.yd.api.practitioner.vo.salestarget.SalesTargetSaveRequestVO;
import com.yd.api.practitioner.vo.salestarget.SalesTargetSaveResponseVO;
import com.yd.api.practitioner.vo.setting.*; import com.yd.api.practitioner.vo.setting.*;
import com.yd.api.result.CommonResult; import com.yd.api.result.CommonResult;
import com.yd.dal.entity.customer.*; import com.yd.dal.entity.customer.*;
...@@ -1383,6 +1380,93 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1383,6 +1380,93 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return responseVO; return responseVO;
} }
@Override
public SalesTargetQueryResponseVO salesTargetQuery(SalesTargetQueryRequestVO requestVO) {
SalesTargetQueryResponseVO responseVO = new SalesTargetQueryResponseVO();
//经纪人id
Long practitionerId = requestVO.getPractitionerId();
//当前年份
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
//通过is_active = 1 经纪人id 和 目标所属年度 去查询ag_mkt_leads_goals/ag_mkt_leads_goals_actions
MktLeadsGoals mktLeadsGoals = new MktLeadsGoals();
mktLeadsGoals.setIsActive(1);
mktLeadsGoals.setPractitionerId(practitionerId);
mktLeadsGoals.setCurrentYear(year);
List<MktLeadsGoals> mktLeadsGoalsList = mktLeadsGoalsDALService.findByMktLeadsGoals(mktLeadsGoals);
List<SalesTargetMonth> salesTargetMonthList = new ArrayList<>();
for (MktLeadsGoals info :mktLeadsGoalsList){
Integer statisticTimeUnit = info.getStatisticTimeUnit();
if (statisticTimeUnit==1){//年
responseVO.setPremium(info.getPremium());
responseVO.setCommission(info.getCommission());
responseVO.setPieces(info.getPieces());
responseVO.setPieceAveragePremium(info.getPieceAveragePremium());
}else if (statisticTimeUnit==3){//月
SalesTargetMonth salesTargetMonth = new SalesTargetMonth();
salesTargetMonth.setCommission(info.getCommission());
salesTargetMonth.setMonthNum(info.getSeqTime());
salesTargetMonth.setPieceAveragePremium(info.getPieceAveragePremium());
salesTargetMonth.setPieces(info.getPieces());
salesTargetMonth.setPremium(info.getPremium());
salesTargetMonthList.add(salesTargetMonth);
}
}
MktLeadsGoalsActions mktLeadsGoalsActions = new MktLeadsGoalsActions();
mktLeadsGoalsActions.setIsActive(1);
mktLeadsGoalsActions.setPractitionerId(practitionerId);
mktLeadsGoalsActions.setCurrentYear(year);
List<MktLeadsGoalsActions> mktLeadsGoalsActionsList = mktLeadsGoalsActionsDALService.findByMktLeadsGoalsActions(mktLeadsGoalsActions);
List<SalesTargetActions> salesTargetActions = new ArrayList<>();
for (MktLeadsGoalsActions info : mktLeadsGoalsActionsList){
SalesTargetActions salesTargetAction = new SalesTargetActions();
salesTargetAction.setStatisticTimeUnit(3);
salesTargetAction.setActionStandards(info.getActionStandards());
salesTargetAction.setLeadsActionId(info.getLeadsActionId());
salesTargetAction.setLeadsActionName(info.getLeadsActionName());
salesTargetActions.add(salesTargetAction);
}
responseVO.setPractitionerId(practitionerId);
responseVO.setSalesTargetMonths(salesTargetMonthList);
responseVO.setSalesTargetActions(salesTargetActions);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
@Override
public SalesTargetMonthSaveResponseVO salesTargetMonthSave(SalesTargetMonthSaveRequestVO requestVO) {
SalesTargetMonthSaveResponseVO responseVO = new SalesTargetMonthSaveResponseVO();
//经纪人id
Long practitionerId = requestVO.getPractitionerId();
//当前年份
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
mktLeadsGoalsActionsDALService.updateIsActiveIsNull(practitionerId,year);
List<SalesTargetActions> salesTargetActionsList = requestVO.getSalesTargetActionsList();
Date date = new Date();
MktLeadsGoalsActions mktLeadsGoalsActions;
for (SalesTargetActions info : salesTargetActionsList){
mktLeadsGoalsActions = new MktLeadsGoalsActions();
mktLeadsGoalsActions.setPractitionerId(practitionerId);
mktLeadsGoalsActions.setCurrentYear(year);
mktLeadsGoalsActions.setStatisticTimeUnit(3);
mktLeadsGoalsActions.setLeadsActionId(info.getLeadsActionId());
mktLeadsGoalsActions.setLeadsActionName(info.getLeadsActionName());
mktLeadsGoalsActions.setActionStandards(info.getActionStandards());
mktLeadsGoalsActions.setCurrentVersion(date);
mktLeadsGoalsActions.setIsActive(1);
mktLeadsGoalsActions.setCreatedAt(new Date());
mktLeadsGoalsActions.setCreatedBy(practitionerId);
mktLeadsGoalsActions.setUpdatedAt(new Date());
mktLeadsGoalsActions.setUpdatedBy(practitionerId);
mktLeadsGoalsActionsDALService.save(mktLeadsGoalsActions);
}
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
private void initializationAction(Long practitionerId, int year) { private void initializationAction(Long practitionerId, int year) {
//通过经纪人id 和 目标所属年度 去查询ag_mkt_leads_goals/ag_mkt_leads_goals_actions 并将is_active = 0 //通过经纪人id 和 目标所属年度 去查询ag_mkt_leads_goals/ag_mkt_leads_goals_actions 并将is_active = 0
mktLeadsGoalsDALService.updateIsActiveIsNull(practitionerId,year); mktLeadsGoalsDALService.updateIsActiveIsNull(practitionerId,year);
...@@ -1434,7 +1518,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1434,7 +1518,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
*/ */
private void saveMonthGoal(SalesTargetMonth info, Long practitionerId, Date date,int year) { private void saveMonthGoal(SalesTargetMonth info, Long practitionerId, Date date,int year) {
MktLeadsGoals mktLeadsGoals = new MktLeadsGoals(); MktLeadsGoals mktLeadsGoals = new MktLeadsGoals();
mktLeadsGoals.setPractitionerId(practitionerId.toString()); mktLeadsGoals.setPractitionerId(practitionerId);
mktLeadsGoals.setPremium(info.getPremium()); mktLeadsGoals.setPremium(info.getPremium());
mktLeadsGoals.setCommission(info.getCommission()); mktLeadsGoals.setCommission(info.getCommission());
mktLeadsGoals.setPieces(info.getPieces()); mktLeadsGoals.setPieces(info.getPieces());
...@@ -1464,7 +1548,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1464,7 +1548,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
Integer pieces = requestVO.getPieces(); Integer pieces = requestVO.getPieces();
Integer pieceAveragePremium = requestVO.getPieceAveragePremium(); Integer pieceAveragePremium = requestVO.getPieceAveragePremium();
MktLeadsGoals mktLeadsGoals = new MktLeadsGoals(); MktLeadsGoals mktLeadsGoals = new MktLeadsGoals();
mktLeadsGoals.setPractitionerId(practitionerId.toString()); mktLeadsGoals.setPractitionerId(practitionerId);
mktLeadsGoals.setPremium(premium); mktLeadsGoals.setPremium(premium);
mktLeadsGoals.setCommission(commission); mktLeadsGoals.setCommission(commission);
mktLeadsGoals.setPieces(pieces); mktLeadsGoals.setPieces(pieces);
......
package com.yd.api.practitioner.vo.salestarget;
import lombok.Data;
import java.util.List;
@Data
public class SalesTargetMonthSaveRequestVO {
private Long practitionerId;
private List<SalesTargetActions> salesTargetActionsList;
}
package com.yd.api.practitioner.vo.salestarget;
import com.yd.api.result.CommonResult;
import lombok.Data;
@Data
public class SalesTargetMonthSaveResponseVO {
private Long practitionerId;
private CommonResult commonResult;
}
package com.yd.api.practitioner.vo.salestarget;
import lombok.Data;
@Data
public class SalesTargetQueryRequestVO {
private Long practitionerId;
}
package com.yd.api.practitioner.vo.salestarget;
import com.yd.api.result.CommonResult;
import lombok.Data;
import java.util.List;
@Data
public class SalesTargetQueryResponseVO {
private Long practitionerId;
private Integer premium;
private Integer commission;
private Integer pieces;
private Integer pieceAveragePremium;
private List<SalesTargetMonth> salesTargetMonths;
private List<SalesTargetActions> salesTargetActions;
private CommonResult commonResult;
}
...@@ -16,7 +16,7 @@ public class MktLeadsGoals { ...@@ -16,7 +16,7 @@ public class MktLeadsGoals {
/** /**
* FK ag_acl_practitioner.id 经纪人 * FK ag_acl_practitioner.id 经纪人
*/ */
private String practitionerId; private Long practitionerId;
/** /**
* 目标所属年度 * 目标所属年度
......
...@@ -3,6 +3,8 @@ package com.yd.dal.mapper.marketing; ...@@ -3,6 +3,8 @@ package com.yd.dal.mapper.marketing;
import com.yd.dal.entity.marketing.MktLeadsGoalsActions; import com.yd.dal.entity.marketing.MktLeadsGoalsActions;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MktLeadsGoalsActionsMapper { public interface MktLeadsGoalsActionsMapper {
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
...@@ -17,4 +19,6 @@ public interface MktLeadsGoalsActionsMapper { ...@@ -17,4 +19,6 @@ public interface MktLeadsGoalsActionsMapper {
int updateByPrimaryKey(MktLeadsGoalsActions record); int updateByPrimaryKey(MktLeadsGoalsActions record);
void updateIsActiveIsNull(@Param("practitionerId") Long practitionerId,@Param("year") Integer year); void updateIsActiveIsNull(@Param("practitionerId") Long practitionerId,@Param("year") Integer year);
List<MktLeadsGoalsActions> findByMktLeadsGoalsActions(MktLeadsGoalsActions mktLeadsGoalsActions);
} }
\ No newline at end of file
package com.yd.dal.mapper.marketing; package com.yd.dal.mapper.marketing;
import com.yd.dal.entity.marketing.MktLeadsGoals; import com.yd.dal.entity.marketing.MktLeadsGoals;import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MktLeadsGoalsMapper { public interface MktLeadsGoalsMapper {
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
...@@ -16,5 +17,7 @@ public interface MktLeadsGoalsMapper { ...@@ -16,5 +17,7 @@ public interface MktLeadsGoalsMapper {
int updateByPrimaryKey(MktLeadsGoals record); int updateByPrimaryKey(MktLeadsGoals record);
void updateIsActiveIsNull(@Param("practitionerId") Long practitionerId,@Param("year") Integer year); void updateIsActiveIsNull(@Param("practitionerId") Long practitionerId, @Param("year") Integer year);
List<MktLeadsGoals> selectByMktLeadsGoals(MktLeadsGoals mktLeadsGoals);
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.yd.dal.service.marketing.MktLeadsGoalsActionsDALService; ...@@ -6,6 +6,7 @@ import com.yd.dal.service.marketing.MktLeadsGoalsActionsDALService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
@Service("mktLeadsGoalsActionsService") @Service("mktLeadsGoalsActionsService")
public class MktLeadsGoalsActionsDALServiceImpl implements MktLeadsGoalsActionsDALService { public class MktLeadsGoalsActionsDALServiceImpl implements MktLeadsGoalsActionsDALService {
...@@ -22,4 +23,9 @@ public class MktLeadsGoalsActionsDALServiceImpl implements MktLeadsGoalsActionsD ...@@ -22,4 +23,9 @@ public class MktLeadsGoalsActionsDALServiceImpl implements MktLeadsGoalsActionsD
public void updateIsActiveIsNull(Long practitionerId, int year) { public void updateIsActiveIsNull(Long practitionerId, int year) {
mktLeadsGoalsActionsMapper.updateIsActiveIsNull(practitionerId, year); mktLeadsGoalsActionsMapper.updateIsActiveIsNull(practitionerId, year);
} }
@Override
public List<MktLeadsGoalsActions> findByMktLeadsGoalsActions(MktLeadsGoalsActions mktLeadsGoalsActions) {
return mktLeadsGoalsActionsMapper.findByMktLeadsGoalsActions(mktLeadsGoalsActions);
}
} }
...@@ -6,6 +6,7 @@ import com.yd.dal.service.marketing.MktLeadsGoalsDALService; ...@@ -6,6 +6,7 @@ import com.yd.dal.service.marketing.MktLeadsGoalsDALService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
@Service("mktLeadsGoalsDALService") @Service("mktLeadsGoalsDALService")
public class MktLeadsGoalsDALServiceImpl implements MktLeadsGoalsDALService { public class MktLeadsGoalsDALServiceImpl implements MktLeadsGoalsDALService {
...@@ -22,4 +23,9 @@ public class MktLeadsGoalsDALServiceImpl implements MktLeadsGoalsDALService { ...@@ -22,4 +23,9 @@ public class MktLeadsGoalsDALServiceImpl implements MktLeadsGoalsDALService {
public void updateIsActiveIsNull(Long practitionerId, Integer year) { public void updateIsActiveIsNull(Long practitionerId, Integer year) {
mktLeadsGoalsMapper.updateIsActiveIsNull(practitionerId, year) ; mktLeadsGoalsMapper.updateIsActiveIsNull(practitionerId, year) ;
} }
@Override
public List<MktLeadsGoals> findByMktLeadsGoals(MktLeadsGoals mktLeadsGoals) {
return mktLeadsGoalsMapper.selectByMktLeadsGoals(mktLeadsGoals);
}
} }
...@@ -2,8 +2,12 @@ package com.yd.dal.service.marketing; ...@@ -2,8 +2,12 @@ package com.yd.dal.service.marketing;
import com.yd.dal.entity.marketing.MktLeadsGoalsActions; import com.yd.dal.entity.marketing.MktLeadsGoalsActions;
import java.util.List;
public interface MktLeadsGoalsActionsDALService { public interface MktLeadsGoalsActionsDALService {
void save(MktLeadsGoalsActions mktLeadsGoalsActions); void save(MktLeadsGoalsActions mktLeadsGoalsActions);
void updateIsActiveIsNull(Long practitionerId, int year); void updateIsActiveIsNull(Long practitionerId, int year);
List<MktLeadsGoalsActions> findByMktLeadsGoalsActions(MktLeadsGoalsActions mktLeadsGoalsActions);
} }
...@@ -2,8 +2,12 @@ package com.yd.dal.service.marketing; ...@@ -2,8 +2,12 @@ package com.yd.dal.service.marketing;
import com.yd.dal.entity.marketing.MktLeadsGoals; import com.yd.dal.entity.marketing.MktLeadsGoals;
import java.util.List;
public interface MktLeadsGoalsDALService { public interface MktLeadsGoalsDALService {
void saveMktLeadsGoals(MktLeadsGoals mktLeadsGoals); void saveMktLeadsGoals(MktLeadsGoals mktLeadsGoals);
void updateIsActiveIsNull(Long practitionerId, Integer year); void updateIsActiveIsNull(Long practitionerId, Integer year);
List<MktLeadsGoals> findByMktLeadsGoals(MktLeadsGoals mktLeadsGoals);
} }
...@@ -198,4 +198,50 @@ ...@@ -198,4 +198,50 @@
and current_year = #{year,jdbcType=INTEGER} and current_year = #{year,jdbcType=INTEGER}
and is_active =1; and is_active =1;
</update> </update>
<select id="findByMktLeadsGoalsActions" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_mkt_leads_goals_actions
<where>
<if test="id != null">
id = #{id,jdbcType=BIGINT}
</if>
<if test="practitionerId != null">
and practitioner_id = #{practitionerId,jdbcType=BIGINT}
</if>
<if test="currentYear != null">
and current_year = #{currentYear,jdbcType=INTEGER}
</if>
<if test="statisticTimeUnit != null">
and statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER}
</if>
<if test="leadsActionId != null">
and leads_action_id = #{leadsActionId,jdbcType=BIGINT}
</if>
<if test="leadsActionName != null">
and leads_action_name = #{leadsActionName,jdbcType=VARCHAR}
</if>
<if test="actionStandards != null">
and action_standards = #{actionStandards,jdbcType=INTEGER}
</if>
<if test="currentVersion != null">
and current_version = #{currentVersion,jdbcType=TIMESTAMP}
</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="updatedAt != null">
and updated_at = #{updatedAt,jdbcType=TIMESTAMP}
</if>
<if test="updatedBy != null">
and updated_by = #{updatedBy,jdbcType=BIGINT}
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!--@mbg.generated--> <!--@mbg.generated-->
<!--@Table ag_mkt_leads_goals--> <!--@Table ag_mkt_leads_goals-->
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="practitioner_id" jdbcType="VARCHAR" property="practitionerId" /> <result column="practitioner_id" jdbcType="BIGINT" property="practitionerId" />
<result column="current_year" jdbcType="INTEGER" property="currentYear" /> <result column="current_year" jdbcType="INTEGER" property="currentYear" />
<result column="statistic_time_unit" jdbcType="INTEGER" property="statisticTimeUnit" /> <result column="statistic_time_unit" jdbcType="INTEGER" property="statisticTimeUnit" />
<result column="seq_time" jdbcType="INTEGER" property="seqTime" /> <result column="seq_time" jdbcType="INTEGER" property="seqTime" />
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
pieces, piece_average_premium, current_version, pieces, piece_average_premium, current_version,
is_active, created_at, created_by, is_active, created_at, created_by,
updated_at, updated_by) updated_at, updated_by)
values (#{practitionerId,jdbcType=VARCHAR}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER}, values (#{practitionerId,jdbcType=BIGINT}, #{currentYear,jdbcType=INTEGER}, #{statisticTimeUnit,jdbcType=INTEGER},
#{seqTime,jdbcType=INTEGER}, #{premium,jdbcType=INTEGER}, #{commission,jdbcType=INTEGER}, #{seqTime,jdbcType=INTEGER}, #{premium,jdbcType=INTEGER}, #{commission,jdbcType=INTEGER},
#{pieces,jdbcType=INTEGER}, #{pieceAveragePremium,jdbcType=INTEGER}, #{currentVersion,jdbcType=TIMESTAMP}, #{pieces,jdbcType=INTEGER}, #{pieceAveragePremium,jdbcType=INTEGER}, #{currentVersion,jdbcType=TIMESTAMP},
#{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT},
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="practitionerId != null"> <if test="practitionerId != null">
#{practitionerId,jdbcType=VARCHAR}, #{practitionerId,jdbcType=BIGINT},
</if> </if>
<if test="currentYear != null"> <if test="currentYear != null">
#{currentYear,jdbcType=INTEGER}, #{currentYear,jdbcType=INTEGER},
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
update ag_mkt_leads_goals update ag_mkt_leads_goals
<set> <set>
<if test="practitionerId != null"> <if test="practitionerId != null">
practitioner_id = #{practitionerId,jdbcType=VARCHAR}, practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if> </if>
<if test="currentYear != null"> <if test="currentYear != null">
current_year = #{currentYear,jdbcType=INTEGER}, current_year = #{currentYear,jdbcType=INTEGER},
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
<update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.marketing.MktLeadsGoals"> <update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.marketing.MktLeadsGoals">
<!--@mbg.generated--> <!--@mbg.generated-->
update ag_mkt_leads_goals update ag_mkt_leads_goals
set practitioner_id = #{practitionerId,jdbcType=VARCHAR}, set practitioner_id = #{practitionerId,jdbcType=BIGINT},
current_year = #{currentYear,jdbcType=INTEGER}, current_year = #{currentYear,jdbcType=INTEGER},
statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER}, statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER},
seq_time = #{seqTime,jdbcType=INTEGER}, seq_time = #{seqTime,jdbcType=INTEGER},
...@@ -218,4 +218,56 @@ ...@@ -218,4 +218,56 @@
AND current_year = #{year,jdbcType=INTEGER} AND current_year = #{year,jdbcType=INTEGER}
AND is_active = 1; AND is_active = 1;
</update> </update>
<select id="selectByMktLeadsGoals" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_mkt_leads_goals
<where>
<if test="id != null">
id = #{id,jdbcType=BIGINT}
</if>
<if test="practitionerId != null">
and practitioner_id = #{practitionerId,jdbcType=BIGINT}
</if>
<if test="currentYear != null">
and current_year = #{currentYear,jdbcType=INTEGER}
</if>
<if test="statisticTimeUnit != null">
and statistic_time_unit = #{statisticTimeUnit,jdbcType=INTEGER}
</if>
<if test="seqTime != null">
and seq_time = #{seqTime,jdbcType=INTEGER}
</if>
<if test="premium != null">
and premium = #{premium,jdbcType=INTEGER}
</if>
<if test="commission != null">
and commission = #{commission,jdbcType=INTEGER}
</if>
<if test="pieces != null">
and pieces = #{pieces,jdbcType=INTEGER}
</if>
<if test="pieceAveragePremium != null">
and piece_average_premium = #{pieceAveragePremium,jdbcType=INTEGER}
</if>
<if test="currentVersion != null">
and current_version = #{currentVersion,jdbcType=TIMESTAMP}
</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="updatedAt != null">
and updated_at = #{updatedAt,jdbcType=TIMESTAMP}
</if>
<if test="updatedBy != null">
and updated_by = #{updatedBy,jdbcType=BIGINT}
</if>
</where>
</select>
</mapper> </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