package com.dingtalk.h5app.quickstart.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Shawn
 */
@Mapper
public interface CronMapper {

        @Insert("insert into english_job(JobID,cron,userid,frequency) values(#{JobID},#{cron},#{userid},#{frequency})")
        int addCron(String JobID,String cron,String userid,String frequency);

        @Select("select frequency from english_job where userid = #{userid}")
        List<String> selectCron(String userid);

        @Select("select JobID from english_job where userid = #{userid} and frequency = #{frequency}")
        String getJobID(String userid,String frequency);

        @Delete("delete from english_job where userid = #{userid} and frequency = #{frequency}")
        int deleteTimer(String userid,String frequency);
}
