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

    <select id="getNo" resultType="String">
       SELECT TO_CHAR(SYSDATE,'yyyyMMddhh24miss')||SEQ_COMMON6.nextval SENO FROM DUAL       
    </select>

    <insert id="addSbchannelRec" parameterType="Map">
       INSERT INTO td_sbchannel_rec(
			ID,ORDERID,USERID,CPID,SPID,TOKEN,REQUEST)
 		VALUES(#{id},#{orderid},#{userid},#{cpid},#{spid},#{token},#{request})
    </insert>

    <update id="upSbchannelRec" parameterType="Map">
		UPDATE td_sbchannel_rec SET resultcode = #{resultcode},resultinfo = #{resultinfo}
		WHERE ID = #{id}
	</update>

    <select id="findOrderStatus" parameterType="string"  resultType="HashMap">
        select ID,STATUS from td_order_relations where orderchannel = 'WP_sb26' and userid =#{userid}
	</select>
</mapper>