<?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.izouma.awesomeadmin.dao.StoreInfoMapper">
    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.StoreInfo">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <result column="update_user" property="updateUser" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="create_user" property="createUser" jdbcType="VARCHAR"/>
        <result column="user_id" property="userId" jdbcType="INTEGER"/>
        <result column="user_name" property="userName" jdbcType="VARCHAR"/>
        <result column="store_name" property="storeName" jdbcType="VARCHAR"/>
        <result column="service_type" property="serviceType" jdbcType="VARCHAR"/>
        <result column="description" property="description" jdbcType="VARCHAR"/>
        <result column="icon" property="icon" jdbcType="VARCHAR"/>
        <result column="province" property="province" jdbcType="VARCHAR"/>
        <result column="citye" property="citye" jdbcType="VARCHAR"/>
        <result column="district" property="district" jdbcType="VARCHAR"/>
        <result column="address_detail" property="addressDetail" jdbcType="VARCHAR"/>
        <result column="bank_card" property="bankCard" jdbcType="VARCHAR"/>
        <result column="bank_name" property="bankName" jdbcType="VARCHAR"/>
        <result column="open_name" property="openName" jdbcType="VARCHAR"/>
        <result column="credit" property="credit" jdbcType="VARCHAR"/>
        <result column="use_flag" property="useFlag" jdbcType="CHAR"/>
        <result column="rank" property="rank" jdbcType="INTEGER"/>
        <result column="response_time" property="responseTime" jdbcType="INTEGER"/>
        <result column="rework_rate" property="reworkRate" jdbcType="INTEGER"/>
        <result column="hot_flag" property="hotFlag" jdbcType="INTEGER"/>
        <result column="home_flag" property="homeFlag" jdbcType="INTEGER"/>
        <result column="type_flag" property="typeFlag" jdbcType="INTEGER"/>
        <result column="subclass" property="subclass" jdbcType="VARCHAR"/>
        <result column="storelabel" property="storelabel" jdbcType="VARCHAR"/>
        <result column="memory_space" property="memorySpace" jdbcType="DECIMAL"/>
    </resultMap>
    <sql id="Base_Column_List">
        <trim suffixOverrides=",">
            id,

            del_flag,

            update_time,

            update_user,

            create_time,

            create_user,

            user_id,

            user_name,

            store_name,

            service_type,

            description,

            icon,

            province,

            citye,

            district,

            address_detail,

            bank_card,

            bank_name,

            open_name,

            credit,

            use_flag,

            rank,

            response_time,

            rework_rate,

            hot_flag,

            home_flag,

            type_flag,

            subclass,

            storelabel,

            memory_space,

        </trim>
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
        select
        <include refid="Base_Column_List"/>
        from store_info
        where id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
        delete from store_info
        where id = #{id,jdbcType=INTEGER}
    </delete>
    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.StoreInfo" useGeneratedKeys="true"
            keyProperty="id">
        insert into store_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id!= null">
                id,
            </if>
            <if test="delFlag!= null">
                del_flag,
            </if>
            <if test="updateTime!= null">
                update_time,
            </if>
            <if test="updateUser!= null">
                update_user,
            </if>
            <if test="createTime!= null">
                create_time,
            </if>
            <if test="createUser!= null">
                create_user,
            </if>
            <if test="userId!= null">
                user_id,
            </if>
            <if test="userName!= null">
                user_name,
            </if>
            <if test="storeName!= null">
                store_name,
            </if>
            <if test="serviceType!= null">
                service_type,
            </if>
            <if test="description!= null">
                description,
            </if>
            <if test="icon!= null">
                icon,
            </if>
            <if test="province!= null">
                province,
            </if>
            <if test="citye!= null">
                citye,
            </if>
            <if test="district!= null">
                district,
            </if>
            <if test="addressDetail!= null">
                address_detail,
            </if>
            <if test="bankCard!= null">
                bank_card,
            </if>
            <if test="bankName!= null">
                bank_name,
            </if>
            <if test="openName!= null">
                open_name,
            </if>
            <if test="credit!= null">
                credit,
            </if>
            <if test="useFlag!= null">
                use_flag,
            </if>
            <if test="rank!= null">
                rank,
            </if>
            <if test="responseTime!= null">
                response_time,
            </if>
            <if test="reworkRate!= null">
                rework_rate,
            </if>
            <if test="hotFlag!= null">
                hot_flag,
            </if>
            <if test="homeFlag!= null">
                home_flag,
            </if>
            <if test="typeFlag!= null">
                type_flag,
            </if>
            <if test="subclass!= null">
                subclass,
            </if>
            <if test="storelabel!= null">
                storelabel,
            </if>
            <if test="memorySpace!= null">
                memory_space,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="delFlag != null">
                #{delFlag,jdbcType=CHAR},
            </if>
            <if test="updateTime != null">
                #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateUser != null">
                #{updateUser,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createUser != null">
                #{createUser,jdbcType=VARCHAR},
            </if>
            <if test="userId != null">
                #{userId,jdbcType=INTEGER},
            </if>
            <if test="userName != null">
                #{userName,jdbcType=VARCHAR},
            </if>
            <if test="storeName != null">
                #{storeName,jdbcType=VARCHAR},
            </if>
            <if test="serviceType != null">
                #{serviceType,jdbcType=VARCHAR},
            </if>
            <if test="description != null">
                #{description,jdbcType=VARCHAR},
            </if>
            <if test="icon != null">
                #{icon,jdbcType=VARCHAR},
            </if>
            <if test="province != null">
                #{province,jdbcType=VARCHAR},
            </if>
            <if test="citye != null">
                #{citye,jdbcType=VARCHAR},
            </if>
            <if test="district != null">
                #{district,jdbcType=VARCHAR},
            </if>
            <if test="addressDetail != null">
                #{addressDetail,jdbcType=VARCHAR},
            </if>
            <if test="bankCard != null">
                #{bankCard,jdbcType=VARCHAR},
            </if>
            <if test="bankName != null">
                #{bankName,jdbcType=VARCHAR},
            </if>
            <if test="openName != null">
                #{openName,jdbcType=VARCHAR},
            </if>
            <if test="credit != null">
                #{credit,jdbcType=VARCHAR},
            </if>
            <if test="useFlag != null">
                #{useFlag,jdbcType=CHAR},
            </if>
            <if test="rank != null">
                #{rank,jdbcType=INTEGER},
            </if>
            <if test="responseTime != null">
                #{responseTime,jdbcType=INTEGER},
            </if>
            <if test="reworkRate != null">
                #{reworkRate,jdbcType=INTEGER},
            </if>
            <if test="hotFlag != null">
                #{hotFlag,jdbcType=INTEGER},
            </if>
            <if test="homeFlag != null">
                #{homeFlag,jdbcType=INTEGER},
            </if>
            <if test="typeFlag != null">
                #{typeFlag,jdbcType=INTEGER},
            </if>
            <if test="subclass != null">
                #{subclass,jdbcType=VARCHAR},
            </if>
            <if test="storelabel != null">
                #{storelabel,jdbcType=VARCHAR},
            </if>
            <if test="memorySpace != null">
                #{memorySpace,jdbcType=DECIMAL},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.StoreInfo">
        update store_info
        <set>
            <if test="id != null">
                id= #{id,jdbcType=INTEGER},
            </if>
            <if test="delFlag != null">
                del_flag= #{delFlag,jdbcType=CHAR},
            </if>
            <if test="updateTime != null">
                update_time= #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateUser != null">
                update_user= #{updateUser,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">
                create_time= #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createUser != null">
                create_user= #{createUser,jdbcType=VARCHAR},
            </if>
            <if test="userId != null">
                user_id= #{userId,jdbcType=INTEGER},
            </if>
            <if test="userName != null">
                user_name= #{userName,jdbcType=VARCHAR},
            </if>
            <if test="storeName != null">
                store_name= #{storeName,jdbcType=VARCHAR},
            </if>
            <if test="serviceType != null">
                service_type= #{serviceType,jdbcType=VARCHAR},
            </if>
            <if test="description != null">
                description= #{description,jdbcType=VARCHAR},
            </if>
            <if test="icon != null">
                icon= #{icon,jdbcType=VARCHAR},
            </if>
            <if test="province != null">
                province= #{province,jdbcType=VARCHAR},
            </if>
            <if test="citye != null">
                citye= #{citye,jdbcType=VARCHAR},
            </if>
            <if test="district != null">
                district= #{district,jdbcType=VARCHAR},
            </if>
            <if test="addressDetail != null">
                address_detail= #{addressDetail,jdbcType=VARCHAR},
            </if>
            <if test="bankCard != null">
                bank_card= #{bankCard,jdbcType=VARCHAR},
            </if>
            <if test="bankName != null">
                bank_name= #{bankName,jdbcType=VARCHAR},
            </if>
            <if test="openName != null">
                open_name= #{openName,jdbcType=VARCHAR},
            </if>
            <if test="credit != null">
                credit= #{credit,jdbcType=VARCHAR},
            </if>
            <if test="useFlag != null">
                use_flag= #{useFlag,jdbcType=CHAR},
            </if>
            <if test="rank != null">
                rank= #{rank,jdbcType=INTEGER},
            </if>
            <if test="responseTime != null">
                response_time= #{responseTime,jdbcType=INTEGER},
            </if>
            <if test="reworkRate != null">
                rework_rate= #{reworkRate,jdbcType=INTEGER},
            </if>
            <if test="hotFlag != null">
                hot_flag= #{hotFlag,jdbcType=INTEGER},
            </if>
            <if test="homeFlag != null">
                home_flag= #{homeFlag,jdbcType=INTEGER},
            </if>
            <if test="typeFlag != null">
                type_flag= #{typeFlag,jdbcType=INTEGER},
            </if>
            <if test="subclass != null">
                subclass= #{subclass,jdbcType=VARCHAR},
            </if>
            <if test="storelabel != null">
                storelabel= #{storelabel,jdbcType=VARCHAR},
            </if>
            <if test="memorySpace != null">
                memory_space= #{memorySpace,jdbcType=VARCHAR},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>
    <select id="queryStoreInfoByPage" parameterType="java.util.Map"
            resultType="com.izouma.awesomeadmin.model.StoreInfo">
        select
        <include refid="Base_Column_List"/>
        from store_info
        <where>
            and del_flag = 'N'
            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
                and id = #{record.id}
            </if>
            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
                and del_flag = #{record.delFlag}
            </if>
            <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
                and update_time = #{record.updateTime}
            </if>
            <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
                and update_user = #{record.updateUser}
            </if>
            <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
                and create_time = #{record.createTime}
            </if>
            <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
                and create_user = #{record.createUser}
            </if>
            <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
                and user_id = #{record.userId}
            </if>
            <if test="record.userName != null and !&quot;&quot;.equals(record.userName)">
                and user_name = #{record.userName}
            </if>
            <if test="record.storeName != null and !&quot;&quot;.equals(record.storeName)">
                and store_name = #{record.storeName}
            </if>
            <if test="record.serviceType != null and !&quot;&quot;.equals(record.serviceType)">
                and service_type = #{record.serviceType}
            </if>
            <if test="record.description != null and !&quot;&quot;.equals(record.description)">
                and description = #{record.description}
            </if>
            <if test="record.icon != null and !&quot;&quot;.equals(record.icon)">
                and icon = #{record.icon}
            </if>
            <if test="record.province != null and !&quot;&quot;.equals(record.province)">
                and province = #{record.province}
            </if>
            <if test="record.citye != null and !&quot;&quot;.equals(record.citye)">
                and citye = #{record.citye}
            </if>
            <if test="record.district != null and !&quot;&quot;.equals(record.district)">
                and district = #{record.district}
            </if>
            <if test="record.addressDetail != null and !&quot;&quot;.equals(record.addressDetail)">
                and address_detail = #{record.addressDetail}
            </if>
            <if test="record.bankCard != null and !&quot;&quot;.equals(record.bankCard)">
                and bank_card = #{record.bankCard}
            </if>
            <if test="record.bankName != null and !&quot;&quot;.equals(record.bankName)">
                and bank_name = #{record.bankName}
            </if>
            <if test="record.openName != null and !&quot;&quot;.equals(record.openName)">
                and open_name = #{record.openName}
            </if>
            <if test="record.credit != null and !&quot;&quot;.equals(record.credit)">
                and credit = #{record.credit}
            </if>
            <if test="record.useFlag != null and !&quot;&quot;.equals(record.useFlag)">
                and use_flag = #{record.useFlag}
            </if>
            <if test="record.rank != null and !&quot;&quot;.equals(record.rank)">
                and rank = #{record.rank}
            </if>
            <if test="record.responseTime != null and !&quot;&quot;.equals(record.responseTime)">
                and response_time = #{record.responseTime}
            </if>
            <if test="record.reworkRate != null and !&quot;&quot;.equals(record.reworkRate)">
                and rework_rate = #{record.reworkRate}
            </if>
            <if test="record.hotFlag != null and !&quot;&quot;.equals(record.hotFlag)">
                and hot_flag = #{record.hotFlag}
            </if>
            <if test="record.homeFlag != null and !&quot;&quot;.equals(record.homeFlag)">
                and home_flag = #{record.homeFlag}
            </if>
            <if test="record.typeFlag != null and !&quot;&quot;.equals(record.typeFlag)">
                and type_flag = #{record.typeFlag}
            </if>
            <if test="record.subclass != null and !&quot;&quot;.equals(record.subclass)">
                and subclass = #{record.subclass}
            </if>
            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
                <trim prefix="and (" suffix=")" prefixOverrides="OR">
                    OR user_id LIKE concat('%',#{record.searchKey},'%')
                    OR user_name LIKE concat('%',#{record.searchKey},'%')
                    OR store_name LIKE concat('%',#{record.searchKey},'%')
                    OR service_type LIKE concat('%',#{record.searchKey},'%')
                    OR description LIKE concat('%',#{record.searchKey},'%')
                    OR province LIKE concat('%',#{record.searchKey},'%')
                    OR citye LIKE concat('%',#{record.searchKey},'%')
                    OR district LIKE concat('%',#{record.searchKey},'%')
                    OR address_detail LIKE concat('%',#{record.searchKey},'%')
                    OR bank_card LIKE concat('%',#{record.searchKey},'%')
                    OR bank_name LIKE concat('%',#{record.searchKey},'%')
                    OR open_name LIKE concat('%',#{record.searchKey},'%')
                    OR credit LIKE concat('%',#{record.searchKey},'%')
                    OR use_flag LIKE concat('%',#{record.searchKey},'%')
                    OR rank LIKE concat('%',#{record.searchKey},'%')
                    OR response_time LIKE concat('%',#{record.searchKey},'%')
                    OR rework_rate LIKE concat('%',#{record.searchKey},'%')
                    OR hot_flag LIKE concat('%',#{record.searchKey},'%')
                    OR home_flag LIKE concat('%',#{record.searchKey},'%')
                    OR type_flag LIKE concat('%',#{record.searchKey},'%')
                    OR subclass LIKE concat('%',#{record.searchKey},'%')
                </trim>
            </if>

            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
                    <choose>
                        <when test="item.indexOf('like') != -1">
                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
                                <if test="detailIndex == 3">
                                    concat('%',#{itemDetail},'%')
                                </if>

                                <if test="detailIndex &lt; 3">
                                    ${itemDetail}
                                </if>

                            </foreach>
                        </when>
                        <otherwise>
                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
                                <if test="detailIndex == 3">
                                    #{itemDetail}
                                </if>

                                <if test="detailIndex &lt; 3">
                                    ${itemDetail}
                                </if>

                            </foreach>
                        </otherwise>
                    </choose>


                </foreach>


            </if>

        </where>
        order by

        <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">


            <trim suffixOverrides=",">
                <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
                        ${itemDetail}
                    </foreach>
                </foreach>
            </trim>
            ,
        </if>
        rank desc , id desc
    </select>
    <select id="queryAllStoreInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.StoreInfo">
        select
        <include refid="Base_Column_List"/>
        from store_info
        <where>
            and del_flag = 'N'
            <if test="id != null and !&quot;&quot;.equals(id)">
                and id = #{id}
            </if>
            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                and del_flag = #{delFlag}
            </if>
            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
                and update_time = #{updateTime}
            </if>
            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
                and update_user = #{updateUser}
            </if>
            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
                and create_time = #{createTime}
            </if>
            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
                and create_user = #{createUser}
            </if>
            <if test="userId != null and !&quot;&quot;.equals(userId)">
                and user_id = #{userId}
            </if>
            <if test="userName != null and !&quot;&quot;.equals(userName)">
                and user_name = #{userName}
            </if>
            <if test="storeName != null and !&quot;&quot;.equals(storeName)">
                and store_name = #{storeName}
            </if>
            <if test="serviceType != null and !&quot;&quot;.equals(serviceType)">
                and service_type = #{serviceType}
            </if>
            <if test="description != null and !&quot;&quot;.equals(description)">
                and description = #{description}
            </if>
            <if test="icon != null and !&quot;&quot;.equals(icon)">
                and icon = #{icon}
            </if>
            <if test="province != null and !&quot;&quot;.equals(province)">
                and province = #{province}
            </if>
            <if test="citye != null and !&quot;&quot;.equals(citye)">
                and citye = #{citye}
            </if>
            <if test="district != null and !&quot;&quot;.equals(district)">
                and district = #{district}
            </if>
            <if test="addressDetail != null and !&quot;&quot;.equals(addressDetail)">
                and address_detail = #{addressDetail}
            </if>
            <if test="bankCard != null and !&quot;&quot;.equals(bankCard)">
                and bank_card = #{bankCard}
            </if>
            <if test="bankName != null and !&quot;&quot;.equals(bankName)">
                and bank_name = #{bankName}
            </if>
            <if test="openName != null and !&quot;&quot;.equals(openName)">
                and open_name = #{openName}
            </if>
            <if test="credit != null and !&quot;&quot;.equals(credit)">
                and credit = #{credit}
            </if>
            <if test="useFlag != null and !&quot;&quot;.equals(useFlag)">
                and use_flag = #{useFlag}
            </if>
            <if test="rank != null and !&quot;&quot;.equals(rank)">
                and rank = #{rank}
            </if>
            <if test="responseTime != null and !&quot;&quot;.equals(responseTime)">
                and response_time = #{responseTime}
            </if>
            <if test="reworkRate != null and !&quot;&quot;.equals(reworkRate)">
                and rework_rate = #{reworkRate}
            </if>
            <if test="hotFlag != null and !&quot;&quot;.equals(hotFlag)">
                and hot_flag = #{hotFlag}
            </if>
            <if test="homeFlag != null and !&quot;&quot;.equals(homeFlag)">
                and home_flag = #{homeFlag}
            </if>
            <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
                and type_flag = #{typeFlag}
            </if>
            <if test="subclass != null and !&quot;&quot;.equals(subclass)">
                and subclass = #{subclass}
            </if>
            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
                <trim prefix="and (" suffix=")" prefixOverrides="OR">
                    OR user_id LIKE concat('%',#{searchKey},'%')
                    OR user_name LIKE concat('%',#{searchKey},'%')
                    OR store_name LIKE concat('%',#{searchKey},'%')
                    OR service_type LIKE concat('%',#{searchKey},'%')
                    OR description LIKE concat('%',#{searchKey},'%')
                    OR province LIKE concat('%',#{searchKey},'%')
                    OR citye LIKE concat('%',#{searchKey},'%')
                    OR district LIKE concat('%',#{searchKey},'%')
                    OR address_detail LIKE concat('%',#{searchKey},'%')
                    OR bank_card LIKE concat('%',#{searchKey},'%')
                    OR bank_name LIKE concat('%',#{searchKey},'%')
                    OR open_name LIKE concat('%',#{searchKey},'%')
                    OR credit LIKE concat('%',#{searchKey},'%')
                    OR use_flag LIKE concat('%',#{searchKey},'%')
                    OR rank LIKE concat('%',#{searchKey},'%')
                    OR response_time LIKE concat('%',#{searchKey},'%')
                    OR rework_rate LIKE concat('%',#{searchKey},'%')
                    OR hot_flag LIKE concat('%',#{searchKey},'%')
                    OR home_flag LIKE concat('%',#{searchKey},'%')
                    OR type_flag LIKE concat('%',#{searchKey},'%')
                    OR subclass LIKE concat('%',#{searchKey},'%')
                </trim>
            </if>
            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
                    <choose>
                        <when test="item.indexOf('like') != -1">
                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
                                <if test="detailIndex == 3">
                                    concat('%',#{itemDetail},'%')
                                </if>

                                <if test="detailIndex &lt; 3">
                                    ${itemDetail}
                                </if>

                            </foreach>
                        </when>
                        <otherwise>
                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
                                <if test="detailIndex == 3">
                                    #{itemDetail}
                                </if>

                                <if test="detailIndex &lt; 3">
                                    ${itemDetail}
                                </if>

                            </foreach>
                        </otherwise>
                    </choose>


                </foreach>


            </if>
        </where>
        order by

        <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">


            <trim suffixOverrides=",">
                <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
                        ${itemDetail}
                    </foreach>
                </foreach>
            </trim>
            ,
        </if>
        rank desc , id desc
        <if test="limitNum != null and !&quot;&quot;.equals(limitNum)">
            LIMIT #{limitNum}
        </if>
    </select>
    <select id="queryAllStoreInfoForHome" parameterType="java.util.Map"
            resultType="com.izouma.awesomeadmin.model.StoreInfo">
        select
        <include refid="Base_Column_List"/>
        from store_info
        <where>
            and del_flag = 'N'
            <if test="id != null and !&quot;&quot;.equals(id)">
                and id = #{id}
            </if>
            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                and del_flag = #{delFlag}
            </if>
            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
                and update_time = #{updateTime}
            </if>
            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
                and update_user = #{updateUser}
            </if>
            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
                and create_time = #{createTime}
            </if>
            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
                and create_user = #{createUser}
            </if>
            <if test="userId != null and !&quot;&quot;.equals(userId)">
                and user_id = #{userId}
            </if>
            <if test="userName != null and !&quot;&quot;.equals(userName)">
                and user_name = #{userName}
            </if>
            <if test="storeName != null and !&quot;&quot;.equals(storeName)">
                and store_name = #{storeName}
            </if>
            <if test="serviceType != null and !&quot;&quot;.equals(serviceType)">
                and service_type = #{serviceType}
            </if>
            <if test="description != null and !&quot;&quot;.equals(description)">
                and description = #{description}
            </if>
            <if test="icon != null and !&quot;&quot;.equals(icon)">
                and icon = #{icon}
            </if>
            <if test="province != null and !&quot;&quot;.equals(province)">
                and province = #{province}
            </if>
            <if test="citye != null and !&quot;&quot;.equals(citye)">
                and citye = #{citye}
            </if>
            <if test="district != null and !&quot;&quot;.equals(district)">
                and district = #{district}
            </if>
            <if test="addressDetail != null and !&quot;&quot;.equals(addressDetail)">
                and address_detail = #{addressDetail}
            </if>
            <if test="bankCard != null and !&quot;&quot;.equals(bankCard)">
                and bank_card = #{bankCard}
            </if>
            <if test="bankName != null and !&quot;&quot;.equals(bankName)">
                and bank_name = #{bankName}
            </if>
            <if test="openName != null and !&quot;&quot;.equals(openName)">
                and open_name = #{openName}
            </if>
            <if test="credit != null and !&quot;&quot;.equals(credit)">
                and credit = #{credit}
            </if>
            <if test="useFlag != null and !&quot;&quot;.equals(useFlag)">
                and use_flag = #{useFlag}
            </if>
            <if test="rank != null and !&quot;&quot;.equals(rank)">
                and rank = #{rank}
            </if>
            <if test="responseTime != null and !&quot;&quot;.equals(responseTime)">
                and response_time = #{responseTime}
            </if>
            <if test="reworkRate != null and !&quot;&quot;.equals(reworkRate)">
                and rework_rate = #{reworkRate}
            </if>
            <if test="hotFlag != null and !&quot;&quot;.equals(hotFlag)">
                and hot_flag = #{hotFlag}
            </if>
            <if test="homeFlag != null and !&quot;&quot;.equals(homeFlag)">
                and home_flag = #{homeFlag}
            </if>
            <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
                and type_flag = #{typeFlag}
            </if>
            <if test="subclass != null and !&quot;&quot;.equals(subclass)">
                and subclass = #{subclass}
            </if>
        </where>
        order by
        rank desc , id desc
        <if test="limitNum != null and !&quot;&quot;.equals(limitNum)">
            LIMIT #{limitNum}
        </if>
    </select>
    <select id="queryStoreInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.StoreInfo">
        select
        <include refid="Base_Column_List"/>
        from store_info
        <where>
            and del_flag = 'N'
            <if test="id != null and !&quot;&quot;.equals(id)">
                and id = #{id}
            </if>
            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                and del_flag = #{delFlag}
            </if>
            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
                and update_time = #{updateTime}
            </if>
            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
                and update_user = #{updateUser}
            </if>
            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
                and create_time = #{createTime}
            </if>
            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
                and create_user = #{createUser}
            </if>
            <if test="userId != null and !&quot;&quot;.equals(userId)">
                and user_id = #{userId}
            </if>
            <if test="userName != null and !&quot;&quot;.equals(userName)">
                and user_name = #{userName}
            </if>
            <if test="storeName != null and !&quot;&quot;.equals(storeName)">
                and store_name = #{storeName}
            </if>
            <if test="serviceType != null and !&quot;&quot;.equals(serviceType)">
                and service_type = #{serviceType}
            </if>
            <if test="description != null and !&quot;&quot;.equals(description)">
                and description = #{description}
            </if>
            <if test="icon != null and !&quot;&quot;.equals(icon)">
                and icon = #{icon}
            </if>
            <if test="province != null and !&quot;&quot;.equals(province)">
                and province = #{province}
            </if>
            <if test="citye != null and !&quot;&quot;.equals(citye)">
                and citye = #{citye}
            </if>
            <if test="district != null and !&quot;&quot;.equals(district)">
                and district = #{district}
            </if>
            <if test="addressDetail != null and !&quot;&quot;.equals(addressDetail)">
                and address_detail = #{addressDetail}
            </if>
            <if test="bankCard != null and !&quot;&quot;.equals(bankCard)">
                and bank_card = #{bankCard}
            </if>
            <if test="bankName != null and !&quot;&quot;.equals(bankName)">
                and bank_name = #{bankName}
            </if>
            <if test="openName != null and !&quot;&quot;.equals(openName)">
                and open_name = #{openName}
            </if>
            <if test="credit != null and !&quot;&quot;.equals(credit)">
                and credit = #{credit}
            </if>
            <if test="useFlag != null and !&quot;&quot;.equals(useFlag)">
                and use_flag = #{useFlag}
            </if>
            <if test="rank != null and !&quot;&quot;.equals(rank)">
                and rank = #{rank}
            </if>
            <if test="responseTime != null and !&quot;&quot;.equals(responseTime)">
                and response_time = #{responseTime}
            </if>
            <if test="reworkRate != null and !&quot;&quot;.equals(reworkRate)">
                and rework_rate = #{reworkRate}
            </if>
            <if test="hotFlag != null and !&quot;&quot;.equals(hotFlag)">
                and hot_flag = #{hotFlag}
            </if>
            <if test="homeFlag != null and !&quot;&quot;.equals(homeFlag)">
                and home_flag = #{homeFlag}
            </if>
            <if test="typeFlag != null and !&quot;&quot;.equals(typeFlag)">
                and type_flag = #{typeFlag}
            </if>
            <if test="subclass != null and !&quot;&quot;.equals(subclass)">
                and subclass = #{subclass}
            </if>

        </where>
        LIMIT 1
    </select>
    <update id="delete">
        UPDATE store_info SET del_flag = 'Y'
        <where>
            AND id = #{id}
        </where>
    </update>
    <update id="updateUseFlagByUserId">
        UPDATE store_info
        <set>
            <if test="useFlag != null">
                use_flag= #{useFlag},
            </if>
            <if test="typeFlag != null">
                type_flag= #{typeFlag},
            </if>
        </set>
        <where>
            AND del_flag = 'N'
            AND user_id = #{userId}
        </where>
    </update>
    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.StoreInfo">
        select
        <include refid="Base_Column_List"/>
        from store_info
        <where>
            and del_flag = 'N'
        </where>
        order by id desc
    </select>
</mapper>

