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

    <insert id="insertChannelInfo">
      insert into TD_CHANNEL_SYNC_REC(ID,USERID,ORDERID,CPID,SPID,TYPE,PROVINCE,AREA,CHANNEL)
       VALUES(to_char(sysdate, 'yyyymmddhh24miss') || SEQ_COMMON6.nextval,
       #{userid},#{id},#{cpid},#{spid},#{type},#{province},#{area},#{channel})
    </insert>

    <select id="findBySpid" resultType="java.lang.Integer">
        select count(1) from TB_CHANNEL_SYNC_CONF  where  cpid=#{cpid} and spid=#{spid} and status='0'
    </select>
</mapper>