<?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.caimei.www.mapper.BaseDao">
    <select id="getSearchKeyword" resultType="java.lang.String">
        select name from keyword
        where validFlag=1
        order by sortIndex desc
    </select>
    <select id="getTopMenus" resultType="com.caimei.www.pojo.base.TopMenu">
		select
            id,
            navigationName as name,
            type,
            link,
            sort
		from new_page_first_navigation
		where wwwEnabledStatus='1' and delFlag = 0
		order by sort desc,createDate desc
		limit 7
    </select>
    <select id="getSubMenus" resultType="com.caimei.www.pojo.base.SubMenu">
		select
            id,
            firstNavigationId as topId,
            navigationName as name,
            navigationImage as image,
            link,
            sort
		from new_page_secondary_navigation
		where wwwEnabledStatus='1' and delFlag = 0
		and firstNavigationId = #{topId}
		order by sort desc,createDate desc
    </select>
    <select id="getHelpPageTypes" resultType="com.caimei.www.pojo.base.HelpPageType">
		SELECT
		c_helpPageTypeID as id,
		c_helpPageTypeName as name
		FROM c_helpPageType
    </select>
    <select id="getHelpPagesByType" resultType="com.caimei.www.pojo.base.HelpPage">
		select
            helpPageID as id,
            helpPageTypeID as typeId,
            title as name
		from helpPage
		where validFlag = 1
		and helpPageTypeID = #{typeId}
		order by sortIndex
    </select>
    <select id="getFriendLinks" resultType="com.caimei.www.pojo.base.FriendLink">
		select id,name,link
		from new_page_friendship_link
		where delFlag = 0 order by id
    </select>
</mapper>
