<?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.cms.mapper.CommercialAreaMapper">
    
    <resultMap type="CommercialArea" id="CommercialAreaResult">
        <result property="commercialAreaId"    column="commercial_area_id"    />
        <result property="commercialAreaName"    column="commercial_area_name"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
        <result property="latitude"    column="latitude"    />
        <result property="longitude"    column="longitude"    />
        <result property="address"    column="address"    />
    </resultMap>

    <sql id="selectCommercialAreaVo">
        select commercial_area_id, commercial_area_name, del_flag, create_by, create_time, update_by, update_time, remark, latitude, longitude,address from commercial_area
    </sql>

    <select id="selectCommercialAreaList" parameterType="CommercialArea" resultMap="CommercialAreaResult">
        <include refid="selectCommercialAreaVo"/>
        <where>  del_flag = '0'
            <if test="commercialAreaName != null  and commercialAreaName != ''"> and commercial_area_name like concat('%', #{commercialAreaName}, '%')</if>
            <if test="address != null  and address != ''"> and address like concat('%', #{address}, '%')</if>
            <if test="latitude != null "> and latitude = #{latitude}</if>
            <if test="longitude != null "> and longitude = #{longitude}</if>
        </where>
    </select>
</mapper>