<?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.ruoyi.web.modules.region.mapper.BizRegionMapper">

    <resultMap id="BizRegionResult" type="com.ruoyi.web.modules.region.domain.BizRegion">
        <id property="id" column="id"/>
        <result property="pid" column="pid"/>
        <result property="name" column="name"/>
        <result property="type" column="type"/>
        <result property="code" column="code"/>
    </resultMap>

    <select id="selectAll" resultMap="BizRegionResult">
        select id, pid, name, type, code
        from biz_region
        order by type asc, code asc, id asc
    </select>

    <select id="selectByIds" resultMap="BizRegionResult">
        select id, pid, name, type, code
        from biz_region
        where id in
        <foreach collection="ids" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </select>

    <select id="selectById" resultMap="BizRegionResult">
        select id, pid, name, type, code
        from biz_region
        where id = #{id}
    </select>

    <select id="selectByCode" resultMap="BizRegionResult">
        select id, pid, name, type, code
        from biz_region
        where code = #{code}
        limit 1
    </select>

</mapper>
