package com.hzs.member.detail.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.member.detail.CuMemberServiceLog;
import com.hzs.common.domain.member.detail.CuMemberServiceLogExt;
import com.hzs.member.detail.vo.CuMemberServiceLogVO;
import com.hzs.member.handlebusiness.vo.BusinessMemberVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 会员更名、密码修改表 Mapper 接口
 *
 * @author hzs
 * @since 2022-08-22
 */
public interface CuMemberServiceLogMapper extends BaseMapper<CuMemberServiceLog> {

    Integer selectByMaxApproveNumber(@Param("pkMember") Long pkMember, @Param("editType") Integer editType, @Param("approveStatus") Integer approveStatus);

    /**
     * @description: 查询会员办理业务日志最新数据
     * @author: zhang jing
     * @date: 2023/3/24 9:08
     * @param: [pkMember, editType, approveStatus]
     * @return: com.hzs.member.detail.vo.CuMemberServiceLogVO
     **/
    CuMemberServiceLog selectTopData(@Param("pkMember") Long pkMember,
                                     @Param("editType") int editType,
                                     @Param("approveStatus") int approveStatus);

    /**
     * @description: 查询用户是否已经存在未审核业务
     * @author: zhang jing
     * @date: 2023/1/29 17:26
     * @param: [cuMemberServiceLogVO]
     * @return: java.util.List<com.hzs.common.domain.member.detail.CuMemberServiceLog>
     **/
    List<CuMemberServiceLogVO> selectServiceLogList(CuMemberServiceLogVO cuMemberServiceLogVO);

    /**
     * 查询
     *
     * @param cuMemberServiceLog
     * @return
     */
    List<CuMemberServiceLogExt> selectByServiceLogList(CuMemberServiceLog cuMemberServiceLog);

    /**
     * @description: 查询审核通过的最新数据
     * @author: zhang jing
     * @date: 2023/1/30 10:02
     * @param: [cuMemberServiceLogVO]
     * @return: com.hzs.member.detail.vo.CuMemberServiceLogVO
     **/
    CuMemberServiceLogVO selectNewestServiceLog(CuMemberServiceLogVO cuMemberServiceLogVO);

    /**
     * @description: 查询会员原值
     * @author: zhang jing
     * @date: 2023/1/30 14:20
     * @param: [cuMemberOldValueVO]
     * @return: java.util.List<com.hzs.member.handleBusiness.vo.CuMemberOldValueVO>
     **/
    List<BusinessMemberVO> selectOldValue(BusinessMemberVO businessMemberVO);


    /**
     * 根据用户、业务类型查询业务办理仩
     *
     * @param cuMemberServiceLog 业务信息
     * @return List<CuMemberServiceLogExt>
     */
    List<CuMemberServiceLog> selectServiceValue(CuMemberServiceLogExt cuMemberServiceLog);

    /**
     * 查询pk_id最大的业务办理
     *
     * @param pkMember     服务log
     * @param editTypeList 业务办理类型
     */
    List<CuMemberServiceLog> queryMaxCuMemberServiceLog(@Param("pkMember") Long pkMember,
                                                        @Param("editTypeList") List<Integer> editTypeList);

    /**
     * 查询列表信息
     *
     * @param editType
     * @param memberCode
     * @param memberName
     * @return
     */
    List<CuMemberServiceLog> queryList(@Param("editType") Integer editType, @Param("memberCode") String memberCode, @Param("memberName") String memberName, @Param("pkCountry") Integer pkCountry, @Param("approveStatus") Integer approveStatus);

    /**
     * 查询展示列表
     *
     * @return
     */
    List<CuMemberServiceLog> selectByList(CuMemberServiceLogExt memberServiceLogExt);

    /**
     * 查询指定会员政策币信息
     *
     * @param pkMember 会员ID
     * @return
     */
    CuMemberServiceLogExt queryPolicy(@Param("pkMember") Long pkMember);

    /**
     * @description: 查询会员办理业务日志表最新数据
     * @author: zhang jing
     * @date: 2024/11/21 9:56
     * @param: [pkMember, editTypeList, approveStatus]
     * @return: java.util.List<com.hzs.common.domain.member.detail.CuMemberServiceLog>
     **/
    List<CuMemberServiceLog> selectTopDataList(@Param("pkMember") Long pkMember,
                                               @Param("editTypeList") List<Integer> editTypeList,
                                               @Param("approveStatus") int approveStatus,
                                               @Param("actEndDateStr") String actEndDateStr);

}
