<?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="bus.mapper.BRegionMapper">

 <select id="list" parameterType="bus.model.dto.BRegionPageDto" resultType="bus.model.dto.BRegionDto">
   select
   id,
   ad_code,
   center,
   city_code,
   level,
   name,
   sort,
   parent_id,
   path
   from
   b_region
<where>
    <if test="name != null and name != ''">
      and name like concat('%',#{name},'%')
    </if>
    <if test="parentId != null and parentId != ''">
      and parent_id = #{parentId}
    </if>
    <if test="id != null and id != ''">
      and id = #{id}
    </if>
</where>
 </select>

</mapper>
