123456789101112131415161718192021222324252627282930 |
- <?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.demo.wjj.mapper.RegionMapper">
- <resultMap id="region" type="com.demo.wjj.po.Region">
- <id column="id" property="id"/>
- <result column="name" property="name"/>
- <result column="region_type" property="regionType"/>
- </resultMap>
- <!--查询区域-->
- <select id="selectRegion" resultMap="region">
- SELECT r.id, r.name, r.region_type
- FROM tb_region r
- WHERE r.can_enable = 1 AND r.region_type = #{regionType}
- <if test="parentId != null">
- AND r.parent_id = #{parentId}
- </if>
- ORDER BY r.sort_no, r.name
- </select>
- <select id="selectRegionList" resultMap="region">
- SELECT r.id, r.name, r.region_type
- FROM tb_region r
- WHERE r.can_enable = 1 AND r.id IN
- <foreach collection="ids" item="id" separator="," open="(" close=")">
- #{id}
- </foreach>
- </select>
- </mapper>
|