//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.luozhihui.project.mapper;

import com.luozhihui.project.entity.Phone;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.transaction.annotation.Transactional;

@Mapper
public interface PhoneMapper {
    @Insert({"insert into `phone`(`phone`,`code`) VALUES(#{phone},#{code})"})
    @Transactional
    void save(Phone user);

    @Select({"select * from `phone` where `phone` = #{phone}"})
    boolean findByPhone(String phone);

    @Delete({"delete  from  `phone` where `phone`=#{phone}"})
    void deleteCode(String phone);

    @Select({"select `code` from  `phone` where `phone`=#{phone}"})
    List<String> findByCode(@Param("phone") String phone);
}
