<?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.VivoProductDao">

    <select id="queryMainProductList" resultType="map" parameterType="string">
        SELECT CHANNEL, CPID, SPID, IP, BUSITYPE, INVOKEFACE
        FROM TB_UNIFIEDLIMIT_CONFIG
        WHERE STATUS = '0'
          AND CHANNEL = #{channel}
    </select>

    <select id="isBlackUser" resultType="Integer">
        select count(userid) from TB_BLACKWHITE_LIST where userid=#{userid} and (cpid='0' or cpid=#{cpid}) and type=1 AND (STATUS is null or STATUS = 0)
    </select>

    <select id="isActive" resultType="java.lang.Integer">
        select  count(1)
        from TD_ORDER_RELATIONS where  userid=#{userid} and  spid=#{spid} and (endtime is  null  or  endtime >sysdate )
    </select>

    <select id="findSpInfo" parameterType="string"  resultType="HashMap" >
        select cpid, spid, spname, price, vacproductid, spcode, type, feetype, cancancelorder, canorder,
               errorhandle,duration,canaccumulation,mutex,relationSp,paytype,needUnifiedAuthSync,spcodename,haslocal
        from tb_sp_info where spid=#{spid}
    </select>
</mapper>
