<?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.ms.dal.mapper.QueueMapper">
    <update id="updateLocked">
        update  ${tableName}
        set locked =#{locked},gmt_modified='${gmtModified}'
        where ${queueIdName} = ${queueId}
    </update>


    <select id="getQueueCnt" resultType="java.lang.Integer">
        SELECT COUNT(*) FROM ${queueName} WHERE  ${whereStr}
    </select>
    <select id="selectShopIdAndCnt" resultType="java.util.Map">
        SELECT shop_id, COUNT(*) AS cnt FROM ${bufferName}
        <if test="whereStr != null">
            WHERE ${whereStr}
        </if>

        GROUP BY shop_id
    </select>
    <select id="select" resultType="java.util.Map">
        SELECT * FROM ${tableName}
        ${whereStr}
    </select>
</mapper>
