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


     <select id="getOrderByOrderid" parameterType="string" resultType="HashMap" >
       SELECT * FROM TD_CSMAKEUP_ORDER_REC WHERE ORDERID = #{orderid}           
    </select>
    
    <select id="getBusiConf" parameterType="string" resultType="Map">
		SELECT * FROM TB_CSMAKEUP_PROD_CONF A WHERE A.STATUS = '0' AND A.MUSPID = #{muspid} AND BUSITYPE IN ('1','2','3')
	</select> 
	
    <insert id="addOrderRec" parameterType="Map">
       INSERT INTO TD_CSMAKEUP_ORDER_REC(
			ID,USERID,ORDERID,CHANNEL,CPID,MUSPID,PROVINCE,AREA,VIPRECODE,VIPREINFO,RESULTCODE,RESULTINFO,TIMES,STATUS,INSERTTIME )
 		VALUES(#{ID},#{USERID},#{ORDERID},#{CHANNEL},#{CPID},#{MUSPID},#{PROVINCE},#{AREA},#{VIPRECODE},#{VIPREINFO},#{RESULTCODE},#{RESULTINFO},#{TIMES},#{STATUS},SYSDATE)
    </insert> 
    
    <select id="getNo" resultType="String" >
       SELECT TO_CHAR(SYSDATE,'yyyyMMddhh24miss')||SEQ_COMMON6.nextval SENO FROM DUAL       
    </select>
    
    <select id="getOrderRec" parameterType="string" resultType="Map">
		SELECT * FROM TD_CSMAKEUP_ORDER_REC WHERE USERID = #{userid} AND RESULTCODE = '0' AND MUSPID = #{muspid} ORDER BY INSERTTIME DESC
	</select> 
</mapper>