<?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.zfire.mall.manager.commonmapper.manage.product.PriceSaleTypeRelaReserveMapper">
    <select id="v2ListPage" resultType="com.zfire.mall.manager.bean.manage.v2.product.price.PriceSaleTypeRelaVO">
        SELECT
            a.*,
            b.sale_code,
            b.sale_name,
            c.price_type_code,
            c.price_type_name,
            d.name as 'walletName',
            e.name as 'walletName2'
        FROM
        price_sale_type_rela a
            LEFT JOIN sale_type b ON a.sale_id = b.id
            LEFT JOIN price_type c ON a.price_type_id = c.price_type_id
            left join king_dee_wallet d on d.id=a.wallet_id
            left join wallet_rebate e on e.wallet_rebate_id = a.wallet_id2
        ${ex.query}
        AND a.del = 0
        <if test="ex.orderBy == null or ex.orderBy ==''">
            ORDER BY a.create_time DESC
        </if>
        ${ex.orderBy}
    </select>
</mapper>