<?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.chinacreator.video.restful.dao.SendSmsCodeDao">



    <insert id="insertTlVerifiCationCode" parameterType="com.chinacreator.video.restful.bean.TlVerifiCationCodeBean">
        insert into TL_VERIFICATION_CODE(ROWNO,CPID,USERID,VERCODE,MAKETIME,SENDSTATUS,REMARK,CHANNEL)
        values   (to_char(sysdate,'yyyyMMddhh24miss')||SEQ_COMMON6.nextval,#{cpid},#{userid},#{vercode},#{makeTime},#{sendStatus},#{remark},#{channel})
    </insert>

    <select id="checkValidatTime" resultType="java.lang.String" parameterType="string">
        select (SYSDATE - TO_DATE (MAKETIME, 'yyyy-mm-dd hh24:mi:ss')) * 24 * 3600 from TL_VERIFICATION_CODE  where USERID=#{phone} AND CPID=#{cpid}and  (SYSDATE - TO_DATE (MAKETIME, 'yyyy-mm-dd hh24:mi:ss')) * 24 * 3600 &lt; 60
    </select>

    <select id="checkTransfer" resultType="java.lang.String" parameterType="string">
                select count(*) count from wosdk.tb_transfer_number where userid=#{userid} and status='0'
    </select>

    <select id="checkArea" resultType="java.lang.String" parameterType="string">
        select count(*) count from TB_CALLER_AREACODE t where operators='联通' and status='0' and callerhead=#{phone}
    </select>
</mapper>