package org.ta.pddserver.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.ta.pdd.entity.LogsMailScanEntity;
import org.ta.pddserver.model.api.request.LogsMailScanListVORequest;

import java.util.List;

@Mapper
public interface LogsMailScanMapper extends BaseMapper<LogsMailScanEntity> {

    @Select("SELECT a.`uid`, a.`mailNo`, a.`created`, a.`action`, b.`name` AS `author` FROM `logs_mail_scan` a, `user` b  WHERE a.`mailNo` = #{mailNo} AND a.`author` = b.`account` ;")
    List<LogsMailScanEntity> selectByMailNo(@Param("mailNo") String mailNo);

    @Select("SELECT a.`uid`, a.`mailNo`, a.`created`, a.`action`, b.`name` AS `author` FROM `logs_mail_scan` a, `user` b  WHERE a.`mailNo` = #{mailNo} AND a.`author` = b.`account` ;")
    List<LogsMailScanEntity> logsMailScanList(LogsMailScanListVORequest param);

}
