<?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.fdkankan.ucenter.mapper.IVirtualOrderMapper">

    <select id="pageList" resultType="com.fdkankan.ucenter.vo.response.VirtualOrderVo">
        SELECT o.id, o.order_sn, o.points, c.child_name, o.pay_type, o.body, o.trade_time, o.status
        from t_virtual_order o LEFT JOIN t_camera c on o.camera_id = c.id
        where o.rec_status = 'A' and o.pay_status = 1 and o.pay_type = 0
        <if test="param.userId!=null">
            and o.user_id = #{param.userId}
        </if>
        <if test="param.status!=null and param.status!=''">
            and o.status = #{param.status}
        </if>
        <if test="param.childName!=null and param.childName!=''">
            and c.child_name like concat('%', #{param.childName},'%')
        </if>
        <if test="param.cameraId !=null">
           and o.camera_id = #{param.cameraId}
        </if>
    </select>
</mapper>
