Mybatis muchas páginas hace el número de consultas

Lista de artículos consulta utiliza muchos

<id = tipo "articleResultMap" resultMap = "com.hq.advert.web.article.vo.ArticleMappingVo"> 
        <id columna = propiedad "article_id" = "articleId" /> 
        <columna de resultados = propiedad "article_title" = "articleTitle "/> 
        <resultado propiedad =" articleAuther "columna = "article_auther"/> 
        <resultado propiedad = "articleContent" columna = "article_content"/> 
        <resultado propiedad = "articleCreateTime" columna = "article_create_time"/> 
        <resultado propiedad =" articleDealerId" columna = "article_dealer_id"/> 
        <property = resultado de "columna"= "articleLalbel article_lalbel"/>
        <resultado propiedad = columna "articleIssueTime" = "article_issue_time" /> 
        <resultado de propiedad = "articlePageViews" Columna = "article_page_views" /> 
        <resultado propiedad = "articleStatus" columna = "article_status" /> 
        <resultado propiedad = columna "articleModifyTime" = "article_modify_time" /> 
        <resultado de propiedad = "articleChannelPageViews" Columna = "article_channel_page_views" /> 
        <association propiedad = columna "businessVo" = "article_id" 
                     javaType = "com.hq.advert.web.article.vo.ArticleBusinessMappingVo" 
                     seleccionar = "com.hq.advert.mapper.BusinessArticleMapper.selectByArticleId" 
        > 
        </ asociación> 
        <colección propiedad = "channelVo" OfType = "com.hq.advert.web.article.vo.ArticleChannelMappingVo"
                    columna = "articleId"> 
            <propiedad id = columna "id" = "id" /> 
            <Resultado Propiedades = columna "channelId" = "CHANNEL_ID" /> 
            <resultado de propiedad = "channelPageViews" Columna = "channel_page_views" /> 
            <propiedad de asociación = "articleChannelVo" columna = "CHANNEL_ID" 
                         javaType = "com.hq.advert.web .article.vo.ArticleChannelChangnelMappingVo" 
                         select = "com.hq.advert.mapper.ChannelVoMapper.selectChannelById"/> 
        </ colección> 
    </ resultMap>

  

Escribir código que dará lugar a muchos después de que el número no está en la página

<propiedad de colección = "channelVo" OfType = "com.hq.advert.web.article.vo.ArticleChannelMappingVo" 
                    columna = "articleId"> 
            <propiedad id = columna "id" = "id" /> 
            <property resultado = "channelId "columna =" CHANNEL_ID "/> 
            <resultado propiedad =" channelPageViews "columna = "channel_page_views"/> 
            <propiedad de asociación = "articleChannelVo" columna = "CHANNEL_ID" 
                         javaType =" com.hq.advert.web.article.vo.ArticleChannelChangnelMappingVo " 
                         select =" com.hq.advert.mapper.ChannelVoMapper.selectChannelById "/> 
        </ Colección>

  

soluciones

<id = tipo "articleResultMap" resultMap = "com.hq.advert.web.article.vo.ArticleMappingVo"> 
        <id columna = propiedad "article_id" = "articleId" /> 
        <columna de resultados = propiedad "article_title" = "articleTitle "/> 
        <resultado propiedad =" articleAuther "columna = "article_auther"/> 
        <resultado propiedad = "articleContent" columna = "article_content"/> 
        <resultado propiedad = "articleCreateTime" columna = "article_create_time"/> 
        <resultado propiedad =" articleDealerId" columna = "article_dealer_id"/> 
        <property = resultado de "columna"= "articleLalbel article_lalbel"/>
        <resultado propiedad = "articleIssueTime" columna = "article_issue_time" />  
        <resultado de propiedad = "articlePageViews" Columna = "article_page_views" />
        <resultado propiedad = "articleStatus" columna = "article_status" />
        <resultado propiedad = "articleModifyTime" columna = "article_modify_time" /> 
        <resultado de propiedad = "articleChannelPageViews" Columna = "article_channel_page_views" /> 
        <association propiedad = columna "businessVo" = "article_id" 
                     javaType = "com.hq.advert.web .article.vo.ArticleBusinessMappingVo " 
                     seleccione = "com.hq.advert.mapper.BusinessArticleMapper.selectByArticleId" 
        > 
        </ asociación> 
        <colección propiedad = "channelVo" OfType =" com.hq.advert.web.article.vo.ArticleChannelMappingVo " 
                    columna =" article_id "select =" com.hq.advert.mapper.ArticleChannelMapper.selectArticleChannelList"/> 

    </ resultMap>

  

Supongo que te gusta

Origin www.cnblogs.com/song1024/p/12501758.html
Recomendado
Clasificación