<?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="org.springblade.modules.guosen.ordercommission.mapper.OrderCommissionMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="orderCommissionResultMap" type="org.springblade.modules.guosen.ordercommission.entity.OrderCommission">
        <result column="id" property="id"/>
        <result column="status" property="status"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="order_id" property="orderId"/>
        <result column="agenter_id" property="agenterId"/>
        <result column="amt" property="amt"/>
        <result column="rate" property="rate"/>
        <result column="type" property="type"/>
    </resultMap>


    <select id="selectOrderCommissionPage" resultMap="orderCommissionResultMap">
        select coc.* from cyzh_order_commission coc ,cyzh_agenter ca,cyzh_login_user  clu where coc.is_deleted = 0
        <if test="orderCommission != null">
            <if test="orderCommission.isProxy">
                and coc.agenter_id = ca.id and ca.user_id = clu.id and clu.phone ='${orderCommission.phone}'
            </if>
        </if>
    </select>

</mapper>
