<?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.house365.ws.dao.mapper.CityMapper">

    <resultMap id="infoMap" type="com.house365.beans.entity.CityEntity">
        <result property="id" column="id"/>
        <result property="cityId" column="cityId"/>
        <result property="cityName" column="cityName"/>
        <result property="cityApi" column="city_api"/>
        <result property="flag" column="flag"/>
        <result property="createTime" column="createTime"/>
        <result property="updateTime" column="updateTime"/>
    </resultMap>

    <select id="queryList" resultMap="infoMap" parameterType="map">
        SELECT
         *
        FROM
         city
        where flag = 1
        <if test="cityName != null and cityName != ''">
            AND cityName = #{cityName}
        </if>
        <if test="cityId != null and cityId != ''">
            AND cityId = #{cityId}
        </if>
    </select>

</mapper>