<?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.liquidnet.service.smile.mapper.SmileAgentMapper">

    <select id="listAgentByShowIdAndTicketId" resultType="com.liquidnet.service.smile.entity.SmileAgent">
        select id,performance_id from smile_agent
        <where>
            <if test="performanceId!=''">
                AND performance_id = #{performanceId}
            </if>
            <if test="ticketId!=''">
                AND ticket_id = #{ticketId}
            </if>
        </where>
    </select>

    <update id="updateAgentById">
        update smile_agent
        set ord_carry = #{ordCarry}, total_carry = #{totalCarry}
        where id = #{id}
    </update>

    <insert id="insertAgent">
        INSERT INTO `smile_agent` VALUES (NULL, #{performancesId}, #{ticketId}, 0, 0, 0);
    </insert>
</mapper>
