<?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.zhongzheng.modules.pay.mapper.PayPayeeAisleMapper">

    <resultMap type="com.zhongzheng.modules.pay.domain.PayPayeeAisle" id="PayPayeeAisleResult">
        <result property="accountId" column="account_id"/>
        <result property="payeeId" column="payee_id"/>
        <result property="aisleId" column="aisle_id"/>
        <result property="status" column="status"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
        <result property="payeeAccount" column="payee_account"/>
    </resultMap>

    <resultMap type="com.zhongzheng.modules.pay.vo.PayPayeeAisleVo" id="PayPayeeAisleVoResult">
        <result property="accountId" column="account_id"/>
        <result property="payeeId" column="payee_id"/>
        <result property="aisleId" column="aisle_id"/>
        <result property="status" column="status"/>
        <result property="payeeAccount" column="payee_account"/>
        <result property="payeeName" column="payee_name"/>
        <result property="payWay" column="pay_way"/>
        <result property="typeStatus" column="type_status"/>
    </resultMap>




    <select id="queryList" parameterType="com.zhongzheng.modules.pay.bo.PayPayeeAisleQueryBo"  resultMap="PayPayeeAisleVoResult">
        SELECT
            p.*,
            y.payee_name,
            a.pay_way
        FROM
            pay_payee_aisle p
                LEFT JOIN pay_payee y on p.payee_id =y.payee_id
                LEFT JOIN pay_aisle a on a.aisle_id = p.aisle_id
        where 1=1
        <if test="status != null and status.size()!=0 ">
            AND p.status in
            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="accountId != null and accountId != ''">
            AND p.account_id = #{accountId}
        </if>
    </select>

</mapper>
