<?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="cn.edu.whu.boot.collection.mapper.SearchPageMapper">

    <select id="getPageDataByStatus" parameterType="java.lang.String" resultType="java.util.Map">
        SELECT * FROM ${tableNameInDB}
        where status = #{status}
    </select>

    <select id="getUncheckedPageData" parameterType="java.lang.String" resultType="java.util.Map">
        SELECT * FROM ${tableNameInDB}
--         where status = 0 or status = 1
        WHERE status = 1
    </select>

    <select id="getPageDataByFuzzySearch" resultType="java.util.Map">
        SELECT * FROM ${tableNameInDB} WHERE ${fieldNameInDB} LIKE ${searchKey}
    </select>

    <select id="getUncheckedPageDataByWorker" resultType="java.util.Map">
        SELECT * FROM ${tableNameInDB}
        WHERE status = 1 AND (collector = #{workerId} OR reviewer = #{workerId})
<!--        SELECT * FROM ${tableNameInDB}-->
<!--        WHERE status = 1-->
    </select>


    <select id="getPageDataByStatusAndWorker" resultType="java.util.Map">
        SELECT * FROM ${table}
        where status = #{status} AND (collector = #{workerId} OR reviewer = #{workerId})
<!--        SELECT * FROM ${table}-->
<!--        where status = #{status}-->
    </select>
<!--    适配非根表无status字段情况下的数据查询  -->
    <select id="getPageDataByWorkerNoStatus" resultType="java.util.Map">
        SELECT * FROM ${tableNameInDB}
    </select>

</mapper>