<?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.srs.dormitory.mapper.DmsCampusMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.srs.dormitory.domain.DmsCampus">
        <id column="id" property="id" />
        <result column="name" property="name" />
        <result column="remark" property="remark" />
        <result column="create_by" property="createBy" />
        <result column="create_time" property="createTime" />
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="del_flag" property="delFlag" />
    </resultMap>
    <resultMap id="listMap" type="com.srs.dormitory.domain.Vo.CampusVo">
        <id column="id" property="id" />
        <collection property="parkList" column="id" ofType="com.srs.dormitory.domain.Vo.ParkVo"
                    select="com.srs.dormitory.mapper.DmsDormitoryParkMapper.getParkListByCampusId"/>
    </resultMap>
    <select id="selectCapusList" resultMap="listMap">
        select c.id,c.name,c.create_time
        from dms_campus c
        <where>
            and c.del_flag = '0'
            <if test="name != null">and c.name like '%#{name}%'</if>
        </where>
    </select>

</mapper>
