提成计算相关

1 parent 8072747c
Showing 24 changed files with 307 additions and 69 deletions
......@@ -22,6 +22,11 @@
<artifactId>hutool-all</artifactId>
<version>5.8.38</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.6.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
......
......@@ -24,7 +24,7 @@ public class AssessmentFactorDailyDataDTO implements Serializable {
/**
* 该门店的该个人实际售前触客数
*/
private Integer storePreSalesTouchCount;
private Integer storePersonalPreSalesTouchCount;
/**
* 门店总触客数(该门店的所有个人实际售前触客数之和)
......
......@@ -46,4 +46,19 @@ public class AssessmentFactorOrderDataDTO implements Serializable {
* 主订单成交数(门店+业务+品牌)
*/
private Integer mainOrderCountByBrand;
/**
* 主订单成交数(门店+业务+品牌+品类)
*/
private Integer mainOrderCountByBrandAndCategory;
/**
* 子订单成交数(门店+业务+品牌+品类)
*/
private Integer subOrderCountByBrandAndCategory;
/**
* 品类订单产值合计(门店+业务+品牌+品类)
*/
private BigDecimal categoryOrderOutputTotalByBrandAndCategory;
}
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 lombok.Data;
import lombok.ToString;
......@@ -9,4 +10,5 @@ import lombok.experimental.SuperBuilder;
@ToString(callSuper = true)
@Data
public class PerformanceParamConfigConditionDTO extends PerformanceParamConfigCondition {
private MerchantPerformanceProductDefineDTO productDefine;
}
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 lombok.AllArgsConstructor;
import lombok.Data;
......@@ -9,6 +8,8 @@ import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
......@@ -17,5 +18,7 @@ import lombok.experimental.SuperBuilder;
public class PerformanceParamConfigDTO extends PerformanceParamConfig {
private static final long serialVersionUID = 5606800131085599586L;
private MerchantPerformanceProductDefineDTO productDefine;
private List<PerformanceParamConfigConditionDTO> performanceParamConfigConditions;
}
......@@ -44,6 +44,26 @@ public class StaffPerformanceCalContextDTO implements Serializable {
private Map<String, List<StaffPerformanceSubOrderDTO>> groupedOrdersMap;
/**
* 商户ID
*/
private Integer merchantId;
/**
* 业务类型
*/
private Byte businessType;
/**
* 品牌ID
*/
private Integer brandId;
/**
* 子品牌ID
*/
private Integer childBrandId;
/**
* 当前计算的门店提成方案
*/
private PerformanceConfigDTO performanceConfig;
......
......@@ -7,10 +7,11 @@ import lombok.experimental.SuperBuilder;
/**
* 员工绩效计算结果DTO
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Data
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 {
private Integer brandId;
/**
* 品牌ID名称
*/
private String brandName;
/**
* 子品牌ID
*/
private Integer childBrandId;
/**
* 子品牌ID名称
*/
private String childBrandName;
/**
* 升级商品ID
*/
private Integer upgradeGoodsId;
......
package cn.com.glsx.dj.staff.dto.perfSalary;
import cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
/**
* 有效引荐数表
*/
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@ToString(callSuper = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class EffectiveReferralReviewDTO extends EffectiveReferralReview {
private static final long serialVersionUID = 1L;
......
......@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
......@@ -16,11 +15,10 @@ import java.util.Date;
/**
* 员工提成
*/
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@SuperBuilder
@Data
@Table(name = "dj_car_life_staff_performance")
public class StaffPerformance implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -48,7 +46,7 @@ public class StaffPerformance implements Serializable {
@ApiModelProperty(notes = "业务类型(0:轻改,1:权益;2:延保)")
@Column(name = "business_type")
private Integer businessType;
private Byte businessType;
@ApiModelProperty(notes = "主品牌id")
@Column(name = "brand_id")
......
......@@ -6,6 +6,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import java.io.Serializable;
......@@ -17,6 +18,7 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Accessors(chain = true)
@Table(name = "sal_effective_referral_review")
public class EffectiveReferralReview implements Serializable {
......@@ -101,7 +103,7 @@ public class EffectiveReferralReview implements Serializable {
*/
@ApiModelProperty(notes = "业务场景:1-精品升级(轻改);2-会员权益(广联权益);3-单延保;")
@Column(name = "scene_type")
private Integer sceneType;
private Byte sceneType;
/**
* 是否需要总部复核:1-需要
......
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.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
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();
}
@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;
import cn.com.glsx.dj.staff.dto.PerformanceParamConfigConditionDTO;
import cn.com.glsx.dj.staff.model.PerformanceParamConfigCondition;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
public interface PerformanceParamConfigConditionMapper extends OreMapper<PerformanceParamConfigCondition> {
List<PerformanceParamConfigConditionDTO> listByParamConfigId(
PerformanceParamConfigConditionDTO dto);
}
\ No newline at end of file
package cn.com.glsx.dj.staff.mapper;
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.StaffPerformanceSubOrderDTO;
import org.apache.ibatis.annotations.Mapper;
......@@ -21,4 +22,12 @@ public interface StaffPerformanceCalMapper extends OreMapper<StaffPerformanceDTO
* @return 订单列表
*/
List<StaffPerformanceSubOrderDTO> selectStaffOrders(StaffPerformanceOrderQueryDTO query);
/**
* 统计实际售前触客数
*
* @param query 查询参数
* @return 日报数据列表
*/
Integer statPreSalesTouchCount(StaffPerformanceDailyReportQueryDTO query);
}
package cn.com.glsx.dj.staff.mapper;
import cn.com.glsx.dj.staff.dto.StaffPerformanceDTO;
import cn.com.glsx.dj.staff.model.StaffPerformance;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper
public interface StaffPerformanceMapper extends OreMapper<StaffPerformance> {
List<StaffPerformanceDTO> listStaffPerformance(StaffPerformanceDTO dto);
}
\ No newline at end of file
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 org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
......@@ -7,4 +8,11 @@ import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface EffectiveReferralReviewMapper extends OreMapper<EffectiveReferralReview> {
/**
* 根据条件查询单条有效引荐数记录
*
* @param query 查询条件
* @return 记录
*/
EffectiveReferralReviewDTO selectOneByQuery(EffectiveReferralReviewDTO query);
}
\ No newline at end of file
......@@ -7,9 +7,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO;
import javax.annotation.Resource;
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, rollbackFor = RpcServiceException.class)
......@@ -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
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 @@
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
<result column="deleted_flag" jdbcType="VARCHAR" property="deletedFlag"/>
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO" extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List">
id, merchant_id, total_delivery_count, area_effective_count,
reviewed_effective_count, review_month, image_urls, remark,
......@@ -40,5 +42,28 @@
manager_commit_time, reviewed_by, reviewed_name, reviewed_time,
created_by, created_date, updated_by, updated_date, deleted_flag
</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>
\ No newline at end of file
......@@ -29,6 +29,18 @@
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</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" >
<!--
WARNING - @mbg.generated
......@@ -40,4 +52,47 @@
condition_end_value, condition_commission_base, condition_commission_type, condition_commission_type_value,
created_by, created_date, updated_by, updated_date, deleted_flag
</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>
\ No newline at end of file
......@@ -29,27 +29,19 @@
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.staff.dto.PerformanceParamConfigDTO" extends="BaseResultMap">
<collection property="performanceParamConfigConditions" ofType="cn.com.glsx.dj.staff.dto.PerformanceParamConfigConditionDTO">
<id column="cc_id" property="id" jdbcType="INTEGER" />
<result column="performance_param_config_id" property="performanceParamConfigId" jdbcType="INTEGER" />
<result column="condition_type" property="conditionType" jdbcType="TINYINT" />
<result column="condition_goods_config_type" property="conditionGoodsConfigType" jdbcType="TINYINT" />
<result column="condition_goods_type" property="conditionGoodsType" jdbcType="INTEGER" />
<result column="condition_goods_type_name" property="conditionGoodsTypeName" jdbcType="VARCHAR" />
<result column="condition_secondary_goods_type" property="conditionSecondaryGoodsType" jdbcType="INTEGER" />
<result column="condition_secondary_goods_type_name" property="conditionSecondaryGoodsTypeName" jdbcType="VARCHAR" />
<result column="condition_third_level_goods_type" property="conditionThirdLevelGoodsType" jdbcType="INTEGER" />
<result column="condition_third_level_goods_type_name" property="conditionThirdLevelGoodsTypeName" jdbcType="VARCHAR" />
<result column="condition_product_define_id" property="conditionProductDefineId" jdbcType="INTEGER" />
<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 id="ListByConfigIdResultMap" type="cn.com.glsx.dj.staff.dto.PerformanceParamConfigDTO" 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.model.MerchantPerformanceProductDefineItem">
<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>
<collection property="performanceParamConfigConditions" column="id"
select="cn.com.glsx.dj.staff.mapper.PerformanceParamConfigConditionMapper.listByParamConfigId"/>
</resultMap>
<sql id="Base_Column_List" >
<!--
......@@ -62,7 +54,7 @@
updated_by, updated_date, deleted_flag
</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
c.id,
c.performance_config_id,
......@@ -87,28 +79,16 @@
c.updated_by,
c.updated_date,
c.deleted_flag,
cc.id AS cc_id,
cc.performance_param_config_id,
cc.condition_type,
cc.condition_goods_config_type,
cc.condition_goods_type,
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
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 c
LEFT JOIN dj_car_life_performance_param_config_condition cc ON c.id = cc.performance_param_config_id
AND cc.deleted_flag = 'N'
LEFT JOIN dj_car_life_merchant_performance_product_define dcpd ON c.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
c.deleted_flag = 'N'
AND c.performance_config_id = #{performanceConfigId}
......
......@@ -54,11 +54,11 @@
<if test="staffPhone != null and staffPhone != ''">
AND dclsi.phone_number = #{staffPhone}
</if>
<if test="startTime != null and startTime != ''">
AND dclpo.success_date &gt;= #{startTime}
<if test="startDate != null and startDate != ''">
AND dclpo.success_date &gt;= #{startDate}
</if>
<if test="endTime != null and endTime != ''">
AND dclpo.success_date &lt;= #{endTime}
<if test="endDate != null and endDate != ''">
AND dclpo.success_date &lt;= #{endDate}
</if>
<if test="statusList != null and statusList.size > 0">
AND dclgo.status IN
......@@ -69,4 +69,34 @@
</where>
</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>
......@@ -35,6 +35,9 @@
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.staff.dto.StaffPerformanceDTO" extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
......@@ -46,4 +49,19 @@
upgrade_order_num, personal_penetration_rate, performance_amount, created_by, created_date,
updated_by, updated_date, deleted_flag
</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>
\ 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!