package com.wgb.system.service.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wgb.system.service.domain.model.UserTask;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserTaskMapper extends BaseMapper<UserTask> {

    @Select("SELECT id,business_id,user_id,create_time,updata_time FROM user_task WHERE business_id = #{businessId}  ORDER BY create_time DESC LIMIT 1")
    @Results(id = "menu", value = {
            @Result(property = "id", column = "id"),
            @Result(property = "businessId", column = "business_id"),
            @Result(property = "userId", column = "user_id"),
            @Result(property = "createTime", column = "create_time"),
            @Result(property = "updataTime", column = "updata_time")
    })
    UserTask getlastUserTask(@Param("businessId")Long businessId);
}
