<?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.gxwebsoft.apps.mapper.HualalaShopMapper">

    <!-- 关联查询sql -->
    <sql id="selectSql">
        SELECT a.*
        FROM apps_hualala_shop a
        <where>
            <if test="param.shopId != null">
                AND a.shop_id = #{param.shopId}
            </if>
            <if test="param.shopName != null">
                AND a.shop_name LIKE CONCAT('%', #{param.shopName}, '%')
            </if>
            <if test="param.logoUrl != null">
                AND a.logo_url LIKE CONCAT('%', #{param.logoUrl}, '%')
            </if>
            <if test="param.shopCity != null">
                AND a.shop_city LIKE CONCAT('%', #{param.shopCity}, '%')
            </if>
            <if test="param.shopCityName != null">
                AND a.shop_city_name LIKE CONCAT('%', #{param.shopCityName}, '%')
            </if>
            <if test="param.shopOpenTime != null">
                AND a.shop_open_time LIKE CONCAT('%', #{param.shopOpenTime}, '%')
            </if>
            <if test="param.shopPhone != null">
                AND a.shop_phone LIKE CONCAT('%', #{param.shopPhone}, '%')
            </if>
            <if test="param.acspType != null">
                AND a.acsp_type LIKE CONCAT('%', #{param.acspType}, '%')
            </if>
            <if test="param.action != null">
                AND a.action LIKE CONCAT('%', #{param.action}, '%')
            </if>
            <if test="param.actionTime != null">
                AND a.action_time LIKE CONCAT('%', #{param.actionTime}, '%')
            </if>
            <if test="param.brandId != null">
                AND a.brand_id LIKE CONCAT('%', #{param.brandId}, '%')
            </if>
            <if test="param.brandName != null">
                AND a.brand_name LIKE CONCAT('%', #{param.brandName}, '%')
            </if>
            <if test="param.businessModel != null">
                AND a.business_model LIKE CONCAT('%', #{param.businessModel}, '%')
            </if>
            <if test="param.imagePath != null">
                AND a.image_path LIKE CONCAT('%', #{param.imagePath}, '%')
            </if>
            <if test="param.mapLatitudeValueBaiDu != null">
                AND a.map_latitude_value_bai_du LIKE CONCAT('%', #{param.mapLatitudeValueBaiDu}, '%')
            </if>
            <if test="param.mapLongitudeValueBaiDu != null">
                AND a.map_longitude_value_bai_du LIKE CONCAT('%', #{param.mapLongitudeValueBaiDu}, '%')
            </if>
            <if test="param.operationMode != null">
                AND a.operation_mode = #{param.operationMode}
            </if>
            <if test="param.sortNumber != null">
                AND a.sort_number = #{param.sortNumber}
            </if>
            <if test="param.comments != null">
                AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
            </if>
            <if test="param.status != null">
                AND a.status = #{param.status}
            </if>
            <if test="param.deleted != null">
                AND a.deleted = #{param.deleted}
            </if>
            <if test="param.deleted == null">
                AND a.deleted = 0
            </if>
            <if test="param.customerId != null">
                AND a.customer_id = #{param.customerId}
            </if>
            <if test="param.createTimeStart != null">
                AND a.create_time &gt;= #{param.createTimeStart}
            </if>
            <if test="param.createTimeEnd != null">
                AND a.create_time &lt;= #{param.createTimeEnd}
            </if>
        </where>
    </sql>

    <!-- 分页查询 -->
    <select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.HualalaShop">
        <include refid="selectSql"></include>
    </select>

    <!-- 查询全部 -->
    <select id="selectListRel" resultType="com.gxwebsoft.apps.entity.HualalaShop">
        <include refid="selectSql"></include>
    </select>

</mapper>
