<?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.KuaiShouHelpDao">
    <insert id="save" parameterType="com.chinacreator.video.bean.KuaiShouHelpBean">
        INSERT INTO TD_KUAISHOUHELP_INFO(ID,USERID,MESSAGE,INSERTTIME
        )
        VALUES(TO_CHAR(SYSDATE,'yyyyMMddhh24miss')||SEQ_COMMON6.nextval,#{userid},#{message},SYSDATE)
    </insert>

    <insert id="savePv" parameterType="java.lang.String">
        INSERT INTO TL_KUAISHOUHELP_LOG(ID,IP,INSERTTIME
        )
        VALUES(TO_CHAR(SYSDATE,'yyyyMMddhh24miss')||SEQ_COMMON6.nextval,#{ip},SYSDATE)
    </insert>

    <select id="findCount"  resultType="java.lang.Integer">
        select now from tb_counter_rec where countermonth = to_char(sysdate,'yyyymm')
    </select>

    <select id="findMangoCount"  resultType="java.lang.Integer">
        select now from TB_COUNTER_MG_REC where countermonth = to_char(sysdate,'yyyymm')
    </select>

    <select id="queryOrderRelation"  resultType="java.lang.Integer">
        select count(1)  from TD_ORDER_RELATIONS where spid in(select spid from TD_KUAISHOU_ORDER_QUERY where state = '0')AND ( ENDTIME IS NULL OR (ENDTIME IS NOT NULL AND ENDTIME > SYSDATE)) and userid = #{userid}
    </select>

</mapper>
