<?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.czg.service.account.mapper.ShopConfigMapper">

    <select id="findBranchList" resultType="com.czg.account.dto.ShopBranchDTO">
        select t1.*,
               t2.shop_name,
               t2.phone,
               t3.account,
               t2.shop_type
        from tb_shop_config t1
        left join tb_shop_info t2 on t1.id = t2.id
        left join sys_user t3 on t1.id = t3.id
        where t1.main_id = #{shopId}
        <if test="branchShopName != null and branchShopName != ''">
        and t2.shop_name like concat('%', #{branchShopName}, '%')
        </if>
    </select>
</mapper>