<?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.xxfc.platform.vehicle.mapper.SysRegionMapper">

    <select id="getAllByPage" parameterType="java.util.Map"
            resultType="com.xxfc.platform.vehicle.entity.SysRegion">
        select `id`, parent_id, `name`, `type`, agency_id from sys_region limit #{pageStart},${pageSize}
    </select>

    <select id="getByIdList" parameterType="java.util.List"
            resultType="com.xxfc.platform.vehicle.entity.SysRegion">
        select `id`, parent_id, `name`, `type`, agency_id from sys_region where id in
        <foreach collection="list" index="i" item="item" open="(" close=")" separator=",">
            #{item}
        </foreach>
    </select>

    <select id="getNumber" resultType="Integer">
        select `id` from sys_region  where  name  like  CONCAT('%',#{name},'%') limit 1
    </select>

    <select id="getName" resultType="String">
        select `name` from sys_region  where  id=#{code}
    </select>
    <select id="getNumberV2" resultType="Integer">
        select `id` from sys_region  where  name  like  CONCAT('%',#{name},'%') and type=#{type} limit 1
    </select>

</mapper>