<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhkjedu.suser.mapper.system.MsgMapper">
    <!-- 1分钟内发送短信次数 -->
    <select id="getMsgNumByUserPhone" resultType="java.lang.Integer">
        select count(*) from t_msg where userphone=#{userphone} and createtime>=UNIX_TIMESTAMP(now())-60
    </select>
    <!--根据手机号和验证码获取短信信息-->
    <select id="findByUserPhoneAndCode" resultType="com.xhkjedu.suser.model.system.TMsg">
        select msgid,msgtxt,msgcode,userphone,createtime
        from t_msg where userphone=#{userphone} and msgcode=#{msgcode} limit 1
    </select>
</mapper>
