<?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="jnpf.cultivate.mapper.FtbCultivateIdentifyItemsPoolMapper">


    <select id="webPageList" resultType="jnpf.model.cultivate.v2.item_pool.vo.FtbCultivateIdentifyItemsPoolVo">
        SELECT
        p.F_Id AS id,
        p.F_CateId AS cateId,
        c.F_Name AS cateName,
        p.F_Name AS name,
        F_Type AS type,
        F_TotalScore AS totalScore,
        F_MinScore AS minScore,
        F_MaxScore AS maxScore,
        p.F_LastModifyUserId AS userId,
        p.F_LastModifyTime AS time,
        p.F_BusinessId AS businessId
        FROM
        ftb_cultivate_identify_items_pool AS p
        LEFT JOIN ftb_cultivate_identify_categories AS c ON p.F_CateId = c.F_Id
        WHERE
        p.F_EnabledMark = 0
        <if test="params.keyWord!= null and params.keyWord!= ''">
            and  p.F_Name like CONCAT('%',#{params.keyWord},'%')
        </if>
        <if test="params.cateId!= null and params.cateId!= ''">
            and  p.F_CateId = #{params.cateId}
        </if>
    </select>

    <select id="countByCateId" resultType="jnpf.model.cultivate.dto.learn.BatchCommonCountDto">
        SELECT F_CateId    AS selectKey,
               COUNT(F_Id) AS num
        FROM ftb_cultivate_identify_items_pool
        WHERE F_EnabledMark = 0
        GROUP BY F_CateId
    </select>
</mapper>