package com.hfkj.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * mapper扩展类
 */
public interface BsMerchantChainBrandMapperExt {
    
    @Select("<script>" +
            " SELECT " +
            " a.id," +
            " a.`name`," +
            " a.contacts_name contactsName," +
            " a.contacts_telephone contactsTelephone," +
            " b.amount," +
            " b.amount_consume amountConsume," +
            " a.create_time createTime" +
            " FROM bs_merchant_chain_brand a" +
            " LEFT JOIN bs_merchant_chain_brand_account b on b.mer_chain_brand_id = a.id" +
            " where 1 = 1" +
            " <if test='param.name != null'> and a.name like concat('%',#{param.name},'%') </if>" +
            " ORDER BY b.amount asc" +
            "</script>")
    List<Map<String,Object>> selectChainBrand(@Param("param") Map<String,Object> param);
}
