<?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.SmsWhiteDao">
    <select id="isBlackUserCanSend" resultType="java.lang.Long" parameterType="string">
        select count(1) from tb_smsblackwhite_list
        where userid=#{phone} and (cpid=#{cpid} or cpid='0') and status =0 and CANVALIDATE =0
    </select>
    <select id="isWhiteUserCanSend" resultType="java.lang.Long">
     select count(1) from tb_smsblackwhite_list where userid=#{phone} and (cpid=#{cpid} or cpid='0') and status =2
    </select>
    <select id="isBlackUserCanValidate" resultType="java.lang.Long" parameterType="string">
        select count(1) from tb_smsblackwhite_list
        where userid=#{userid} and (cpid=#{cpid} or cpid='0') and status =0 and CANVALIDATE =0
    </select>
</mapper>