package com.yonge.cooleshow.biz.dal.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yonge.cooleshow.biz.dal.dto.search.SysUserContractRecordSearch;
import com.yonge.cooleshow.biz.dal.entity.SysUserContractRecord;
import com.yonge.cooleshow.biz.dal.vo.SysUserContractRecordVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户协议记录表-一个用户一种协议一个版本一条记录(SysUserContractRecord)表数据库访问层
 *
 * @author hgw
 * @since 2022-05-07 15:04:05
 */
public interface SysUserContractRecordDao extends BaseMapper<SysUserContractRecord> {
    /**
     * 查询详情
     *
     * @author liweifan
     * @date 2022-06-16 13:47:21
     * @return: com.yonge.cooleshow.biz.dal.vo.SysUserContractRecordVo
     */
    SysUserContractRecordVo detail(@Param("id") Long id);

    /**
     * 分页查询
     *
     * @author liweifan
     * @date 2022-06-16 13:47:21
     * @return: com.yonge.cooleshow.biz.dal.vo.SysUserContractRecordVo
     */
    List<SysUserContractRecordVo> selectPage(@Param("page") IPage page, @Param("param") SysUserContractRecordSearch sysUserContractRecord);

    int insertBatch(@Param("entities") List<SysUserContractRecord> entities);

    Boolean checkContractSign(@Param("userId") Long userId, @Param("userType") String userType, @Param("contractSource") String contractSource, @Param("contractType") String contractType);

    SysUserContractRecord queryLatestContract(@Param("userId") Long userId, @Param("userType") String userType, @Param("contractSource") String contractSource, @Param("contractType") String contractType);

    void contractCallbackUpdate(@Param("status") String status,
                                @Param("serialNo") String serialNo,
                                @Param("url") String url,
                                @Param("errMsg") String errMsg);


}

