提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.system.dal.mysql.sms; |
H |
2 |
|
|
3 |
import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
|
4 |
import com.iailab.framework.mybatis.core.query.QueryWrapperX; |
|
5 |
import com.iailab.module.system.dal.dataobject.sms.SmsCodeDO; |
|
6 |
import org.apache.ibatis.annotations.Mapper; |
|
7 |
|
|
8 |
@Mapper |
|
9 |
public interface SmsCodeMapper extends BaseMapperX<SmsCodeDO> { |
|
10 |
|
|
11 |
/** |
|
12 |
* 获得手机号的最后一个手机验证码 |
|
13 |
* |
|
14 |
* @param mobile 手机号 |
|
15 |
* @param scene 发送场景,选填 |
|
16 |
* @param code 验证码 选填 |
|
17 |
* @return 手机验证码 |
|
18 |
*/ |
|
19 |
default SmsCodeDO selectLastByMobile(String mobile, String code, Integer scene) { |
|
20 |
return selectOne(new QueryWrapperX<SmsCodeDO>() |
|
21 |
.eq("mobile", mobile) |
|
22 |
.eqIfPresent("scene", scene) |
|
23 |
.eqIfPresent("code", code) |
|
24 |
.orderByDesc("id") |
|
25 |
.limitN(1)); |
|
26 |
} |
|
27 |
|
|
28 |
} |