<?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.mapper.QueenCardDao" >


    <select id="getOrder" parameterType="string" resultType="HashMap" >
       SELECT SERIALNUMBER,TO_CHAR(ORDERTIME, 'yyyymmddhh24miss') ORDERTIME, TO_CHAR(CANCELTIME, 'yyyymmddhh24miss') CANCELTIME, STATUS, VIPMON, PRODUCTID FROM TD_KAFKA_QUEENCARD_ORDER WHERE SERIALNUMBER = #{userid}
    </select>

    <select id="getBackOrder" parameterType="string" resultType="Map">
		SELECT TO_CHAR(INSERTTIME, 'yyyymmddhh24miss') ORDERTIME, TO_CHAR(RETRYTIME, 'yyyymmddhh24miss') RETRYTIME, SPID, CPID, CHANNEL,RESULTCODE,RESULTINFO,VIPSTATUS,PROVINCE,AREA FROM TD_BACKBUSI_ORDER_REC WHERE USERID = #{userid} AND CHANNEL = 'TX20_twback_qc' ORDER BY INSERTTIME DESC
	</select>

    <select  id="findOrderRelaAll" parameterType="string"  resultType="HashMap" >
	SELECT CPID,SPID,USERID, TO_CHAR(ORDERTIME, 'yyyymmddhh24miss') ORDERTIME,
            TO_CHAR(endtime, 'yyyymmddhh24miss') endtime, TO_CHAR(CANCELTIME, 'yyyymmddhh24miss') CANCELTIME,
            (case when endtime is null then '0' when endtime >= sysdate then '1' else '2' end) STATUS
            FROM NET3G.TD_ORDER_RELATIONS WHERE USERID = #{userid} AND ORDERCHANNEL = 'TX20_twback_qc'
	</select>

    <select id="isWhiteList" parameterType="string" resultType="java.lang.Integer">

        select count(*) from TD_WHITE_QUNENN_ONE_LIST where userid = #{userid}
    </select>

</mapper>
