<?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.lz.modules.app.dao.CodeRecordDao">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.lz.modules.app.entity.CodeRecordEntity" id="codeRecordMap">
        <result property="id" column="id"/>
        <result property="isDelete" column="is_delete"/>
        <result property="gmtCreate" column="gmt_create"/>
        <result property="gmtModified" column="gmt_modified"/>
        <result property="type" column="type"/>
        <result property="userId" column="user_id"/>
        <result property="sendAccount" column="send_account"/>
        <result property="verifyCode" column="verify_code"/>
        <result property="result" column="result"/>
        <result property="isCheck" column="is_check"/>
    </resultMap>

    <select id="getNoCerifyCode" resultType="com.lz.modules.app.entity.CodeRecordEntity">
        select * from lz_code_record where type=#{type} and is_check=0 and send_account=#{mobile} and gmt_create>DATE_SUB(now(),interval 30 minute) limit 1
    </select>


</mapper>
