提成计算相关

1 parent 8072747c
Showing 24 changed files with 307 additions and 69 deletions
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
<artifactId>hutool-all</artifactId> <artifactId>hutool-all</artifactId>
<version>5.8.38</version> <version>5.8.38</version>
</dependency> </dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.6.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -24,7 +24,7 @@ public class AssessmentFactorDailyDataDTO implements Serializable { ...@@ -24,7 +24,7 @@ public class AssessmentFactorDailyDataDTO implements Serializable {
/** /**
* 该门店的该个人实际售前触客数 * 该门店的该个人实际售前触客数
*/ */
private Integer storePreSalesTouchCount; private Integer storePersonalPreSalesTouchCount;
/** /**
* 门店总触客数(该门店的所有个人实际售前触客数之和) * 门店总触客数(该门店的所有个人实际售前触客数之和)
......
...@@ -46,4 +46,19 @@ public class AssessmentFactorOrderDataDTO implements Serializable { ...@@ -46,4 +46,19 @@ public class AssessmentFactorOrderDataDTO implements Serializable {
* 主订单成交数(门店+业务+品牌) * 主订单成交数(门店+业务+品牌)
*/ */
private Integer mainOrderCountByBrand; private Integer mainOrderCountByBrand;
/**
* 主订单成交数(门店+业务+品牌+品类)
*/
private Integer mainOrderCountByBrandAndCategory;
/**
* 子订单成交数(门店+业务+品牌+品类)
*/
private Integer subOrderCountByBrandAndCategory;
/**
* 品类订单产值合计(门店+业务+品牌+品类)
*/
private BigDecimal categoryOrderOutputTotalByBrandAndCategory;
} }
package cn.com.glsx.dj.staff.dto; package cn.com.glsx.dj.staff.dto;
import cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.MerchantPerformanceProductDefineDTO;
import cn.com.glsx.dj.staff.model.PerformanceParamConfigCondition; import cn.com.glsx.dj.staff.model.PerformanceParamConfigCondition;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
...@@ -9,4 +10,5 @@ import lombok.experimental.SuperBuilder; ...@@ -9,4 +10,5 @@ import lombok.experimental.SuperBuilder;
@ToString(callSuper = true) @ToString(callSuper = true)
@Data @Data
public class PerformanceParamConfigConditionDTO extends PerformanceParamConfigCondition { public class PerformanceParamConfigConditionDTO extends PerformanceParamConfigCondition {
private MerchantPerformanceProductDefineDTO productDefine;
} }
package cn.com.glsx.dj.staff.dto; package cn.com.glsx.dj.staff.dto;
import java.util.List; import cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.MerchantPerformanceProductDefineDTO;
import cn.com.glsx.dj.staff.model.PerformanceParamConfig; import cn.com.glsx.dj.staff.model.PerformanceParamConfig;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -9,6 +8,8 @@ import lombok.NoArgsConstructor; ...@@ -9,6 +8,8 @@ import lombok.NoArgsConstructor;
import lombok.ToString; import lombok.ToString;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import java.util.List;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@SuperBuilder @SuperBuilder
...@@ -17,5 +18,7 @@ import lombok.experimental.SuperBuilder; ...@@ -17,5 +18,7 @@ import lombok.experimental.SuperBuilder;
public class PerformanceParamConfigDTO extends PerformanceParamConfig { public class PerformanceParamConfigDTO extends PerformanceParamConfig {
private static final long serialVersionUID = 5606800131085599586L; private static final long serialVersionUID = 5606800131085599586L;
private MerchantPerformanceProductDefineDTO productDefine;
private List<PerformanceParamConfigConditionDTO> performanceParamConfigConditions; private List<PerformanceParamConfigConditionDTO> performanceParamConfigConditions;
} }
...@@ -44,6 +44,26 @@ public class StaffPerformanceCalContextDTO implements Serializable { ...@@ -44,6 +44,26 @@ public class StaffPerformanceCalContextDTO implements Serializable {
private Map<String, List<StaffPerformanceSubOrderDTO>> groupedOrdersMap; private Map<String, List<StaffPerformanceSubOrderDTO>> groupedOrdersMap;
/** /**
* 商户ID
*/
private Integer merchantId;
/**
* 业务类型
*/
private Byte businessType;
/**
* 品牌ID
*/
private Integer brandId;
/**
* 子品牌ID
*/
private Integer childBrandId;
/**
* 当前计算的门店提成方案 * 当前计算的门店提成方案
*/ */
private PerformanceConfigDTO performanceConfig; private PerformanceConfigDTO performanceConfig;
......
...@@ -7,10 +7,11 @@ import lombok.experimental.SuperBuilder; ...@@ -7,10 +7,11 @@ import lombok.experimental.SuperBuilder;
/** /**
* 员工绩效计算结果DTO * 员工绩效计算结果DTO
*/ */
@Data @AllArgsConstructor
@NoArgsConstructor
@SuperBuilder @SuperBuilder
@ToString(callSuper = true) @ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true) @Data
public class StaffPerformanceDTO extends StaffPerformance { public class StaffPerformanceDTO extends StaffPerformance {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = -6357597727215841459L;
} }
...@@ -54,11 +54,21 @@ public class StaffPerformanceSubOrderDTO implements Serializable { ...@@ -54,11 +54,21 @@ public class StaffPerformanceSubOrderDTO implements Serializable {
private Integer brandId; private Integer brandId;
/** /**
* 品牌ID名称
*/
private String brandName;
/**
* 子品牌ID * 子品牌ID
*/ */
private Integer childBrandId; private Integer childBrandId;
/** /**
* 子品牌ID名称
*/
private String childBrandName;
/**
* 升级商品ID * 升级商品ID
*/ */
private Integer upgradeGoodsId; private Integer upgradeGoodsId;
......
package cn.com.glsx.dj.staff.dto.perfSalary; package cn.com.glsx.dj.staff.dto.perfSalary;
import cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview; import cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
/** /**
* 有效引荐数表 * 有效引荐数表
*/ */
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@ToString(callSuper = true)
@Data @Data
@EqualsAndHashCode(callSuper = true)
public class EffectiveReferralReviewDTO extends EffectiveReferralReview { public class EffectiveReferralReviewDTO extends EffectiveReferralReview {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import javax.persistence.*; import javax.persistence.*;
...@@ -16,11 +15,10 @@ import java.util.Date; ...@@ -16,11 +15,10 @@ import java.util.Date;
/** /**
* 员工提成 * 员工提成
*/ */
@Data
@SuperBuilder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Accessors(chain = true) @SuperBuilder
@Data
@Table(name = "dj_car_life_staff_performance") @Table(name = "dj_car_life_staff_performance")
public class StaffPerformance implements Serializable { public class StaffPerformance implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -48,7 +46,7 @@ public class StaffPerformance implements Serializable { ...@@ -48,7 +46,7 @@ public class StaffPerformance implements Serializable {
@ApiModelProperty(notes = "业务类型(0:轻改,1:权益;2:延保)") @ApiModelProperty(notes = "业务类型(0:轻改,1:权益;2:延保)")
@Column(name = "business_type") @Column(name = "business_type")
private Integer businessType; private Byte businessType;
@ApiModelProperty(notes = "主品牌id") @ApiModelProperty(notes = "主品牌id")
@Column(name = "brand_id") @Column(name = "brand_id")
......
...@@ -6,6 +6,7 @@ import lombok.AllArgsConstructor; ...@@ -6,6 +6,7 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import javax.persistence.*; import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
...@@ -17,6 +18,7 @@ import java.util.Date; ...@@ -17,6 +18,7 @@ import java.util.Date;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@SuperBuilder
@Accessors(chain = true) @Accessors(chain = true)
@Table(name = "sal_effective_referral_review") @Table(name = "sal_effective_referral_review")
public class EffectiveReferralReview implements Serializable { public class EffectiveReferralReview implements Serializable {
...@@ -101,7 +103,7 @@ public class EffectiveReferralReview implements Serializable { ...@@ -101,7 +103,7 @@ public class EffectiveReferralReview implements Serializable {
*/ */
@ApiModelProperty(notes = "业务场景:1-精品升级(轻改);2-会员权益(广联权益);3-单延保;") @ApiModelProperty(notes = "业务场景:1-精品升级(轻改);2-会员权益(广联权益);3-单延保;")
@Column(name = "scene_type") @Column(name = "scene_type")
private Integer sceneType; private Byte sceneType;
/** /**
* 是否需要总部复核:1-需要 * 是否需要总部复核:1-需要
......
package cn.com.glsx.dj.staff.config.dubbo; package cn.com.glsx.dj.staff.config.dubbo;
import cn.com.glsx.dj.smartcarlife.remote.*;
import cn.com.glsx.dj.staff.config.DubboConfig;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import cn.com.glsx.dj.smartcarlife.remote.GoodsOrderRemote;
import cn.com.glsx.dj.smartcarlife.remote.MerchantDailyReportHuaweiRemote;
import cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote;
import cn.com.glsx.dj.smartcarlife.remote.StaffBehaviorDeductMoneyRecordRemote;
import cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote;
import cn.com.glsx.dj.staff.config.DubboConfig;
@Configuration @Configuration
public class SmartCarLifeDubboConfig extends DubboConfig { public class SmartCarLifeDubboConfig extends DubboConfig {
...@@ -38,4 +33,8 @@ public class SmartCarLifeDubboConfig extends DubboConfig { ...@@ -38,4 +33,8 @@ public class SmartCarLifeDubboConfig extends DubboConfig {
return factory.builder(StaffBehaviorDeductMoneyRecordRemote.class).check(check).timeout(timeout).version("1.0.0").build(); return factory.builder(StaffBehaviorDeductMoneyRecordRemote.class).check(check).timeout(timeout).version("1.0.0").build();
} }
@Bean
public MerchantPerformanceProductDefineRemote merchantPerformanceProductDefineRemote(){
return factory.builder(MerchantPerformanceProductDefineRemote.class).check(check).timeout(timeout).version("1.0.0").build();
}
} }
package cn.com.glsx.dj.staff.mapper; package cn.com.glsx.dj.staff.mapper;
import cn.com.glsx.dj.staff.dto.PerformanceParamConfigConditionDTO;
import cn.com.glsx.dj.staff.model.PerformanceParamConfigCondition; import cn.com.glsx.dj.staff.model.PerformanceParamConfigCondition;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
public interface PerformanceParamConfigConditionMapper extends OreMapper<PerformanceParamConfigCondition> { public interface PerformanceParamConfigConditionMapper extends OreMapper<PerformanceParamConfigCondition> {
List<PerformanceParamConfigConditionDTO> listByParamConfigId(
PerformanceParamConfigConditionDTO dto);
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.mapper; package cn.com.glsx.dj.staff.mapper;
import cn.com.glsx.dj.staff.dto.StaffPerformanceDTO; import cn.com.glsx.dj.staff.dto.StaffPerformanceDTO;
import cn.com.glsx.dj.staff.dto.StaffPerformanceDailyReportQueryDTO;
import cn.com.glsx.dj.staff.dto.StaffPerformanceOrderQueryDTO; import cn.com.glsx.dj.staff.dto.StaffPerformanceOrderQueryDTO;
import cn.com.glsx.dj.staff.dto.StaffPerformanceSubOrderDTO; import cn.com.glsx.dj.staff.dto.StaffPerformanceSubOrderDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -21,4 +22,12 @@ public interface StaffPerformanceCalMapper extends OreMapper<StaffPerformanceDTO ...@@ -21,4 +22,12 @@ public interface StaffPerformanceCalMapper extends OreMapper<StaffPerformanceDTO
* @return 订单列表 * @return 订单列表
*/ */
List<StaffPerformanceSubOrderDTO> selectStaffOrders(StaffPerformanceOrderQueryDTO query); List<StaffPerformanceSubOrderDTO> selectStaffOrders(StaffPerformanceOrderQueryDTO query);
/**
* 统计实际售前触客数
*
* @param query 查询参数
* @return 日报数据列表
*/
Integer statPreSalesTouchCount(StaffPerformanceDailyReportQueryDTO query);
} }
package cn.com.glsx.dj.staff.mapper; package cn.com.glsx.dj.staff.mapper;
import cn.com.glsx.dj.staff.dto.StaffPerformanceDTO;
import cn.com.glsx.dj.staff.model.StaffPerformance; import cn.com.glsx.dj.staff.model.StaffPerformance;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper @Mapper
public interface StaffPerformanceMapper extends OreMapper<StaffPerformance> { public interface StaffPerformanceMapper extends OreMapper<StaffPerformance> {
List<StaffPerformanceDTO> listStaffPerformance(StaffPerformanceDTO dto);
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.mapper.perfSalary; package cn.com.glsx.dj.staff.mapper.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO;
import cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview; import cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
...@@ -7,4 +8,11 @@ import org.oreframework.datasource.mybatis.mapper.OreMapper; ...@@ -7,4 +8,11 @@ import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper @Mapper
public interface EffectiveReferralReviewMapper extends OreMapper<EffectiveReferralReview> { public interface EffectiveReferralReviewMapper extends OreMapper<EffectiveReferralReview> {
/**
* 根据条件查询单条有效引荐数记录
*
* @param query 查询条件
* @return 记录
*/
EffectiveReferralReviewDTO selectOneByQuery(EffectiveReferralReviewDTO query);
} }
\ No newline at end of file \ No newline at end of file
...@@ -7,9 +7,9 @@ import org.springframework.stereotype.Service; ...@@ -7,9 +7,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO;
import javax.annotation.Resource; import javax.annotation.Resource;
@Slf4j @Slf4j
@Service @Service
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class) @Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class)
...@@ -23,4 +23,14 @@ public class EffectiveReferralReviewService { ...@@ -23,4 +23,14 @@ public class EffectiveReferralReviewService {
} }
/**
* 根据条件查询单条有效引荐数记录
*
* @param query 查询参数
* @return 记录
*/
public EffectiveReferralReviewDTO queryEffectiveReferralReview(EffectiveReferralReviewDTO query) {
return effectiveReferralReviewMapper.selectOneByQuery(query);
}
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.service.staffPerformance;
import cn.com.glsx.dj.staff.dto.StaffPerformanceDTO;
import cn.com.glsx.dj.staff.mapper.StaffPerformanceMapper;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class)
public class StaffPerformanceService {
@Lazy
@Autowired
private StaffPerformanceService thiz;
@Autowired
private StaffPerformanceMapper staffPerformanceMapper;
public List<StaffPerformanceDTO> listStaffPerformance(StaffPerformanceDTO dto) {
try{
return staffPerformanceMapper.listStaffPerformance(dto);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
}
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/> <result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
<result column="deleted_flag" jdbcType="VARCHAR" property="deletedFlag"/> <result column="deleted_flag" jdbcType="VARCHAR" property="deletedFlag"/>
</resultMap> </resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO" extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, merchant_id, total_delivery_count, area_effective_count, id, merchant_id, total_delivery_count, area_effective_count,
reviewed_effective_count, review_month, image_urls, remark, reviewed_effective_count, review_month, image_urls, remark,
...@@ -40,5 +42,28 @@ ...@@ -40,5 +42,28 @@
manager_commit_time, reviewed_by, reviewed_name, reviewed_time, manager_commit_time, reviewed_by, reviewed_name, reviewed_time,
created_by, created_date, updated_by, updated_date, deleted_flag created_by, created_date, updated_by, updated_date, deleted_flag
</sql> </sql>
<select id="selectOneByQuery" resultMap="DTOResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM
sal_effective_referral_review
<where>
deleted_flag = 'N'
<if test="merchantId != null">
AND merchant_id = #{merchantId}
</if>
<if test="sceneType != null">
AND scene_type = #{sceneType}
</if>
<if test="brandId != null">
AND brand_id = #{brandId}
</if>
<if test="reviewMonth != null">
and review_month = #{reviewMonth}
</if>
</where>
LIMIT
1
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -29,6 +29,18 @@ ...@@ -29,6 +29,18 @@
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" /> <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" /> <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap> </resultMap>
<resultMap id = "DTOResultMap" type = "cn.com.glsx.dj.staff.dto.PerformanceParamConfigConditionDTO" extends="BaseResultMap">
<association property="productDefine" javaType="cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.MerchantPerformanceProductDefineDTO">
<id column="product_define_id" property="id" jdbcType="INTEGER" />
<result column="define_type" property="defineType" jdbcType="TINYINT" />
<result column="define_name" property="defineName" jdbcType="VARCHAR" />
<collection property="itemList" ofType="cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.MerchantPerformanceProductDefineItemDTO">
<id column="product_define_item_id" property="id" jdbcType="INTEGER" />
<result column="item_id" property="itemId" jdbcType="INTEGER" />
<result column="item_name" property="itemName" jdbcType="VARCHAR" />
</collection>
</association>
</resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
...@@ -40,4 +52,47 @@ ...@@ -40,4 +52,47 @@
condition_end_value, condition_commission_base, condition_commission_type, condition_commission_type_value, condition_end_value, condition_commission_base, condition_commission_type, condition_commission_type_value,
created_by, created_date, updated_by, updated_date, deleted_flag created_by, created_date, updated_by, updated_date, deleted_flag
</sql> </sql>
<select id="listByParamConfigId" resultMap="DTOResultMap">
SELECT
dcpcc.id,
dcpcc.performance_param_config_id,
dcpcc.condition_type,
dcpcc.condition_goods_config_type,
dcpcc.condition_goods_type,
dcpcc.condition_goods_type_name,
dcpcc.condition_secondary_goods_type,
dcpcc.condition_secondary_goods_type_name,
dcpcc.condition_third_level_goods_type,
dcpcc.condition_third_level_goods_type_name,
dcpcc.condition_product_define_id,
dcpcc.condition_product_define_name,
dcpcc.condition_assessment_factors,
dcpcc.condition_start_value,
dcpcc.condition_end_value,
dcpcc.condition_commission_base,
dcpcc.condition_commission_type,
dcpcc.condition_commission_type_value,
dcpcc.created_by,
dcpcc.created_date,
dcpcc.updated_by,
dcpcc.updated_date,
dcpcc.deleted_flag,
dcpd.id AS product_define_id,
dcpd.define_type,
dcpd.define_name,
dcpdi.id AS product_define_item_id,
dcpdi.item_id,
dcpdi.item_name
FROM
dj_car_life_performance_param_config_condition dcpcc
LEFT JOIN dj_car_life_merchant_performance_product_define dcpd ON dcpcc.condition_product_define_id = dcpd.id
LEFT JOIN dj_car_life_merchant_performance_product_define_item dcpdi ON dcpd.id = dcpdi.product_define_id
AND dcpdi.deleted_flag = 'N'
WHERE
dcpcc.deleted_flag = 'N'
AND dcpcc.performance_param_config_id = #{performanceParamConfigId}
ORDER BY
id DESC
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -29,27 +29,19 @@ ...@@ -29,27 +29,19 @@
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" /> <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" /> <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap> </resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.staff.dto.PerformanceParamConfigDTO" extends="BaseResultMap"> <resultMap id="ListByConfigIdResultMap" type="cn.com.glsx.dj.staff.dto.PerformanceParamConfigDTO" extends="BaseResultMap">
<collection property="performanceParamConfigConditions" ofType="cn.com.glsx.dj.staff.dto.PerformanceParamConfigConditionDTO"> <association property="productDefine" javaType="cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.MerchantPerformanceProductDefineDTO">
<id column="cc_id" property="id" jdbcType="INTEGER" /> <id column="product_define_id" property="id" jdbcType="INTEGER" />
<result column="performance_param_config_id" property="performanceParamConfigId" jdbcType="INTEGER" /> <result column="define_type" property="defineType" jdbcType="TINYINT" />
<result column="condition_type" property="conditionType" jdbcType="TINYINT" /> <result column="define_name" property="defineName" jdbcType="VARCHAR" />
<result column="condition_goods_config_type" property="conditionGoodsConfigType" jdbcType="TINYINT" /> <collection property="itemList" ofType="cn.com.glsx.dj.smartcarlife.model.MerchantPerformanceProductDefineItem">
<result column="condition_goods_type" property="conditionGoodsType" jdbcType="INTEGER" /> <id column="product_define_item_id" property="id" jdbcType="INTEGER" />
<result column="condition_goods_type_name" property="conditionGoodsTypeName" jdbcType="VARCHAR" /> <result column="item_id" property="itemId" jdbcType="INTEGER" />
<result column="condition_secondary_goods_type" property="conditionSecondaryGoodsType" jdbcType="INTEGER" /> <result column="item_name" property="itemName" jdbcType="VARCHAR" />
<result column="condition_secondary_goods_type_name" property="conditionSecondaryGoodsTypeName" jdbcType="VARCHAR" /> </collection>
<result column="condition_third_level_goods_type" property="conditionThirdLevelGoodsType" jdbcType="INTEGER" /> </association>
<result column="condition_third_level_goods_type_name" property="conditionThirdLevelGoodsTypeName" jdbcType="VARCHAR" /> <collection property="performanceParamConfigConditions" column="id"
<result column="condition_product_define_id" property="conditionProductDefineId" jdbcType="INTEGER" /> select="cn.com.glsx.dj.staff.mapper.PerformanceParamConfigConditionMapper.listByParamConfigId"/>
<result column="condition_product_define_name" property="conditionProductDefineName" jdbcType="VARCHAR" />
<result column="condition_assessment_factors" property="conditionAssessmentFactors" jdbcType="VARCHAR" />
<result column="condition_start_value" property="conditionStartValue" jdbcType="DECIMAL" />
<result column="condition_end_value" property="conditionEndValue" jdbcType="DECIMAL" />
<result column="condition_commission_base" property="conditionCommissionBase" jdbcType="VARCHAR" />
<result column="condition_commission_type" property="conditionCommissionType" jdbcType="VARCHAR" />
<result column="condition_commission_type_value" property="conditionCommissionTypeValue" jdbcType="DECIMAL" />
</collection>
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
<!-- <!--
...@@ -62,7 +54,7 @@ ...@@ -62,7 +54,7 @@
updated_by, updated_date, deleted_flag updated_by, updated_date, deleted_flag
</sql> </sql>
<select id="listByConfigId" parameterType="cn.com.glsx.dj.staff.dto.PerformanceParamConfigDTO" resultMap="DTOResultMap"> <select id="listByConfigId" parameterType="cn.com.glsx.dj.staff.dto.PerformanceParamConfigDTO" resultMap="ListByConfigIdResultMap">
SELECT SELECT
c.id, c.id,
c.performance_config_id, c.performance_config_id,
...@@ -87,28 +79,16 @@ ...@@ -87,28 +79,16 @@
c.updated_by, c.updated_by,
c.updated_date, c.updated_date,
c.deleted_flag, c.deleted_flag,
cc.id AS cc_id, dcpd.define_type,
cc.performance_param_config_id, dcpd.define_name,
cc.condition_type, dcpdi.id AS product_define_item_id,
cc.condition_goods_config_type, dcpdi.item_id,
cc.condition_goods_type, dcpdi.item_name
cc.condition_goods_type_name,
cc.condition_secondary_goods_type,
cc.condition_secondary_goods_type_name,
cc.condition_third_level_goods_type,
cc.condition_third_level_goods_type_name,
cc.condition_product_define_id,
cc.condition_product_define_name,
cc.condition_assessment_factors,
cc.condition_start_value,
cc.condition_end_value,
cc.condition_commission_base,
cc.condition_commission_type,
cc.condition_commission_type_value
FROM FROM
dj_car_life_performance_param_config c dj_car_life_performance_param_config c
LEFT JOIN dj_car_life_performance_param_config_condition cc ON c.id = cc.performance_param_config_id LEFT JOIN dj_car_life_merchant_performance_product_define dcpd ON c.product_define_id = dcpd.id
AND cc.deleted_flag = 'N' LEFT JOIN dj_car_life_merchant_performance_product_define_item dcpdi ON dcpd.id = dcpdi.product_define_id
AND dcpdi.deleted_flag = 'N'
WHERE WHERE
c.deleted_flag = 'N' c.deleted_flag = 'N'
AND c.performance_config_id = #{performanceConfigId} AND c.performance_config_id = #{performanceConfigId}
......
...@@ -54,11 +54,11 @@ ...@@ -54,11 +54,11 @@
<if test="staffPhone != null and staffPhone != ''"> <if test="staffPhone != null and staffPhone != ''">
AND dclsi.phone_number = #{staffPhone} AND dclsi.phone_number = #{staffPhone}
</if> </if>
<if test="startTime != null and startTime != ''"> <if test="startDate != null and startDate != ''">
AND dclpo.success_date &gt;= #{startTime} AND dclpo.success_date &gt;= #{startDate}
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endDate != null and endDate != ''">
AND dclpo.success_date &lt;= #{endTime} AND dclpo.success_date &lt;= #{endDate}
</if> </if>
<if test="statusList != null and statusList.size > 0"> <if test="statusList != null and statusList.size > 0">
AND dclgo.status IN AND dclgo.status IN
...@@ -69,4 +69,34 @@ ...@@ -69,4 +69,34 @@
</where> </where>
</select> </select>
<select id="statPreSalesTouchCount" resultType="java.lang.Integer">
SELECT
ifnull(sum(equity_to_shop_count), 0)
FROM
dj_car_life_staff_daily_report_huawei dclsdrh
LEFT JOIN dj_car_life_staff_info dclsi ON dclsi.staff_uuid = dclsdrh.staff_uuid
AND dclsi.deleted_flag = 'N'
<where>
dclsdrh.deleted_flag = 'N'
<if test="merchantId != null and merchantId != 0">
AND dclsdrh.merchant_id = #{merchantId}
</if>
<if test="sceneType != null and sceneType != 0">
AND dclsdrh.scene_type = #{sceneType}
</if>
<if test="staffPhone != null and staffPhone != ''">
AND dclsi.phone_number = #{staffPhone}
</if>
<if test="brandId != null and brandId != 0">
AND dclsdrh.first_brand_id = #{brandId}
</if>
<if test="childBrandId != null and childBrandId != 0">
AND dclsdrh.brand_id = #{childBrandId}
</if>
<if test="month != null and month != ''">
AND dclsdrh.report_date &gt;= concat( #{month}, '-01')
AND dclsdrh.report_date &lt; DATE_ADD(concat( #{month}, '-01'), INTERVAL 1 MONTH)
</if>
</where>
</select>
</mapper> </mapper>
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" /> <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" /> <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap> </resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.staff.dto.StaffPerformanceDTO" extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
...@@ -46,4 +49,19 @@ ...@@ -46,4 +49,19 @@
upgrade_order_num, personal_penetration_rate, performance_amount, created_by, created_date, upgrade_order_num, personal_penetration_rate, performance_amount, created_by, created_date,
updated_by, updated_date, deleted_flag updated_by, updated_date, deleted_flag
</sql> </sql>
<select id="listStaffPerformance" resultMap="DTOResultMap">
select
<include refid="Base_Column_List" />
from dj_car_life_staff_performance dclsp
<where>
dclsp.deleted_flag = 'N'
<if test="staffPhone != null">
and dclsp.staff_phone = #{staffPhone}
</if>
<if test="month != null">
and dclsp.month = #{month}
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!