<?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.xhpc.general.mapper.XhpcAreaMapper">

    <select id="selectBy" resultType="map">
        select name, code
        from xhpc_area
        <if test="code != null and code != ''">
            where pcode = #{code}
        </if>
        <if test="code == null || code == ''">
            where pcode = 100000
        </if>
    </select>

</mapper>