package com.lz.modules.sys.dao.app;
/**
* <p>
* 业绩详情表 服务类
* </p>
*
* @author quyixiao
* @since 2020-08-10
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.common.utils.BigDecimalUtil;
import com.lz.modules.flow.model.ResultDetailDto;
import com.lz.modules.sys.entity.app.ResultDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface ResultDetailMapper extends BaseMapper<ResultDetail> {


	ResultDetail selectResultDetailById(@Param("id") Long id);


	Long insertResultDetail(ResultDetail resultDetail);


	int updateResultDetailById(ResultDetail resultDetail);


	int updateCoverResultDetailById(ResultDetail resultDetail);


	int deleteResultDetailById(@Param("id") Long id);


    List<ResultDetail> selectByRecordId(@Param("recordResultId") Long recordResultId);

	List<ResultDetail> selectByRecordIdType(@Param("recordResultId") Long recordResultId, @Param("type") Integer type);

	//计算业务/价值观得分
	BigDecimal calculateScore(@Param("recordId") Long recordId, @Param("staffId") Long staffId,@Param("type") Integer type);

    Long insertResultDetails(@Param("list") List<ResultDetail> resultDetails);

    List<ResultDetailDto> selectDtosByRecordId(@Param("recordResultId") Long id, @Param("modelId") Long modelId);

    int deleteResultDetailByRecordId(@Param("recordId") Long recordId);

	ResultDetail selectNotNoticeResultDetailByBackId(@Param("backId") Long backId);

    List<ResultDetail> selectNotNoticeResultDetailByRecordId(@Param("recordId") Long recordId);
}